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