001    /**
002     * Copyright (c) 2000-2010 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.portlet.ratings.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.service.ServiceContext;
022    
023    import com.liferay.portlet.ratings.model.RatingsStats;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the ratings stats service.
029     *
030     * <p>
031     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class.
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see RatingsStatsPersistence
036     * @see RatingsStatsPersistenceImpl
037     * @generated
038     */
039    public class RatingsStatsUtil {
040            /**
041             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
042             */
043            public static void clearCache() {
044                    getPersistence().clearCache();
045            }
046    
047            /**
048             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
049             */
050            public static void clearCache(RatingsStats ratingsStats) {
051                    getPersistence().clearCache(ratingsStats);
052            }
053    
054            /**
055             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
056             */
057            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
058                    throws SystemException {
059                    return getPersistence().countWithDynamicQuery(dynamicQuery);
060            }
061    
062            /**
063             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
064             */
065            public static List<RatingsStats> findWithDynamicQuery(
066                    DynamicQuery dynamicQuery) throws SystemException {
067                    return getPersistence().findWithDynamicQuery(dynamicQuery);
068            }
069    
070            /**
071             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
072             */
073            public static List<RatingsStats> findWithDynamicQuery(
074                    DynamicQuery dynamicQuery, int start, int end)
075                    throws SystemException {
076                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
077            }
078    
079            /**
080             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
081             */
082            public static List<RatingsStats> findWithDynamicQuery(
083                    DynamicQuery dynamicQuery, int start, int end,
084                    OrderByComparator orderByComparator) throws SystemException {
085                    return getPersistence()
086                                       .findWithDynamicQuery(dynamicQuery, start, end,
087                            orderByComparator);
088            }
089    
090            /**
091             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
092             */
093            public static RatingsStats remove(RatingsStats ratingsStats)
094                    throws SystemException {
095                    return getPersistence().remove(ratingsStats);
096            }
097    
098            /**
099             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
100             */
101            public static RatingsStats update(RatingsStats ratingsStats, boolean merge)
102                    throws SystemException {
103                    return getPersistence().update(ratingsStats, merge);
104            }
105    
106            /**
107             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
108             */
109            public static RatingsStats update(RatingsStats ratingsStats, boolean merge,
110                    ServiceContext serviceContext) throws SystemException {
111                    return getPersistence().update(ratingsStats, merge, serviceContext);
112            }
113    
114            /**
115            * Caches the ratings stats in the entity cache if it is enabled.
116            *
117            * @param ratingsStats the ratings stats to cache
118            */
119            public static void cacheResult(
120                    com.liferay.portlet.ratings.model.RatingsStats ratingsStats) {
121                    getPersistence().cacheResult(ratingsStats);
122            }
123    
124            /**
125            * Caches the ratings statses in the entity cache if it is enabled.
126            *
127            * @param ratingsStatses the ratings statses to cache
128            */
129            public static void cacheResult(
130                    java.util.List<com.liferay.portlet.ratings.model.RatingsStats> ratingsStatses) {
131                    getPersistence().cacheResult(ratingsStatses);
132            }
133    
134            /**
135            * Creates a new ratings stats with the primary key.
136            *
137            * @param statsId the primary key for the new ratings stats
138            * @return the new ratings stats
139            */
140            public static com.liferay.portlet.ratings.model.RatingsStats create(
141                    long statsId) {
142                    return getPersistence().create(statsId);
143            }
144    
145            /**
146            * Removes the ratings stats with the primary key from the database. Also notifies the appropriate model listeners.
147            *
148            * @param statsId the primary key of the ratings stats to remove
149            * @return the ratings stats that was removed
150            * @throws com.liferay.portlet.ratings.NoSuchStatsException if a ratings stats with the primary key could not be found
151            * @throws SystemException if a system exception occurred
152            */
153            public static com.liferay.portlet.ratings.model.RatingsStats remove(
154                    long statsId)
155                    throws com.liferay.portal.kernel.exception.SystemException,
156                            com.liferay.portlet.ratings.NoSuchStatsException {
157                    return getPersistence().remove(statsId);
158            }
159    
160            public static com.liferay.portlet.ratings.model.RatingsStats updateImpl(
161                    com.liferay.portlet.ratings.model.RatingsStats ratingsStats,
162                    boolean merge)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getPersistence().updateImpl(ratingsStats, merge);
165            }
166    
167            /**
168            * Finds the ratings stats with the primary key or throws a {@link com.liferay.portlet.ratings.NoSuchStatsException} if it could not be found.
169            *
170            * @param statsId the primary key of the ratings stats to find
171            * @return the ratings stats
172            * @throws com.liferay.portlet.ratings.NoSuchStatsException if a ratings stats with the primary key could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portlet.ratings.model.RatingsStats findByPrimaryKey(
176                    long statsId)
177                    throws com.liferay.portal.kernel.exception.SystemException,
178                            com.liferay.portlet.ratings.NoSuchStatsException {
179                    return getPersistence().findByPrimaryKey(statsId);
180            }
181    
182            /**
183            * Finds the ratings stats with the primary key or returns <code>null</code> if it could not be found.
184            *
185            * @param statsId the primary key of the ratings stats to find
186            * @return the ratings stats, or <code>null</code> if a ratings stats with the primary key could not be found
187            * @throws SystemException if a system exception occurred
188            */
189            public static com.liferay.portlet.ratings.model.RatingsStats fetchByPrimaryKey(
190                    long statsId)
191                    throws com.liferay.portal.kernel.exception.SystemException {
192                    return getPersistence().fetchByPrimaryKey(statsId);
193            }
194    
195            /**
196            * Finds the ratings stats where classNameId = &#63; and classPK = &#63; or throws a {@link com.liferay.portlet.ratings.NoSuchStatsException} if it could not be found.
197            *
198            * @param classNameId the class name id to search with
199            * @param classPK the class p k to search with
200            * @return the matching ratings stats
201            * @throws com.liferay.portlet.ratings.NoSuchStatsException if a matching ratings stats could not be found
202            * @throws SystemException if a system exception occurred
203            */
204            public static com.liferay.portlet.ratings.model.RatingsStats findByC_C(
205                    long classNameId, long classPK)
206                    throws com.liferay.portal.kernel.exception.SystemException,
207                            com.liferay.portlet.ratings.NoSuchStatsException {
208                    return getPersistence().findByC_C(classNameId, classPK);
209            }
210    
211            /**
212            * Finds the ratings stats where classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
213            *
214            * @param classNameId the class name id to search with
215            * @param classPK the class p k to search with
216            * @return the matching ratings stats, or <code>null</code> if a matching ratings stats could not be found
217            * @throws SystemException if a system exception occurred
218            */
219            public static com.liferay.portlet.ratings.model.RatingsStats fetchByC_C(
220                    long classNameId, long classPK)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getPersistence().fetchByC_C(classNameId, classPK);
223            }
224    
225            /**
226            * Finds the ratings stats where classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
227            *
228            * @param classNameId the class name id to search with
229            * @param classPK the class p k to search with
230            * @return the matching ratings stats, or <code>null</code> if a matching ratings stats could not be found
231            * @throws SystemException if a system exception occurred
232            */
233            public static com.liferay.portlet.ratings.model.RatingsStats fetchByC_C(
234                    long classNameId, long classPK, boolean retrieveFromCache)
235                    throws com.liferay.portal.kernel.exception.SystemException {
236                    return getPersistence()
237                                       .fetchByC_C(classNameId, classPK, retrieveFromCache);
238            }
239    
240            /**
241            * Finds all the ratings statses.
242            *
243            * @return the ratings statses
244            * @throws SystemException if a system exception occurred
245            */
246            public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll()
247                    throws com.liferay.portal.kernel.exception.SystemException {
248                    return getPersistence().findAll();
249            }
250    
251            /**
252            * Finds a range of all the ratings statses.
253            *
254            * <p>
255            * 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.
256            * </p>
257            *
258            * @param start the lower bound of the range of ratings statses to return
259            * @param end the upper bound of the range of ratings statses to return (not inclusive)
260            * @return the range of ratings statses
261            * @throws SystemException if a system exception occurred
262            */
263            public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll(
264                    int start, int end)
265                    throws com.liferay.portal.kernel.exception.SystemException {
266                    return getPersistence().findAll(start, end);
267            }
268    
269            /**
270            * Finds an ordered range of all the ratings statses.
271            *
272            * <p>
273            * 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.
274            * </p>
275            *
276            * @param start the lower bound of the range of ratings statses to return
277            * @param end the upper bound of the range of ratings statses to return (not inclusive)
278            * @param orderByComparator the comparator to order the results by
279            * @return the ordered range of ratings statses
280            * @throws SystemException if a system exception occurred
281            */
282            public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll(
283                    int start, int end,
284                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
285                    throws com.liferay.portal.kernel.exception.SystemException {
286                    return getPersistence().findAll(start, end, orderByComparator);
287            }
288    
289            /**
290            * Removes the ratings stats where classNameId = &#63; and classPK = &#63; from the database.
291            *
292            * @param classNameId the class name id to search with
293            * @param classPK the class p k to search with
294            * @throws SystemException if a system exception occurred
295            */
296            public static void removeByC_C(long classNameId, long classPK)
297                    throws com.liferay.portal.kernel.exception.SystemException,
298                            com.liferay.portlet.ratings.NoSuchStatsException {
299                    getPersistence().removeByC_C(classNameId, classPK);
300            }
301    
302            /**
303            * Removes all the ratings statses from the database.
304            *
305            * @throws SystemException if a system exception occurred
306            */
307            public static void removeAll()
308                    throws com.liferay.portal.kernel.exception.SystemException {
309                    getPersistence().removeAll();
310            }
311    
312            /**
313            * Counts all the ratings statses where classNameId = &#63; and classPK = &#63;.
314            *
315            * @param classNameId the class name id to search with
316            * @param classPK the class p k to search with
317            * @return the number of matching ratings statses
318            * @throws SystemException if a system exception occurred
319            */
320            public static int countByC_C(long classNameId, long classPK)
321                    throws com.liferay.portal.kernel.exception.SystemException {
322                    return getPersistence().countByC_C(classNameId, classPK);
323            }
324    
325            /**
326            * Counts all the ratings statses.
327            *
328            * @return the number of ratings statses
329            * @throws SystemException if a system exception occurred
330            */
331            public static int countAll()
332                    throws com.liferay.portal.kernel.exception.SystemException {
333                    return getPersistence().countAll();
334            }
335    
336            public static RatingsStatsPersistence getPersistence() {
337                    if (_persistence == null) {
338                            _persistence = (RatingsStatsPersistence)PortalBeanLocatorUtil.locate(RatingsStatsPersistence.class.getName());
339                    }
340    
341                    return _persistence;
342            }
343    
344            public void setPersistence(RatingsStatsPersistence persistence) {
345                    _persistence = persistence;
346            }
347    
348            private static RatingsStatsPersistence _persistence;
349    }