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