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