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.polls.service.persistence;
016    
017    import com.liferay.portal.service.persistence.BasePersistence;
018    
019    import com.liferay.portlet.polls.model.PollsVote;
020    
021    /**
022     * The persistence interface for the polls vote service.
023     *
024     * <p>
025     * Never modify or reference this interface directly. Always use {@link PollsVoteUtil} to access the polls vote 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 PollsVotePersistenceImpl
034     * @see PollsVoteUtil
035     * @generated
036     */
037    public interface PollsVotePersistence extends BasePersistence<PollsVote> {
038            /**
039            * Caches the polls vote in the entity cache if it is enabled.
040            *
041            * @param pollsVote the polls vote to cache
042            */
043            public void cacheResult(com.liferay.portlet.polls.model.PollsVote pollsVote);
044    
045            /**
046            * Caches the polls votes in the entity cache if it is enabled.
047            *
048            * @param pollsVotes the polls votes to cache
049            */
050            public void cacheResult(
051                    java.util.List<com.liferay.portlet.polls.model.PollsVote> pollsVotes);
052    
053            /**
054            * Creates a new polls vote with the primary key. Does not add the polls vote to the database.
055            *
056            * @param voteId the primary key for the new polls vote
057            * @return the new polls vote
058            */
059            public com.liferay.portlet.polls.model.PollsVote create(long voteId);
060    
061            /**
062            * Removes the polls vote with the primary key from the database. Also notifies the appropriate model listeners.
063            *
064            * @param voteId the primary key of the polls vote to remove
065            * @return the polls vote that was removed
066            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
067            * @throws SystemException if a system exception occurred
068            */
069            public com.liferay.portlet.polls.model.PollsVote remove(long voteId)
070                    throws com.liferay.portal.kernel.exception.SystemException,
071                            com.liferay.portlet.polls.NoSuchVoteException;
072    
073            public com.liferay.portlet.polls.model.PollsVote updateImpl(
074                    com.liferay.portlet.polls.model.PollsVote pollsVote, boolean merge)
075                    throws com.liferay.portal.kernel.exception.SystemException;
076    
077            /**
078            * Finds the polls vote with the primary key or throws a {@link com.liferay.portlet.polls.NoSuchVoteException} if it could not be found.
079            *
080            * @param voteId the primary key of the polls vote to find
081            * @return the polls vote
082            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
083            * @throws SystemException if a system exception occurred
084            */
085            public com.liferay.portlet.polls.model.PollsVote findByPrimaryKey(
086                    long voteId)
087                    throws com.liferay.portal.kernel.exception.SystemException,
088                            com.liferay.portlet.polls.NoSuchVoteException;
089    
090            /**
091            * Finds the polls vote with the primary key or returns <code>null</code> if it could not be found.
092            *
093            * @param voteId the primary key of the polls vote to find
094            * @return the polls vote, or <code>null</code> if a polls vote with the primary key could not be found
095            * @throws SystemException if a system exception occurred
096            */
097            public com.liferay.portlet.polls.model.PollsVote fetchByPrimaryKey(
098                    long voteId) throws com.liferay.portal.kernel.exception.SystemException;
099    
100            /**
101            * Finds all the polls votes where questionId = &#63;.
102            *
103            * @param questionId the question id to search with
104            * @return the matching polls votes
105            * @throws SystemException if a system exception occurred
106            */
107            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
108                    long questionId)
109                    throws com.liferay.portal.kernel.exception.SystemException;
110    
111            /**
112            * Finds a range of all the polls votes where questionId = &#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 questionId the question id to search with
119            * @param start the lower bound of the range of polls votes to return
120            * @param end the upper bound of the range of polls votes to return (not inclusive)
121            * @return the range of matching polls votes
122            * @throws SystemException if a system exception occurred
123            */
124            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
125                    long questionId, int start, int end)
126                    throws com.liferay.portal.kernel.exception.SystemException;
127    
128            /**
129            * Finds an ordered range of all the polls votes where questionId = &#63;.
130            *
131            * <p>
132            * 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.
133            * </p>
134            *
135            * @param questionId the question id to search with
136            * @param start the lower bound of the range of polls votes to return
137            * @param end the upper bound of the range of polls votes to return (not inclusive)
138            * @param orderByComparator the comparator to order the results by
139            * @return the ordered range of matching polls votes
140            * @throws SystemException if a system exception occurred
141            */
142            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
143                    long questionId, int start, int end,
144                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
145                    throws com.liferay.portal.kernel.exception.SystemException;
146    
147            /**
148            * Finds the first polls vote in the ordered set where questionId = &#63;.
149            *
150            * <p>
151            * 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.
152            * </p>
153            *
154            * @param questionId the question id to search with
155            * @param orderByComparator the comparator to order the set by
156            * @return the first matching polls vote
157            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
158            * @throws SystemException if a system exception occurred
159            */
160            public com.liferay.portlet.polls.model.PollsVote findByQuestionId_First(
161                    long questionId,
162                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
163                    throws com.liferay.portal.kernel.exception.SystemException,
164                            com.liferay.portlet.polls.NoSuchVoteException;
165    
166            /**
167            * Finds the last polls vote in the ordered set where questionId = &#63;.
168            *
169            * <p>
170            * 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.
171            * </p>
172            *
173            * @param questionId the question id to search with
174            * @param orderByComparator the comparator to order the set by
175            * @return the last matching polls vote
176            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
177            * @throws SystemException if a system exception occurred
178            */
179            public com.liferay.portlet.polls.model.PollsVote findByQuestionId_Last(
180                    long questionId,
181                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
182                    throws com.liferay.portal.kernel.exception.SystemException,
183                            com.liferay.portlet.polls.NoSuchVoteException;
184    
185            /**
186            * Finds the polls votes before and after the current polls vote in the ordered set where questionId = &#63;.
187            *
188            * <p>
189            * 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.
190            * </p>
191            *
192            * @param voteId the primary key of the current polls vote
193            * @param questionId the question id to search with
194            * @param orderByComparator the comparator to order the set by
195            * @return the previous, current, and next polls vote
196            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
197            * @throws SystemException if a system exception occurred
198            */
199            public com.liferay.portlet.polls.model.PollsVote[] findByQuestionId_PrevAndNext(
200                    long voteId, long questionId,
201                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
202                    throws com.liferay.portal.kernel.exception.SystemException,
203                            com.liferay.portlet.polls.NoSuchVoteException;
204    
205            /**
206            * Finds all the polls votes where choiceId = &#63;.
207            *
208            * @param choiceId the choice id to search with
209            * @return the matching polls votes
210            * @throws SystemException if a system exception occurred
211            */
212            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
213                    long choiceId)
214                    throws com.liferay.portal.kernel.exception.SystemException;
215    
216            /**
217            * Finds a range of all the polls votes where choiceId = &#63;.
218            *
219            * <p>
220            * 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.
221            * </p>
222            *
223            * @param choiceId the choice id to search with
224            * @param start the lower bound of the range of polls votes to return
225            * @param end the upper bound of the range of polls votes to return (not inclusive)
226            * @return the range of matching polls votes
227            * @throws SystemException if a system exception occurred
228            */
229            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
230                    long choiceId, int start, int end)
231                    throws com.liferay.portal.kernel.exception.SystemException;
232    
233            /**
234            * Finds an ordered range of all the polls votes where choiceId = &#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 choiceId the choice id to search with
241            * @param start the lower bound of the range of polls votes to return
242            * @param end the upper bound of the range of polls votes to return (not inclusive)
243            * @param orderByComparator the comparator to order the results by
244            * @return the ordered range of matching polls votes
245            * @throws SystemException if a system exception occurred
246            */
247            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
248                    long choiceId, int start, int end,
249                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
250                    throws com.liferay.portal.kernel.exception.SystemException;
251    
252            /**
253            * Finds the first polls vote in the ordered set where choiceId = &#63;.
254            *
255            * <p>
256            * 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.
257            * </p>
258            *
259            * @param choiceId the choice id to search with
260            * @param orderByComparator the comparator to order the set by
261            * @return the first matching polls vote
262            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
263            * @throws SystemException if a system exception occurred
264            */
265            public com.liferay.portlet.polls.model.PollsVote findByChoiceId_First(
266                    long choiceId,
267                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
268                    throws com.liferay.portal.kernel.exception.SystemException,
269                            com.liferay.portlet.polls.NoSuchVoteException;
270    
271            /**
272            * Finds the last polls vote in the ordered set where choiceId = &#63;.
273            *
274            * <p>
275            * 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.
276            * </p>
277            *
278            * @param choiceId the choice id to search with
279            * @param orderByComparator the comparator to order the set by
280            * @return the last matching polls vote
281            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
282            * @throws SystemException if a system exception occurred
283            */
284            public com.liferay.portlet.polls.model.PollsVote findByChoiceId_Last(
285                    long choiceId,
286                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
287                    throws com.liferay.portal.kernel.exception.SystemException,
288                            com.liferay.portlet.polls.NoSuchVoteException;
289    
290            /**
291            * Finds the polls votes before and after the current polls vote in the ordered set where choiceId = &#63;.
292            *
293            * <p>
294            * 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.
295            * </p>
296            *
297            * @param voteId the primary key of the current polls vote
298            * @param choiceId the choice id to search with
299            * @param orderByComparator the comparator to order the set by
300            * @return the previous, current, and next polls vote
301            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
302            * @throws SystemException if a system exception occurred
303            */
304            public com.liferay.portlet.polls.model.PollsVote[] findByChoiceId_PrevAndNext(
305                    long voteId, long choiceId,
306                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
307                    throws com.liferay.portal.kernel.exception.SystemException,
308                            com.liferay.portlet.polls.NoSuchVoteException;
309    
310            /**
311            * Finds the polls vote where questionId = &#63; and userId = &#63; or throws a {@link com.liferay.portlet.polls.NoSuchVoteException} if it could not be found.
312            *
313            * @param questionId the question id to search with
314            * @param userId the user id to search with
315            * @return the matching polls vote
316            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
317            * @throws SystemException if a system exception occurred
318            */
319            public com.liferay.portlet.polls.model.PollsVote findByQ_U(
320                    long questionId, long userId)
321                    throws com.liferay.portal.kernel.exception.SystemException,
322                            com.liferay.portlet.polls.NoSuchVoteException;
323    
324            /**
325            * Finds the polls vote where questionId = &#63; and userId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
326            *
327            * @param questionId the question id to search with
328            * @param userId the user id to search with
329            * @return the matching polls vote, or <code>null</code> if a matching polls vote could not be found
330            * @throws SystemException if a system exception occurred
331            */
332            public com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
333                    long questionId, long userId)
334                    throws com.liferay.portal.kernel.exception.SystemException;
335    
336            /**
337            * Finds the polls vote where questionId = &#63; and userId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
338            *
339            * @param questionId the question id to search with
340            * @param userId the user id to search with
341            * @return the matching polls vote, or <code>null</code> if a matching polls vote could not be found
342            * @throws SystemException if a system exception occurred
343            */
344            public com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
345                    long questionId, long userId, boolean retrieveFromCache)
346                    throws com.liferay.portal.kernel.exception.SystemException;
347    
348            /**
349            * Finds all the polls votes.
350            *
351            * @return the polls votes
352            * @throws SystemException if a system exception occurred
353            */
354            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll()
355                    throws com.liferay.portal.kernel.exception.SystemException;
356    
357            /**
358            * Finds a range of all the polls votes.
359            *
360            * <p>
361            * 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.
362            * </p>
363            *
364            * @param start the lower bound of the range of polls votes to return
365            * @param end the upper bound of the range of polls votes to return (not inclusive)
366            * @return the range of polls votes
367            * @throws SystemException if a system exception occurred
368            */
369            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll(
370                    int start, int end)
371                    throws com.liferay.portal.kernel.exception.SystemException;
372    
373            /**
374            * Finds an ordered range of all the polls votes.
375            *
376            * <p>
377            * 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.
378            * </p>
379            *
380            * @param start the lower bound of the range of polls votes to return
381            * @param end the upper bound of the range of polls votes to return (not inclusive)
382            * @param orderByComparator the comparator to order the results by
383            * @return the ordered range of polls votes
384            * @throws SystemException if a system exception occurred
385            */
386            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll(
387                    int start, int end,
388                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
389                    throws com.liferay.portal.kernel.exception.SystemException;
390    
391            /**
392            * Removes all the polls votes where questionId = &#63; from the database.
393            *
394            * @param questionId the question id to search with
395            * @throws SystemException if a system exception occurred
396            */
397            public void removeByQuestionId(long questionId)
398                    throws com.liferay.portal.kernel.exception.SystemException;
399    
400            /**
401            * Removes all the polls votes where choiceId = &#63; from the database.
402            *
403            * @param choiceId the choice id to search with
404            * @throws SystemException if a system exception occurred
405            */
406            public void removeByChoiceId(long choiceId)
407                    throws com.liferay.portal.kernel.exception.SystemException;
408    
409            /**
410            * Removes the polls vote where questionId = &#63; and userId = &#63; from the database.
411            *
412            * @param questionId the question id to search with
413            * @param userId the user id to search with
414            * @throws SystemException if a system exception occurred
415            */
416            public void removeByQ_U(long questionId, long userId)
417                    throws com.liferay.portal.kernel.exception.SystemException,
418                            com.liferay.portlet.polls.NoSuchVoteException;
419    
420            /**
421            * Removes all the polls votes from the database.
422            *
423            * @throws SystemException if a system exception occurred
424            */
425            public void removeAll()
426                    throws com.liferay.portal.kernel.exception.SystemException;
427    
428            /**
429            * Counts all the polls votes where questionId = &#63;.
430            *
431            * @param questionId the question id to search with
432            * @return the number of matching polls votes
433            * @throws SystemException if a system exception occurred
434            */
435            public int countByQuestionId(long questionId)
436                    throws com.liferay.portal.kernel.exception.SystemException;
437    
438            /**
439            * Counts all the polls votes where choiceId = &#63;.
440            *
441            * @param choiceId the choice id to search with
442            * @return the number of matching polls votes
443            * @throws SystemException if a system exception occurred
444            */
445            public int countByChoiceId(long choiceId)
446                    throws com.liferay.portal.kernel.exception.SystemException;
447    
448            /**
449            * Counts all the polls votes where questionId = &#63; and userId = &#63;.
450            *
451            * @param questionId the question id to search with
452            * @param userId the user id to search with
453            * @return the number of matching polls votes
454            * @throws SystemException if a system exception occurred
455            */
456            public int countByQ_U(long questionId, long userId)
457                    throws com.liferay.portal.kernel.exception.SystemException;
458    
459            /**
460            * Counts all the polls votes.
461            *
462            * @return the number of polls votes
463            * @throws SystemException if a system exception occurred
464            */
465            public int countAll()
466                    throws com.liferay.portal.kernel.exception.SystemException;
467    }