001    /**
002     * Copyright (c) 2000-2012 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     * Caching information and settings can be found in <code>portal.properties</code>
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             * NOTE FOR DEVELOPERS:
036             *
037             * 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.
038             */
039    
040            /**
041            * Caches the polls vote in the entity cache if it is enabled.
042            *
043            * @param pollsVote the polls vote
044            */
045            public void cacheResult(com.liferay.portlet.polls.model.PollsVote pollsVote);
046    
047            /**
048            * Caches the polls votes in the entity cache if it is enabled.
049            *
050            * @param pollsVotes the polls votes
051            */
052            public void cacheResult(
053                    java.util.List<com.liferay.portlet.polls.model.PollsVote> pollsVotes);
054    
055            /**
056            * Creates a new polls vote with the primary key. Does not add the polls vote to the database.
057            *
058            * @param voteId the primary key for the new polls vote
059            * @return the new polls vote
060            */
061            public com.liferay.portlet.polls.model.PollsVote create(long voteId);
062    
063            /**
064            * Removes the polls vote with the primary key from the database. Also notifies the appropriate model listeners.
065            *
066            * @param voteId the primary key of the polls vote
067            * @return the polls vote that was removed
068            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
069            * @throws SystemException if a system exception occurred
070            */
071            public com.liferay.portlet.polls.model.PollsVote remove(long voteId)
072                    throws com.liferay.portal.kernel.exception.SystemException,
073                            com.liferay.portlet.polls.NoSuchVoteException;
074    
075            public com.liferay.portlet.polls.model.PollsVote updateImpl(
076                    com.liferay.portlet.polls.model.PollsVote pollsVote, boolean merge)
077                    throws com.liferay.portal.kernel.exception.SystemException;
078    
079            /**
080            * Returns the polls vote with the primary key or throws a {@link com.liferay.portlet.polls.NoSuchVoteException} if it could not be found.
081            *
082            * @param voteId the primary key of the polls vote
083            * @return the polls vote
084            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
085            * @throws SystemException if a system exception occurred
086            */
087            public com.liferay.portlet.polls.model.PollsVote findByPrimaryKey(
088                    long voteId)
089                    throws com.liferay.portal.kernel.exception.SystemException,
090                            com.liferay.portlet.polls.NoSuchVoteException;
091    
092            /**
093            * Returns the polls vote with the primary key or returns <code>null</code> if it could not be found.
094            *
095            * @param voteId the primary key of the polls vote
096            * @return the polls vote, or <code>null</code> if a polls vote with the primary key could not be found
097            * @throws SystemException if a system exception occurred
098            */
099            public com.liferay.portlet.polls.model.PollsVote fetchByPrimaryKey(
100                    long voteId) throws com.liferay.portal.kernel.exception.SystemException;
101    
102            /**
103            * Returns all the polls votes where questionId = &#63;.
104            *
105            * @param questionId the question ID
106            * @return the matching polls votes
107            * @throws SystemException if a system exception occurred
108            */
109            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
110                    long questionId)
111                    throws com.liferay.portal.kernel.exception.SystemException;
112    
113            /**
114            * Returns a range of all the polls votes where questionId = &#63;.
115            *
116            * <p>
117            * 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.
118            * </p>
119            *
120            * @param questionId the question ID
121            * @param start the lower bound of the range of polls votes
122            * @param end the upper bound of the range of polls votes (not inclusive)
123            * @return the range of matching polls votes
124            * @throws SystemException if a system exception occurred
125            */
126            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
127                    long questionId, int start, int end)
128                    throws com.liferay.portal.kernel.exception.SystemException;
129    
130            /**
131            * Returns an ordered range of all the polls votes where questionId = &#63;.
132            *
133            * <p>
134            * 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.
135            * </p>
136            *
137            * @param questionId the question ID
138            * @param start the lower bound of the range of polls votes
139            * @param end the upper bound of the range of polls votes (not inclusive)
140            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
141            * @return the ordered range of matching polls votes
142            * @throws SystemException if a system exception occurred
143            */
144            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
145                    long questionId, int start, int end,
146                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
147                    throws com.liferay.portal.kernel.exception.SystemException;
148    
149            /**
150            * Returns the first polls vote in the ordered set where questionId = &#63;.
151            *
152            * <p>
153            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
154            * </p>
155            *
156            * @param questionId the question ID
157            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
158            * @return the first matching polls vote
159            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
160            * @throws SystemException if a system exception occurred
161            */
162            public com.liferay.portlet.polls.model.PollsVote findByQuestionId_First(
163                    long questionId,
164                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
165                    throws com.liferay.portal.kernel.exception.SystemException,
166                            com.liferay.portlet.polls.NoSuchVoteException;
167    
168            /**
169            * Returns the last polls vote in the ordered set where questionId = &#63;.
170            *
171            * <p>
172            * 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.
173            * </p>
174            *
175            * @param questionId the question ID
176            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
177            * @return the last matching polls vote
178            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public com.liferay.portlet.polls.model.PollsVote findByQuestionId_Last(
182                    long questionId,
183                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
184                    throws com.liferay.portal.kernel.exception.SystemException,
185                            com.liferay.portlet.polls.NoSuchVoteException;
186    
187            /**
188            * Returns the polls votes before and after the current polls vote in the ordered set where questionId = &#63;.
189            *
190            * <p>
191            * 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.
192            * </p>
193            *
194            * @param voteId the primary key of the current polls vote
195            * @param questionId the question ID
196            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
197            * @return the previous, current, and next polls vote
198            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
199            * @throws SystemException if a system exception occurred
200            */
201            public com.liferay.portlet.polls.model.PollsVote[] findByQuestionId_PrevAndNext(
202                    long voteId, long questionId,
203                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
204                    throws com.liferay.portal.kernel.exception.SystemException,
205                            com.liferay.portlet.polls.NoSuchVoteException;
206    
207            /**
208            * Returns all the polls votes where choiceId = &#63;.
209            *
210            * @param choiceId the choice ID
211            * @return the matching polls votes
212            * @throws SystemException if a system exception occurred
213            */
214            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
215                    long choiceId)
216                    throws com.liferay.portal.kernel.exception.SystemException;
217    
218            /**
219            * Returns a range of all the polls votes where choiceId = &#63;.
220            *
221            * <p>
222            * 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.
223            * </p>
224            *
225            * @param choiceId the choice ID
226            * @param start the lower bound of the range of polls votes
227            * @param end the upper bound of the range of polls votes (not inclusive)
228            * @return the range of matching polls votes
229            * @throws SystemException if a system exception occurred
230            */
231            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
232                    long choiceId, int start, int end)
233                    throws com.liferay.portal.kernel.exception.SystemException;
234    
235            /**
236            * Returns an ordered range of all the polls votes where choiceId = &#63;.
237            *
238            * <p>
239            * 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.
240            * </p>
241            *
242            * @param choiceId the choice ID
243            * @param start the lower bound of the range of polls votes
244            * @param end the upper bound of the range of polls votes (not inclusive)
245            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
246            * @return the ordered range of matching polls votes
247            * @throws SystemException if a system exception occurred
248            */
249            public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
250                    long choiceId, int start, int end,
251                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
252                    throws com.liferay.portal.kernel.exception.SystemException;
253    
254            /**
255            * Returns the first polls vote in the ordered set where choiceId = &#63;.
256            *
257            * <p>
258            * 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.
259            * </p>
260            *
261            * @param choiceId the choice ID
262            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
263            * @return the first matching polls vote
264            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
265            * @throws SystemException if a system exception occurred
266            */
267            public com.liferay.portlet.polls.model.PollsVote findByChoiceId_First(
268                    long choiceId,
269                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
270                    throws com.liferay.portal.kernel.exception.SystemException,
271                            com.liferay.portlet.polls.NoSuchVoteException;
272    
273            /**
274            * Returns the last polls vote in the ordered set where choiceId = &#63;.
275            *
276            * <p>
277            * 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.
278            * </p>
279            *
280            * @param choiceId the choice ID
281            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
282            * @return the last matching polls vote
283            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
284            * @throws SystemException if a system exception occurred
285            */
286            public com.liferay.portlet.polls.model.PollsVote findByChoiceId_Last(
287                    long choiceId,
288                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
289                    throws com.liferay.portal.kernel.exception.SystemException,
290                            com.liferay.portlet.polls.NoSuchVoteException;
291    
292            /**
293            * Returns the polls votes before and after the current polls vote in the ordered set where choiceId = &#63;.
294            *
295            * <p>
296            * 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.
297            * </p>
298            *
299            * @param voteId the primary key of the current polls vote
300            * @param choiceId the choice ID
301            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
302            * @return the previous, current, and next polls vote
303            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
304            * @throws SystemException if a system exception occurred
305            */
306            public com.liferay.portlet.polls.model.PollsVote[] findByChoiceId_PrevAndNext(
307                    long voteId, long choiceId,
308                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
309                    throws com.liferay.portal.kernel.exception.SystemException,
310                            com.liferay.portlet.polls.NoSuchVoteException;
311    
312            /**
313            * Returns the polls vote where questionId = &#63; and userId = &#63; or throws a {@link com.liferay.portlet.polls.NoSuchVoteException} if it could not be found.
314            *
315            * @param questionId the question ID
316            * @param userId the user ID
317            * @return the matching polls vote
318            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
319            * @throws SystemException if a system exception occurred
320            */
321            public com.liferay.portlet.polls.model.PollsVote findByQ_U(
322                    long questionId, long userId)
323                    throws com.liferay.portal.kernel.exception.SystemException,
324                            com.liferay.portlet.polls.NoSuchVoteException;
325    
326            /**
327            * Returns the polls vote where questionId = &#63; and userId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
328            *
329            * @param questionId the question ID
330            * @param userId the user ID
331            * @return the matching polls vote, or <code>null</code> if a matching polls vote could not be found
332            * @throws SystemException if a system exception occurred
333            */
334            public com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
335                    long questionId, long userId)
336                    throws com.liferay.portal.kernel.exception.SystemException;
337    
338            /**
339            * Returns 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.
340            *
341            * @param questionId the question ID
342            * @param userId the user ID
343            * @param retrieveFromCache whether to use the finder cache
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            * Returns 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            * Returns 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
368            * @param end the upper bound of the range of polls votes (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            * Returns 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
384            * @param end the upper bound of the range of polls votes (not inclusive)
385            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
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
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
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
416            * @param userId the user ID
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            * Returns the number of polls votes where questionId = &#63;.
433            *
434            * @param questionId the question ID
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            * Returns the number of polls votes where choiceId = &#63;.
443            *
444            * @param choiceId the choice ID
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            * Returns the number of polls votes where questionId = &#63; and userId = &#63;.
453            *
454            * @param questionId the question ID
455            * @param userId the user ID
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            * Returns the number of 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    }