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