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