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