001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 to cache
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 to cache
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 to remove
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            * Finds 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 to find
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            * Finds 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 to find
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            * Finds 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 to search with
207            * @param ownerType the owner type to search with
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            * Finds 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 to search with
223            * @param ownerType the owner type to search with
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            * Finds 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 to search with
237            * @param ownerType the owner type to search with
238            * @return the matching portal preferences, or <code>null</code> if a matching portal preferences could not be found
239            * @throws SystemException if a system exception occurred
240            */
241            public static com.liferay.portal.model.PortalPreferences fetchByO_O(
242                    long ownerId, int ownerType, boolean retrieveFromCache)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getPersistence().fetchByO_O(ownerId, ownerType, retrieveFromCache);
245            }
246    
247            /**
248            * Finds all the portal preferenceses.
249            *
250            * @return the portal preferenceses
251            * @throws SystemException if a system exception occurred
252            */
253            public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll()
254                    throws com.liferay.portal.kernel.exception.SystemException {
255                    return getPersistence().findAll();
256            }
257    
258            /**
259            * Finds a range of all the portal preferenceses.
260            *
261            * <p>
262            * 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.
263            * </p>
264            *
265            * @param start the lower bound of the range of portal preferenceses to return
266            * @param end the upper bound of the range of portal preferenceses to return (not inclusive)
267            * @return the range of portal preferenceses
268            * @throws SystemException if a system exception occurred
269            */
270            public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll(
271                    int start, int end)
272                    throws com.liferay.portal.kernel.exception.SystemException {
273                    return getPersistence().findAll(start, end);
274            }
275    
276            /**
277            * Finds an ordered range of all the portal preferenceses.
278            *
279            * <p>
280            * 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.
281            * </p>
282            *
283            * @param start the lower bound of the range of portal preferenceses to return
284            * @param end the upper bound of the range of portal preferenceses to return (not inclusive)
285            * @param orderByComparator the comparator to order the results by
286            * @return the ordered range of portal preferenceses
287            * @throws SystemException if a system exception occurred
288            */
289            public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll(
290                    int start, int end,
291                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
292                    throws com.liferay.portal.kernel.exception.SystemException {
293                    return getPersistence().findAll(start, end, orderByComparator);
294            }
295    
296            /**
297            * Removes the portal preferences where ownerId = &#63; and ownerType = &#63; from the database.
298            *
299            * @param ownerId the owner ID to search with
300            * @param ownerType the owner type to search with
301            * @throws SystemException if a system exception occurred
302            */
303            public static void removeByO_O(long ownerId, int ownerType)
304                    throws com.liferay.portal.NoSuchPreferencesException,
305                            com.liferay.portal.kernel.exception.SystemException {
306                    getPersistence().removeByO_O(ownerId, ownerType);
307            }
308    
309            /**
310            * Removes all the portal preferenceses from the database.
311            *
312            * @throws SystemException if a system exception occurred
313            */
314            public static void removeAll()
315                    throws com.liferay.portal.kernel.exception.SystemException {
316                    getPersistence().removeAll();
317            }
318    
319            /**
320            * Counts all the portal preferenceses where ownerId = &#63; and ownerType = &#63;.
321            *
322            * @param ownerId the owner ID to search with
323            * @param ownerType the owner type to search with
324            * @return the number of matching portal preferenceses
325            * @throws SystemException if a system exception occurred
326            */
327            public static int countByO_O(long ownerId, int ownerType)
328                    throws com.liferay.portal.kernel.exception.SystemException {
329                    return getPersistence().countByO_O(ownerId, ownerType);
330            }
331    
332            /**
333            * Counts all the portal preferenceses.
334            *
335            * @return the number of portal preferenceses
336            * @throws SystemException if a system exception occurred
337            */
338            public static int countAll()
339                    throws com.liferay.portal.kernel.exception.SystemException {
340                    return getPersistence().countAll();
341            }
342    
343            public static PortalPreferencesPersistence getPersistence() {
344                    if (_persistence == null) {
345                            _persistence = (PortalPreferencesPersistence)PortalBeanLocatorUtil.locate(PortalPreferencesPersistence.class.getName());
346    
347                            ReferenceRegistry.registerReference(PortalPreferencesUtil.class,
348                                    "_persistence");
349                    }
350    
351                    return _persistence;
352            }
353    
354            public void setPersistence(PortalPreferencesPersistence persistence) {
355                    _persistence = persistence;
356    
357                    ReferenceRegistry.registerReference(PortalPreferencesUtil.class,
358                            "_persistence");
359            }
360    
361            private static PortalPreferencesPersistence _persistence;
362    }