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