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