001    /**
002     * Copyright (c) 2000-2013 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.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import com.liferay.portlet.polls.model.PollsVote;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the polls vote service. This utility wraps {@link PollsVotePersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
030     *
031     * <p>
032     * Caching information and settings can be found in <code>portal.properties</code>
033     * </p>
034     *
035     * @author Brian Wing Shun Chan
036     * @see PollsVotePersistence
037     * @see PollsVotePersistenceImpl
038     * @generated
039     */
040    public class PollsVoteUtil {
041            /*
042             * NOTE FOR DEVELOPERS:
043             *
044             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
045             */
046    
047            /**
048             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
049             */
050            public static void clearCache() {
051                    getPersistence().clearCache();
052            }
053    
054            /**
055             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
056             */
057            public static void clearCache(PollsVote pollsVote) {
058                    getPersistence().clearCache(pollsVote);
059            }
060    
061            /**
062             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
063             */
064            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
065                    throws SystemException {
066                    return getPersistence().countWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
071             */
072            public static List<PollsVote> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery) throws SystemException {
074                    return getPersistence().findWithDynamicQuery(dynamicQuery);
075            }
076    
077            /**
078             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
079             */
080            public static List<PollsVote> findWithDynamicQuery(
081                    DynamicQuery dynamicQuery, int start, int end)
082                    throws SystemException {
083                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
084            }
085    
086            /**
087             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
088             */
089            public static List<PollsVote> findWithDynamicQuery(
090                    DynamicQuery dynamicQuery, int start, int end,
091                    OrderByComparator orderByComparator) throws SystemException {
092                    return getPersistence()
093                                       .findWithDynamicQuery(dynamicQuery, start, end,
094                            orderByComparator);
095            }
096    
097            /**
098             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
099             */
100            public static PollsVote update(PollsVote pollsVote, boolean merge)
101                    throws SystemException {
102                    return getPersistence().update(pollsVote, merge);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
107             */
108            public static PollsVote update(PollsVote pollsVote, boolean merge,
109                    ServiceContext serviceContext) throws SystemException {
110                    return getPersistence().update(pollsVote, merge, serviceContext);
111            }
112    
113            /**
114            * Caches the polls vote in the entity cache if it is enabled.
115            *
116            * @param pollsVote the polls vote
117            */
118            public static void cacheResult(
119                    com.liferay.portlet.polls.model.PollsVote pollsVote) {
120                    getPersistence().cacheResult(pollsVote);
121            }
122    
123            /**
124            * Caches the polls votes in the entity cache if it is enabled.
125            *
126            * @param pollsVotes the polls votes
127            */
128            public static void cacheResult(
129                    java.util.List<com.liferay.portlet.polls.model.PollsVote> pollsVotes) {
130                    getPersistence().cacheResult(pollsVotes);
131            }
132    
133            /**
134            * Creates a new polls vote with the primary key. Does not add the polls vote to the database.
135            *
136            * @param voteId the primary key for the new polls vote
137            * @return the new polls vote
138            */
139            public static com.liferay.portlet.polls.model.PollsVote create(long voteId) {
140                    return getPersistence().create(voteId);
141            }
142    
143            /**
144            * Removes the polls vote with the primary key from the database. Also notifies the appropriate model listeners.
145            *
146            * @param voteId the primary key of the polls vote
147            * @return the polls vote that was removed
148            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
149            * @throws SystemException if a system exception occurred
150            */
151            public static com.liferay.portlet.polls.model.PollsVote remove(long voteId)
152                    throws com.liferay.portal.kernel.exception.SystemException,
153                            com.liferay.portlet.polls.NoSuchVoteException {
154                    return getPersistence().remove(voteId);
155            }
156    
157            public static com.liferay.portlet.polls.model.PollsVote updateImpl(
158                    com.liferay.portlet.polls.model.PollsVote pollsVote, boolean merge)
159                    throws com.liferay.portal.kernel.exception.SystemException {
160                    return getPersistence().updateImpl(pollsVote, merge);
161            }
162    
163            /**
164            * Returns the polls vote with the primary key or throws a {@link com.liferay.portlet.polls.NoSuchVoteException} if it could not be found.
165            *
166            * @param voteId the primary key of the polls vote
167            * @return the polls vote
168            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
169            * @throws SystemException if a system exception occurred
170            */
171            public static com.liferay.portlet.polls.model.PollsVote findByPrimaryKey(
172                    long voteId)
173                    throws com.liferay.portal.kernel.exception.SystemException,
174                            com.liferay.portlet.polls.NoSuchVoteException {
175                    return getPersistence().findByPrimaryKey(voteId);
176            }
177    
178            /**
179            * Returns the polls vote with the primary key or returns <code>null</code> if it could not be found.
180            *
181            * @param voteId the primary key of the polls vote
182            * @return the polls vote, or <code>null</code> if a polls vote with the primary key could not be found
183            * @throws SystemException if a system exception occurred
184            */
185            public static com.liferay.portlet.polls.model.PollsVote fetchByPrimaryKey(
186                    long voteId) throws com.liferay.portal.kernel.exception.SystemException {
187                    return getPersistence().fetchByPrimaryKey(voteId);
188            }
189    
190            /**
191            * Returns all the polls votes where questionId = &#63;.
192            *
193            * @param questionId the question ID
194            * @return the matching polls votes
195            * @throws SystemException if a system exception occurred
196            */
197            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
198                    long questionId)
199                    throws com.liferay.portal.kernel.exception.SystemException {
200                    return getPersistence().findByQuestionId(questionId);
201            }
202    
203            /**
204            * Returns a range of all the polls votes where questionId = &#63;.
205            *
206            * <p>
207            * 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.
208            * </p>
209            *
210            * @param questionId the question ID
211            * @param start the lower bound of the range of polls votes
212            * @param end the upper bound of the range of polls votes (not inclusive)
213            * @return the range of matching polls votes
214            * @throws SystemException if a system exception occurred
215            */
216            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
217                    long questionId, int start, int end)
218                    throws com.liferay.portal.kernel.exception.SystemException {
219                    return getPersistence().findByQuestionId(questionId, start, end);
220            }
221    
222            /**
223            * Returns an ordered range of all the polls votes where questionId = &#63;.
224            *
225            * <p>
226            * 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.
227            * </p>
228            *
229            * @param questionId the question ID
230            * @param start the lower bound of the range of polls votes
231            * @param end the upper bound of the range of polls votes (not inclusive)
232            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
233            * @return the ordered range of matching polls votes
234            * @throws SystemException if a system exception occurred
235            */
236            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
237                    long questionId, int start, int end,
238                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
239                    throws com.liferay.portal.kernel.exception.SystemException {
240                    return getPersistence()
241                                       .findByQuestionId(questionId, start, end, orderByComparator);
242            }
243    
244            /**
245            * Returns the first polls vote in the ordered set where questionId = &#63;.
246            *
247            * @param questionId the question ID
248            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
249            * @return the first matching polls vote
250            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
251            * @throws SystemException if a system exception occurred
252            */
253            public static com.liferay.portlet.polls.model.PollsVote findByQuestionId_First(
254                    long questionId,
255                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
256                    throws com.liferay.portal.kernel.exception.SystemException,
257                            com.liferay.portlet.polls.NoSuchVoteException {
258                    return getPersistence()
259                                       .findByQuestionId_First(questionId, orderByComparator);
260            }
261    
262            /**
263            * Returns the first polls vote in the ordered set where questionId = &#63;.
264            *
265            * @param questionId the question ID
266            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
267            * @return the first matching polls vote, or <code>null</code> if a matching polls vote could not be found
268            * @throws SystemException if a system exception occurred
269            */
270            public static com.liferay.portlet.polls.model.PollsVote fetchByQuestionId_First(
271                    long questionId,
272                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
273                    throws com.liferay.portal.kernel.exception.SystemException {
274                    return getPersistence()
275                                       .fetchByQuestionId_First(questionId, orderByComparator);
276            }
277    
278            /**
279            * Returns the last polls vote in the ordered set where questionId = &#63;.
280            *
281            * @param questionId the question ID
282            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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 static com.liferay.portlet.polls.model.PollsVote findByQuestionId_Last(
288                    long questionId,
289                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
290                    throws com.liferay.portal.kernel.exception.SystemException,
291                            com.liferay.portlet.polls.NoSuchVoteException {
292                    return getPersistence()
293                                       .findByQuestionId_Last(questionId, orderByComparator);
294            }
295    
296            /**
297            * Returns the last polls vote in the ordered set where questionId = &#63;.
298            *
299            * @param questionId the question ID
300            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
301            * @return the last matching polls vote, or <code>null</code> if a matching polls vote could not be found
302            * @throws SystemException if a system exception occurred
303            */
304            public static com.liferay.portlet.polls.model.PollsVote fetchByQuestionId_Last(
305                    long questionId,
306                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
307                    throws com.liferay.portal.kernel.exception.SystemException {
308                    return getPersistence()
309                                       .fetchByQuestionId_Last(questionId, orderByComparator);
310            }
311    
312            /**
313            * Returns the polls votes before and after the current polls vote in the ordered set where questionId = &#63;.
314            *
315            * @param voteId the primary key of the current polls vote
316            * @param questionId the question ID
317            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
318            * @return the previous, current, and next polls vote
319            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
320            * @throws SystemException if a system exception occurred
321            */
322            public static com.liferay.portlet.polls.model.PollsVote[] findByQuestionId_PrevAndNext(
323                    long voteId, long questionId,
324                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
325                    throws com.liferay.portal.kernel.exception.SystemException,
326                            com.liferay.portlet.polls.NoSuchVoteException {
327                    return getPersistence()
328                                       .findByQuestionId_PrevAndNext(voteId, questionId,
329                            orderByComparator);
330            }
331    
332            /**
333            * Returns all the polls votes where choiceId = &#63;.
334            *
335            * @param choiceId the choice ID
336            * @return the matching polls votes
337            * @throws SystemException if a system exception occurred
338            */
339            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
340                    long choiceId)
341                    throws com.liferay.portal.kernel.exception.SystemException {
342                    return getPersistence().findByChoiceId(choiceId);
343            }
344    
345            /**
346            * Returns a range of all the polls votes where choiceId = &#63;.
347            *
348            * <p>
349            * 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.
350            * </p>
351            *
352            * @param choiceId the choice ID
353            * @param start the lower bound of the range of polls votes
354            * @param end the upper bound of the range of polls votes (not inclusive)
355            * @return the range of matching polls votes
356            * @throws SystemException if a system exception occurred
357            */
358            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
359                    long choiceId, int start, int end)
360                    throws com.liferay.portal.kernel.exception.SystemException {
361                    return getPersistence().findByChoiceId(choiceId, start, end);
362            }
363    
364            /**
365            * Returns an ordered range of all the polls votes where choiceId = &#63;.
366            *
367            * <p>
368            * 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.
369            * </p>
370            *
371            * @param choiceId the choice ID
372            * @param start the lower bound of the range of polls votes
373            * @param end the upper bound of the range of polls votes (not inclusive)
374            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
375            * @return the ordered range of matching polls votes
376            * @throws SystemException if a system exception occurred
377            */
378            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
379                    long choiceId, int start, int end,
380                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
381                    throws com.liferay.portal.kernel.exception.SystemException {
382                    return getPersistence()
383                                       .findByChoiceId(choiceId, start, end, orderByComparator);
384            }
385    
386            /**
387            * Returns the first polls vote in the ordered set where choiceId = &#63;.
388            *
389            * @param choiceId the choice ID
390            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
391            * @return the first matching polls vote
392            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
393            * @throws SystemException if a system exception occurred
394            */
395            public static com.liferay.portlet.polls.model.PollsVote findByChoiceId_First(
396                    long choiceId,
397                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
398                    throws com.liferay.portal.kernel.exception.SystemException,
399                            com.liferay.portlet.polls.NoSuchVoteException {
400                    return getPersistence().findByChoiceId_First(choiceId, orderByComparator);
401            }
402    
403            /**
404            * Returns the first polls vote in the ordered set where choiceId = &#63;.
405            *
406            * @param choiceId the choice ID
407            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
408            * @return the first matching polls vote, or <code>null</code> if a matching polls vote could not be found
409            * @throws SystemException if a system exception occurred
410            */
411            public static com.liferay.portlet.polls.model.PollsVote fetchByChoiceId_First(
412                    long choiceId,
413                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
414                    throws com.liferay.portal.kernel.exception.SystemException {
415                    return getPersistence()
416                                       .fetchByChoiceId_First(choiceId, orderByComparator);
417            }
418    
419            /**
420            * Returns the last polls vote in the ordered set where choiceId = &#63;.
421            *
422            * @param choiceId the choice ID
423            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
424            * @return the last matching polls vote
425            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
426            * @throws SystemException if a system exception occurred
427            */
428            public static com.liferay.portlet.polls.model.PollsVote findByChoiceId_Last(
429                    long choiceId,
430                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
431                    throws com.liferay.portal.kernel.exception.SystemException,
432                            com.liferay.portlet.polls.NoSuchVoteException {
433                    return getPersistence().findByChoiceId_Last(choiceId, orderByComparator);
434            }
435    
436            /**
437            * Returns the last polls vote in the ordered set where choiceId = &#63;.
438            *
439            * @param choiceId the choice ID
440            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
441            * @return the last matching polls vote, or <code>null</code> if a matching polls vote could not be found
442            * @throws SystemException if a system exception occurred
443            */
444            public static com.liferay.portlet.polls.model.PollsVote fetchByChoiceId_Last(
445                    long choiceId,
446                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
447                    throws com.liferay.portal.kernel.exception.SystemException {
448                    return getPersistence().fetchByChoiceId_Last(choiceId, orderByComparator);
449            }
450    
451            /**
452            * Returns the polls votes before and after the current polls vote in the ordered set where choiceId = &#63;.
453            *
454            * @param voteId the primary key of the current polls vote
455            * @param choiceId the choice ID
456            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
457            * @return the previous, current, and next polls vote
458            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
459            * @throws SystemException if a system exception occurred
460            */
461            public static com.liferay.portlet.polls.model.PollsVote[] findByChoiceId_PrevAndNext(
462                    long voteId, long choiceId,
463                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
464                    throws com.liferay.portal.kernel.exception.SystemException,
465                            com.liferay.portlet.polls.NoSuchVoteException {
466                    return getPersistence()
467                                       .findByChoiceId_PrevAndNext(voteId, choiceId,
468                            orderByComparator);
469            }
470    
471            /**
472            * 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.
473            *
474            * @param questionId the question ID
475            * @param userId the user ID
476            * @return the matching polls vote
477            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
478            * @throws SystemException if a system exception occurred
479            */
480            public static com.liferay.portlet.polls.model.PollsVote findByQ_U(
481                    long questionId, long userId)
482                    throws com.liferay.portal.kernel.exception.SystemException,
483                            com.liferay.portlet.polls.NoSuchVoteException {
484                    return getPersistence().findByQ_U(questionId, userId);
485            }
486    
487            /**
488            * 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.
489            *
490            * @param questionId the question ID
491            * @param userId the user ID
492            * @return the matching polls vote, or <code>null</code> if a matching polls vote could not be found
493            * @throws SystemException if a system exception occurred
494            */
495            public static com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
496                    long questionId, long userId)
497                    throws com.liferay.portal.kernel.exception.SystemException {
498                    return getPersistence().fetchByQ_U(questionId, userId);
499            }
500    
501            /**
502            * 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.
503            *
504            * @param questionId the question ID
505            * @param userId the user ID
506            * @param retrieveFromCache whether to use the finder cache
507            * @return the matching polls vote, or <code>null</code> if a matching polls vote could not be found
508            * @throws SystemException if a system exception occurred
509            */
510            public static com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
511                    long questionId, long userId, boolean retrieveFromCache)
512                    throws com.liferay.portal.kernel.exception.SystemException {
513                    return getPersistence().fetchByQ_U(questionId, userId, retrieveFromCache);
514            }
515    
516            /**
517            * Returns all the polls votes.
518            *
519            * @return the polls votes
520            * @throws SystemException if a system exception occurred
521            */
522            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll()
523                    throws com.liferay.portal.kernel.exception.SystemException {
524                    return getPersistence().findAll();
525            }
526    
527            /**
528            * Returns a range of all the polls votes.
529            *
530            * <p>
531            * 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.
532            * </p>
533            *
534            * @param start the lower bound of the range of polls votes
535            * @param end the upper bound of the range of polls votes (not inclusive)
536            * @return the range of polls votes
537            * @throws SystemException if a system exception occurred
538            */
539            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll(
540                    int start, int end)
541                    throws com.liferay.portal.kernel.exception.SystemException {
542                    return getPersistence().findAll(start, end);
543            }
544    
545            /**
546            * Returns an ordered range of all the polls votes.
547            *
548            * <p>
549            * 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.
550            * </p>
551            *
552            * @param start the lower bound of the range of polls votes
553            * @param end the upper bound of the range of polls votes (not inclusive)
554            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
555            * @return the ordered range of polls votes
556            * @throws SystemException if a system exception occurred
557            */
558            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll(
559                    int start, int end,
560                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
561                    throws com.liferay.portal.kernel.exception.SystemException {
562                    return getPersistence().findAll(start, end, orderByComparator);
563            }
564    
565            /**
566            * Removes all the polls votes where questionId = &#63; from the database.
567            *
568            * @param questionId the question ID
569            * @throws SystemException if a system exception occurred
570            */
571            public static void removeByQuestionId(long questionId)
572                    throws com.liferay.portal.kernel.exception.SystemException {
573                    getPersistence().removeByQuestionId(questionId);
574            }
575    
576            /**
577            * Removes all the polls votes where choiceId = &#63; from the database.
578            *
579            * @param choiceId the choice ID
580            * @throws SystemException if a system exception occurred
581            */
582            public static void removeByChoiceId(long choiceId)
583                    throws com.liferay.portal.kernel.exception.SystemException {
584                    getPersistence().removeByChoiceId(choiceId);
585            }
586    
587            /**
588            * Removes the polls vote where questionId = &#63; and userId = &#63; from the database.
589            *
590            * @param questionId the question ID
591            * @param userId the user ID
592            * @return the polls vote that was removed
593            * @throws SystemException if a system exception occurred
594            */
595            public static com.liferay.portlet.polls.model.PollsVote removeByQ_U(
596                    long questionId, long userId)
597                    throws com.liferay.portal.kernel.exception.SystemException,
598                            com.liferay.portlet.polls.NoSuchVoteException {
599                    return getPersistence().removeByQ_U(questionId, userId);
600            }
601    
602            /**
603            * Removes all the polls votes from the database.
604            *
605            * @throws SystemException if a system exception occurred
606            */
607            public static void removeAll()
608                    throws com.liferay.portal.kernel.exception.SystemException {
609                    getPersistence().removeAll();
610            }
611    
612            /**
613            * Returns the number of polls votes where questionId = &#63;.
614            *
615            * @param questionId the question ID
616            * @return the number of matching polls votes
617            * @throws SystemException if a system exception occurred
618            */
619            public static int countByQuestionId(long questionId)
620                    throws com.liferay.portal.kernel.exception.SystemException {
621                    return getPersistence().countByQuestionId(questionId);
622            }
623    
624            /**
625            * Returns the number of polls votes where choiceId = &#63;.
626            *
627            * @param choiceId the choice ID
628            * @return the number of matching polls votes
629            * @throws SystemException if a system exception occurred
630            */
631            public static int countByChoiceId(long choiceId)
632                    throws com.liferay.portal.kernel.exception.SystemException {
633                    return getPersistence().countByChoiceId(choiceId);
634            }
635    
636            /**
637            * Returns the number of polls votes where questionId = &#63; and userId = &#63;.
638            *
639            * @param questionId the question ID
640            * @param userId the user ID
641            * @return the number of matching polls votes
642            * @throws SystemException if a system exception occurred
643            */
644            public static int countByQ_U(long questionId, long userId)
645                    throws com.liferay.portal.kernel.exception.SystemException {
646                    return getPersistence().countByQ_U(questionId, userId);
647            }
648    
649            /**
650            * Returns the number of polls votes.
651            *
652            * @return the number of polls votes
653            * @throws SystemException if a system exception occurred
654            */
655            public static int countAll()
656                    throws com.liferay.portal.kernel.exception.SystemException {
657                    return getPersistence().countAll();
658            }
659    
660            public static PollsVotePersistence getPersistence() {
661                    if (_persistence == null) {
662                            _persistence = (PollsVotePersistence)PortalBeanLocatorUtil.locate(PollsVotePersistence.class.getName());
663    
664                            ReferenceRegistry.registerReference(PollsVoteUtil.class,
665                                    "_persistence");
666                    }
667    
668                    return _persistence;
669            }
670    
671            /**
672             * @deprecated
673             */
674            public void setPersistence(PollsVotePersistence persistence) {
675            }
676    
677            private static PollsVotePersistence _persistence;
678    }