001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.PortalPreferences;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the portal preferences service. This utility wraps {@link PortalPreferencesPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see PortalPreferencesPersistence
036     * @see PortalPreferencesPersistenceImpl
037     * @generated
038     */
039    public class PortalPreferencesUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(PortalPreferences portalPreferences) {
057                    getPersistence().clearCache(portalPreferences);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<PortalPreferences> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<PortalPreferences> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<PortalPreferences> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
098             */
099            public static PortalPreferences remove(PortalPreferences portalPreferences)
100                    throws SystemException {
101                    return getPersistence().remove(portalPreferences);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
106             */
107            public static PortalPreferences update(
108                    PortalPreferences portalPreferences, boolean merge)
109                    throws SystemException {
110                    return getPersistence().update(portalPreferences, merge);
111            }
112    
113            /**
114             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
115             */
116            public static PortalPreferences update(
117                    PortalPreferences portalPreferences, boolean merge,
118                    ServiceContext serviceContext) throws SystemException {
119                    return getPersistence().update(portalPreferences, merge, serviceContext);
120            }
121    
122            /**
123            * Caches the portal preferences in the entity cache if it is enabled.
124            *
125            * @param portalPreferences the portal preferences
126            */
127            public static void cacheResult(
128                    com.liferay.portal.model.PortalPreferences portalPreferences) {
129                    getPersistence().cacheResult(portalPreferences);
130            }
131    
132            /**
133            * Caches the portal preferenceses in the entity cache if it is enabled.
134            *
135            * @param portalPreferenceses the portal preferenceses
136            */
137            public static void cacheResult(
138                    java.util.List<com.liferay.portal.model.PortalPreferences> portalPreferenceses) {
139                    getPersistence().cacheResult(portalPreferenceses);
140            }
141    
142            /**
143            * Creates a new portal preferences with the primary key. Does not add the portal preferences to the database.
144            *
145            * @param portalPreferencesId the primary key for the new portal preferences
146            * @return the new portal preferences
147            */
148            public static com.liferay.portal.model.PortalPreferences create(
149                    long portalPreferencesId) {
150                    return getPersistence().create(portalPreferencesId);
151            }
152    
153            /**
154            * Removes the portal preferences with the primary key from the database. Also notifies the appropriate model listeners.
155            *
156            * @param portalPreferencesId the primary key of the portal preferences
157            * @return the portal preferences that was removed
158            * @throws com.liferay.portal.NoSuchPreferencesException if a portal preferences with the primary key could not be found
159            * @throws SystemException if a system exception occurred
160            */
161            public static com.liferay.portal.model.PortalPreferences remove(
162                    long portalPreferencesId)
163                    throws com.liferay.portal.NoSuchPreferencesException,
164                            com.liferay.portal.kernel.exception.SystemException {
165                    return getPersistence().remove(portalPreferencesId);
166            }
167    
168            public static com.liferay.portal.model.PortalPreferences updateImpl(
169                    com.liferay.portal.model.PortalPreferences portalPreferences,
170                    boolean merge)
171                    throws com.liferay.portal.kernel.exception.SystemException {
172                    return getPersistence().updateImpl(portalPreferences, merge);
173            }
174    
175            /**
176            * Returns the portal preferences with the primary key or throws a {@link com.liferay.portal.NoSuchPreferencesException} if it could not be found.
177            *
178            * @param portalPreferencesId the primary key of the portal preferences
179            * @return the portal preferences
180            * @throws com.liferay.portal.NoSuchPreferencesException if a portal preferences with the primary key could not be found
181            * @throws SystemException if a system exception occurred
182            */
183            public static com.liferay.portal.model.PortalPreferences findByPrimaryKey(
184                    long portalPreferencesId)
185                    throws com.liferay.portal.NoSuchPreferencesException,
186                            com.liferay.portal.kernel.exception.SystemException {
187                    return getPersistence().findByPrimaryKey(portalPreferencesId);
188            }
189    
190            /**
191            * Returns the portal preferences with the primary key or returns <code>null</code> if it could not be found.
192            *
193            * @param portalPreferencesId the primary key of the portal preferences
194            * @return the portal preferences, or <code>null</code> if a portal preferences with the primary key could not be found
195            * @throws SystemException if a system exception occurred
196            */
197            public static com.liferay.portal.model.PortalPreferences fetchByPrimaryKey(
198                    long portalPreferencesId)
199                    throws com.liferay.portal.kernel.exception.SystemException {
200                    return getPersistence().fetchByPrimaryKey(portalPreferencesId);
201            }
202    
203            /**
204            * Returns the portal preferences where ownerId = &#63; and ownerType = &#63; or throws a {@link com.liferay.portal.NoSuchPreferencesException} if it could not be found.
205            *
206            * @param ownerId the owner ID
207            * @param ownerType the owner type
208            * @return the matching portal preferences
209            * @throws com.liferay.portal.NoSuchPreferencesException if a matching portal preferences could not be found
210            * @throws SystemException if a system exception occurred
211            */
212            public static com.liferay.portal.model.PortalPreferences findByO_O(
213                    long ownerId, int ownerType)
214                    throws com.liferay.portal.NoSuchPreferencesException,
215                            com.liferay.portal.kernel.exception.SystemException {
216                    return getPersistence().findByO_O(ownerId, ownerType);
217            }
218    
219            /**
220            * Returns the portal preferences where ownerId = &#63; and ownerType = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
221            *
222            * @param ownerId the owner ID
223            * @param ownerType the owner type
224            * @return the matching portal preferences, or <code>null</code> if a matching portal preferences could not be found
225            * @throws SystemException if a system exception occurred
226            */
227            public static com.liferay.portal.model.PortalPreferences fetchByO_O(
228                    long ownerId, int ownerType)
229                    throws com.liferay.portal.kernel.exception.SystemException {
230                    return getPersistence().fetchByO_O(ownerId, ownerType);
231            }
232    
233            /**
234            * Returns the portal preferences where ownerId = &#63; and ownerType = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
235            *
236            * @param ownerId the owner ID
237            * @param ownerType the owner type
238            * @param retrieveFromCache whether to use the finder cache
239            * @return the matching portal preferences, or <code>null</code> if a matching portal preferences could not be found
240            * @throws SystemException if a system exception occurred
241            */
242            public static com.liferay.portal.model.PortalPreferences fetchByO_O(
243                    long ownerId, int ownerType, boolean retrieveFromCache)
244                    throws com.liferay.portal.kernel.exception.SystemException {
245                    return getPersistence().fetchByO_O(ownerId, ownerType, retrieveFromCache);
246            }
247    
248            /**
249            * Returns all the portal preferenceses.
250            *
251            * @return the portal preferenceses
252            * @throws SystemException if a system exception occurred
253            */
254            public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll()
255                    throws com.liferay.portal.kernel.exception.SystemException {
256                    return getPersistence().findAll();
257            }
258    
259            /**
260            * Returns a range of all the portal preferenceses.
261            *
262            * <p>
263            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
264            * </p>
265            *
266            * @param start the lower bound of the range of portal preferenceses
267            * @param end the upper bound of the range of portal preferenceses (not inclusive)
268            * @return the range of portal preferenceses
269            * @throws SystemException if a system exception occurred
270            */
271            public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll(
272                    int start, int end)
273                    throws com.liferay.portal.kernel.exception.SystemException {
274                    return getPersistence().findAll(start, end);
275            }
276    
277            /**
278            * Returns an ordered range of all the portal preferenceses.
279            *
280            * <p>
281            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
282            * </p>
283            *
284            * @param start the lower bound of the range of portal preferenceses
285            * @param end the upper bound of the range of portal preferenceses (not inclusive)
286            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
287            * @return the ordered range of portal preferenceses
288            * @throws SystemException if a system exception occurred
289            */
290            public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll(
291                    int start, int end,
292                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
293                    throws com.liferay.portal.kernel.exception.SystemException {
294                    return getPersistence().findAll(start, end, orderByComparator);
295            }
296    
297            /**
298            * Removes the portal preferences where ownerId = &#63; and ownerType = &#63; from the database.
299            *
300            * @param ownerId the owner ID
301            * @param ownerType the owner type
302            * @throws SystemException if a system exception occurred
303            */
304            public static void removeByO_O(long ownerId, int ownerType)
305                    throws com.liferay.portal.NoSuchPreferencesException,
306                            com.liferay.portal.kernel.exception.SystemException {
307                    getPersistence().removeByO_O(ownerId, ownerType);
308            }
309    
310            /**
311            * Removes all the portal preferenceses from the database.
312            *
313            * @throws SystemException if a system exception occurred
314            */
315            public static void removeAll()
316                    throws com.liferay.portal.kernel.exception.SystemException {
317                    getPersistence().removeAll();
318            }
319    
320            /**
321            * Returns the number of portal preferenceses where ownerId = &#63; and ownerType = &#63;.
322            *
323            * @param ownerId the owner ID
324            * @param ownerType the owner type
325            * @return the number of matching portal preferenceses
326            * @throws SystemException if a system exception occurred
327            */
328            public static int countByO_O(long ownerId, int ownerType)
329                    throws com.liferay.portal.kernel.exception.SystemException {
330                    return getPersistence().countByO_O(ownerId, ownerType);
331            }
332    
333            /**
334            * Returns the number of portal preferenceses.
335            *
336            * @return the number of portal preferenceses
337            * @throws SystemException if a system exception occurred
338            */
339            public static int countAll()
340                    throws com.liferay.portal.kernel.exception.SystemException {
341                    return getPersistence().countAll();
342            }
343    
344            public static PortalPreferencesPersistence getPersistence() {
345                    if (_persistence == null) {
346                            _persistence = (PortalPreferencesPersistence)PortalBeanLocatorUtil.locate(PortalPreferencesPersistence.class.getName());
347    
348                            ReferenceRegistry.registerReference(PortalPreferencesUtil.class,
349                                    "_persistence");
350                    }
351    
352                    return _persistence;
353            }
354    
355            public void setPersistence(PortalPreferencesPersistence persistence) {
356                    _persistence = persistence;
357    
358                    ReferenceRegistry.registerReference(PortalPreferencesUtil.class,
359                            "_persistence");
360            }
361    
362            private static PortalPreferencesPersistence _persistence;
363    }