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.RatingsEntry;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the ratings entry 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 RatingsEntryPersistence
036     * @see RatingsEntryPersistenceImpl
037     * @generated
038     */
039    public class RatingsEntryUtil {
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(RatingsEntry ratingsEntry) {
051                    getPersistence().clearCache(ratingsEntry);
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<RatingsEntry> 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<RatingsEntry> 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<RatingsEntry> 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 RatingsEntry remove(RatingsEntry ratingsEntry)
094                    throws SystemException {
095                    return getPersistence().remove(ratingsEntry);
096            }
097    
098            /**
099             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
100             */
101            public static RatingsEntry update(RatingsEntry ratingsEntry, boolean merge)
102                    throws SystemException {
103                    return getPersistence().update(ratingsEntry, merge);
104            }
105    
106            /**
107             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
108             */
109            public static RatingsEntry update(RatingsEntry ratingsEntry, boolean merge,
110                    ServiceContext serviceContext) throws SystemException {
111                    return getPersistence().update(ratingsEntry, merge, serviceContext);
112            }
113    
114            /**
115            * Caches the ratings entry in the entity cache if it is enabled.
116            *
117            * @param ratingsEntry the ratings entry to cache
118            */
119            public static void cacheResult(
120                    com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry) {
121                    getPersistence().cacheResult(ratingsEntry);
122            }
123    
124            /**
125            * Caches the ratings entries in the entity cache if it is enabled.
126            *
127            * @param ratingsEntries the ratings entries to cache
128            */
129            public static void cacheResult(
130                    java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> ratingsEntries) {
131                    getPersistence().cacheResult(ratingsEntries);
132            }
133    
134            /**
135            * Creates a new ratings entry with the primary key.
136            *
137            * @param entryId the primary key for the new ratings entry
138            * @return the new ratings entry
139            */
140            public static com.liferay.portlet.ratings.model.RatingsEntry create(
141                    long entryId) {
142                    return getPersistence().create(entryId);
143            }
144    
145            /**
146            * Removes the ratings entry with the primary key from the database. Also notifies the appropriate model listeners.
147            *
148            * @param entryId the primary key of the ratings entry to remove
149            * @return the ratings entry that was removed
150            * @throws com.liferay.portlet.ratings.NoSuchEntryException if a ratings entry 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.RatingsEntry remove(
154                    long entryId)
155                    throws com.liferay.portal.kernel.exception.SystemException,
156                            com.liferay.portlet.ratings.NoSuchEntryException {
157                    return getPersistence().remove(entryId);
158            }
159    
160            public static com.liferay.portlet.ratings.model.RatingsEntry updateImpl(
161                    com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry,
162                    boolean merge)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getPersistence().updateImpl(ratingsEntry, merge);
165            }
166    
167            /**
168            * Finds the ratings entry with the primary key or throws a {@link com.liferay.portlet.ratings.NoSuchEntryException} if it could not be found.
169            *
170            * @param entryId the primary key of the ratings entry to find
171            * @return the ratings entry
172            * @throws com.liferay.portlet.ratings.NoSuchEntryException if a ratings entry 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.RatingsEntry findByPrimaryKey(
176                    long entryId)
177                    throws com.liferay.portal.kernel.exception.SystemException,
178                            com.liferay.portlet.ratings.NoSuchEntryException {
179                    return getPersistence().findByPrimaryKey(entryId);
180            }
181    
182            /**
183            * Finds the ratings entry with the primary key or returns <code>null</code> if it could not be found.
184            *
185            * @param entryId the primary key of the ratings entry to find
186            * @return the ratings entry, or <code>null</code> if a ratings entry 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.RatingsEntry fetchByPrimaryKey(
190                    long entryId)
191                    throws com.liferay.portal.kernel.exception.SystemException {
192                    return getPersistence().fetchByPrimaryKey(entryId);
193            }
194    
195            /**
196            * Finds all the ratings entries where classNameId = &#63; and classPK = &#63;.
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 entries
201            * @throws SystemException if a system exception occurred
202            */
203            public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findByC_C(
204                    long classNameId, long classPK)
205                    throws com.liferay.portal.kernel.exception.SystemException {
206                    return getPersistence().findByC_C(classNameId, classPK);
207            }
208    
209            /**
210            * Finds a range of all the ratings entries where classNameId = &#63; and classPK = &#63;.
211            *
212            * <p>
213            * 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.
214            * </p>
215            *
216            * @param classNameId the class name id to search with
217            * @param classPK the class p k to search with
218            * @param start the lower bound of the range of ratings entries to return
219            * @param end the upper bound of the range of ratings entries to return (not inclusive)
220            * @return the range of matching ratings entries
221            * @throws SystemException if a system exception occurred
222            */
223            public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findByC_C(
224                    long classNameId, long classPK, int start, int end)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getPersistence().findByC_C(classNameId, classPK, start, end);
227            }
228    
229            /**
230            * Finds an ordered range of all the ratings entries where classNameId = &#63; and classPK = &#63;.
231            *
232            * <p>
233            * 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.
234            * </p>
235            *
236            * @param classNameId the class name id to search with
237            * @param classPK the class p k to search with
238            * @param start the lower bound of the range of ratings entries to return
239            * @param end the upper bound of the range of ratings entries to return (not inclusive)
240            * @param orderByComparator the comparator to order the results by
241            * @return the ordered range of matching ratings entries
242            * @throws SystemException if a system exception occurred
243            */
244            public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findByC_C(
245                    long classNameId, long classPK, int start, int end,
246                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
247                    throws com.liferay.portal.kernel.exception.SystemException {
248                    return getPersistence()
249                                       .findByC_C(classNameId, classPK, start, end,
250                            orderByComparator);
251            }
252    
253            /**
254            * Finds the first ratings entry in the ordered set where classNameId = &#63; and classPK = &#63;.
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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
258            * </p>
259            *
260            * @param classNameId the class name id to search with
261            * @param classPK the class p k to search with
262            * @param orderByComparator the comparator to order the set by
263            * @return the first matching ratings entry
264            * @throws com.liferay.portlet.ratings.NoSuchEntryException if a matching ratings entry could not be found
265            * @throws SystemException if a system exception occurred
266            */
267            public static com.liferay.portlet.ratings.model.RatingsEntry findByC_C_First(
268                    long classNameId, long classPK,
269                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
270                    throws com.liferay.portal.kernel.exception.SystemException,
271                            com.liferay.portlet.ratings.NoSuchEntryException {
272                    return getPersistence()
273                                       .findByC_C_First(classNameId, classPK, orderByComparator);
274            }
275    
276            /**
277            * Finds the last ratings entry in the ordered set where classNameId = &#63; and classPK = &#63;.
278            *
279            * <p>
280            * 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.
281            * </p>
282            *
283            * @param classNameId the class name id to search with
284            * @param classPK the class p k to search with
285            * @param orderByComparator the comparator to order the set by
286            * @return the last matching ratings entry
287            * @throws com.liferay.portlet.ratings.NoSuchEntryException if a matching ratings entry could not be found
288            * @throws SystemException if a system exception occurred
289            */
290            public static com.liferay.portlet.ratings.model.RatingsEntry findByC_C_Last(
291                    long classNameId, long classPK,
292                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
293                    throws com.liferay.portal.kernel.exception.SystemException,
294                            com.liferay.portlet.ratings.NoSuchEntryException {
295                    return getPersistence()
296                                       .findByC_C_Last(classNameId, classPK, orderByComparator);
297            }
298    
299            /**
300            * Finds the ratings entries before and after the current ratings entry in the ordered set where classNameId = &#63; and classPK = &#63;.
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.
304            * </p>
305            *
306            * @param entryId the primary key of the current ratings entry
307            * @param classNameId the class name id to search with
308            * @param classPK the class p k to search with
309            * @param orderByComparator the comparator to order the set by
310            * @return the previous, current, and next ratings entry
311            * @throws com.liferay.portlet.ratings.NoSuchEntryException if a ratings entry with the primary key could not be found
312            * @throws SystemException if a system exception occurred
313            */
314            public static com.liferay.portlet.ratings.model.RatingsEntry[] findByC_C_PrevAndNext(
315                    long entryId, long classNameId, long classPK,
316                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
317                    throws com.liferay.portal.kernel.exception.SystemException,
318                            com.liferay.portlet.ratings.NoSuchEntryException {
319                    return getPersistence()
320                                       .findByC_C_PrevAndNext(entryId, classNameId, classPK,
321                            orderByComparator);
322            }
323    
324            /**
325            * Finds the ratings entry where userId = &#63; and classNameId = &#63; and classPK = &#63; or throws a {@link com.liferay.portlet.ratings.NoSuchEntryException} if it could not be found.
326            *
327            * @param userId the user id to search with
328            * @param classNameId the class name id to search with
329            * @param classPK the class p k to search with
330            * @return the matching ratings entry
331            * @throws com.liferay.portlet.ratings.NoSuchEntryException if a matching ratings entry could not be found
332            * @throws SystemException if a system exception occurred
333            */
334            public static com.liferay.portlet.ratings.model.RatingsEntry findByU_C_C(
335                    long userId, long classNameId, long classPK)
336                    throws com.liferay.portal.kernel.exception.SystemException,
337                            com.liferay.portlet.ratings.NoSuchEntryException {
338                    return getPersistence().findByU_C_C(userId, classNameId, classPK);
339            }
340    
341            /**
342            * Finds the ratings entry where userId = &#63; and classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
343            *
344            * @param userId the user id to search with
345            * @param classNameId the class name id to search with
346            * @param classPK the class p k to search with
347            * @return the matching ratings entry, or <code>null</code> if a matching ratings entry could not be found
348            * @throws SystemException if a system exception occurred
349            */
350            public static com.liferay.portlet.ratings.model.RatingsEntry fetchByU_C_C(
351                    long userId, long classNameId, long classPK)
352                    throws com.liferay.portal.kernel.exception.SystemException {
353                    return getPersistence().fetchByU_C_C(userId, classNameId, classPK);
354            }
355    
356            /**
357            * Finds the ratings entry where userId = &#63; and classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
358            *
359            * @param userId the user id to search with
360            * @param classNameId the class name id to search with
361            * @param classPK the class p k to search with
362            * @return the matching ratings entry, or <code>null</code> if a matching ratings entry could not be found
363            * @throws SystemException if a system exception occurred
364            */
365            public static com.liferay.portlet.ratings.model.RatingsEntry fetchByU_C_C(
366                    long userId, long classNameId, long classPK, boolean retrieveFromCache)
367                    throws com.liferay.portal.kernel.exception.SystemException {
368                    return getPersistence()
369                                       .fetchByU_C_C(userId, classNameId, classPK, retrieveFromCache);
370            }
371    
372            /**
373            * Finds all the ratings entries.
374            *
375            * @return the ratings entries
376            * @throws SystemException if a system exception occurred
377            */
378            public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findAll()
379                    throws com.liferay.portal.kernel.exception.SystemException {
380                    return getPersistence().findAll();
381            }
382    
383            /**
384            * Finds a range of all the ratings entries.
385            *
386            * <p>
387            * 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.
388            * </p>
389            *
390            * @param start the lower bound of the range of ratings entries to return
391            * @param end the upper bound of the range of ratings entries to return (not inclusive)
392            * @return the range of ratings entries
393            * @throws SystemException if a system exception occurred
394            */
395            public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findAll(
396                    int start, int end)
397                    throws com.liferay.portal.kernel.exception.SystemException {
398                    return getPersistence().findAll(start, end);
399            }
400    
401            /**
402            * Finds an ordered range of all the ratings entries.
403            *
404            * <p>
405            * 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.
406            * </p>
407            *
408            * @param start the lower bound of the range of ratings entries to return
409            * @param end the upper bound of the range of ratings entries to return (not inclusive)
410            * @param orderByComparator the comparator to order the results by
411            * @return the ordered range of ratings entries
412            * @throws SystemException if a system exception occurred
413            */
414            public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findAll(
415                    int start, int end,
416                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
417                    throws com.liferay.portal.kernel.exception.SystemException {
418                    return getPersistence().findAll(start, end, orderByComparator);
419            }
420    
421            /**
422            * Removes all the ratings entries where classNameId = &#63; and classPK = &#63; from the database.
423            *
424            * @param classNameId the class name id to search with
425            * @param classPK the class p k to search with
426            * @throws SystemException if a system exception occurred
427            */
428            public static void removeByC_C(long classNameId, long classPK)
429                    throws com.liferay.portal.kernel.exception.SystemException {
430                    getPersistence().removeByC_C(classNameId, classPK);
431            }
432    
433            /**
434            * Removes the ratings entry where userId = &#63; and classNameId = &#63; and classPK = &#63; from the database.
435            *
436            * @param userId the user id to search with
437            * @param classNameId the class name id to search with
438            * @param classPK the class p k to search with
439            * @throws SystemException if a system exception occurred
440            */
441            public static void removeByU_C_C(long userId, long classNameId, long classPK)
442                    throws com.liferay.portal.kernel.exception.SystemException,
443                            com.liferay.portlet.ratings.NoSuchEntryException {
444                    getPersistence().removeByU_C_C(userId, classNameId, classPK);
445            }
446    
447            /**
448            * Removes all the ratings entries from the database.
449            *
450            * @throws SystemException if a system exception occurred
451            */
452            public static void removeAll()
453                    throws com.liferay.portal.kernel.exception.SystemException {
454                    getPersistence().removeAll();
455            }
456    
457            /**
458            * Counts all the ratings entries where classNameId = &#63; and classPK = &#63;.
459            *
460            * @param classNameId the class name id to search with
461            * @param classPK the class p k to search with
462            * @return the number of matching ratings entries
463            * @throws SystemException if a system exception occurred
464            */
465            public static int countByC_C(long classNameId, long classPK)
466                    throws com.liferay.portal.kernel.exception.SystemException {
467                    return getPersistence().countByC_C(classNameId, classPK);
468            }
469    
470            /**
471            * Counts all the ratings entries where userId = &#63; and classNameId = &#63; and classPK = &#63;.
472            *
473            * @param userId the user id to search with
474            * @param classNameId the class name id to search with
475            * @param classPK the class p k to search with
476            * @return the number of matching ratings entries
477            * @throws SystemException if a system exception occurred
478            */
479            public static int countByU_C_C(long userId, long classNameId, long classPK)
480                    throws com.liferay.portal.kernel.exception.SystemException {
481                    return getPersistence().countByU_C_C(userId, classNameId, classPK);
482            }
483    
484            /**
485            * Counts all the ratings entries.
486            *
487            * @return the number of ratings entries
488            * @throws SystemException if a system exception occurred
489            */
490            public static int countAll()
491                    throws com.liferay.portal.kernel.exception.SystemException {
492                    return getPersistence().countAll();
493            }
494    
495            public static RatingsEntryPersistence getPersistence() {
496                    if (_persistence == null) {
497                            _persistence = (RatingsEntryPersistence)PortalBeanLocatorUtil.locate(RatingsEntryPersistence.class.getName());
498                    }
499    
500                    return _persistence;
501            }
502    
503            public void setPersistence(RatingsEntryPersistence persistence) {
504                    _persistence = persistence;
505            }
506    
507            private static RatingsEntryPersistence _persistence;
508    }