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