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.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)
099             */
100            public static PollsVote update(PollsVote pollsVote)
101                    throws SystemException {
102                    return getPersistence().update(pollsVote);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
107             */
108            public static PollsVote update(PollsVote pollsVote,
109                    ServiceContext serviceContext) throws SystemException {
110                    return getPersistence().update(pollsVote, serviceContext);
111            }
112    
113            /**
114            * Returns all the polls votes where questionId = &#63;.
115            *
116            * @param questionId the question ID
117            * @return the matching polls votes
118            * @throws SystemException if a system exception occurred
119            */
120            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
121                    long questionId)
122                    throws com.liferay.portal.kernel.exception.SystemException {
123                    return getPersistence().findByQuestionId(questionId);
124            }
125    
126            /**
127            * Returns a range of all the polls votes where questionId = &#63;.
128            *
129            * <p>
130            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.polls.model.impl.PollsVoteModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
131            * </p>
132            *
133            * @param questionId the question ID
134            * @param start the lower bound of the range of polls votes
135            * @param end the upper bound of the range of polls votes (not inclusive)
136            * @return the range of matching polls votes
137            * @throws SystemException if a system exception occurred
138            */
139            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
140                    long questionId, int start, int end)
141                    throws com.liferay.portal.kernel.exception.SystemException {
142                    return getPersistence().findByQuestionId(questionId, start, end);
143            }
144    
145            /**
146            * Returns an ordered range of all the polls votes where questionId = &#63;.
147            *
148            * <p>
149            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.polls.model.impl.PollsVoteModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
150            * </p>
151            *
152            * @param questionId the question ID
153            * @param start the lower bound of the range of polls votes
154            * @param end the upper bound of the range of polls votes (not inclusive)
155            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
156            * @return the ordered range of matching polls votes
157            * @throws SystemException if a system exception occurred
158            */
159            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
160                    long questionId, int start, int end,
161                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
162                    throws com.liferay.portal.kernel.exception.SystemException {
163                    return getPersistence()
164                                       .findByQuestionId(questionId, start, end, orderByComparator);
165            }
166    
167            /**
168            * Returns the first polls vote in the ordered set where questionId = &#63;.
169            *
170            * @param questionId the question ID
171            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
172            * @return the first matching polls vote
173            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
174            * @throws SystemException if a system exception occurred
175            */
176            public static com.liferay.portlet.polls.model.PollsVote findByQuestionId_First(
177                    long questionId,
178                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
179                    throws com.liferay.portal.kernel.exception.SystemException,
180                            com.liferay.portlet.polls.NoSuchVoteException {
181                    return getPersistence()
182                                       .findByQuestionId_First(questionId, orderByComparator);
183            }
184    
185            /**
186            * Returns the first polls vote in the ordered set where questionId = &#63;.
187            *
188            * @param questionId the question ID
189            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
190            * @return the first matching polls vote, or <code>null</code> if a matching polls vote could not be found
191            * @throws SystemException if a system exception occurred
192            */
193            public static com.liferay.portlet.polls.model.PollsVote fetchByQuestionId_First(
194                    long questionId,
195                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
196                    throws com.liferay.portal.kernel.exception.SystemException {
197                    return getPersistence()
198                                       .fetchByQuestionId_First(questionId, orderByComparator);
199            }
200    
201            /**
202            * Returns the last polls vote in the ordered set where questionId = &#63;.
203            *
204            * @param questionId the question ID
205            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
206            * @return the last matching polls vote
207            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
208            * @throws SystemException if a system exception occurred
209            */
210            public static com.liferay.portlet.polls.model.PollsVote findByQuestionId_Last(
211                    long questionId,
212                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
213                    throws com.liferay.portal.kernel.exception.SystemException,
214                            com.liferay.portlet.polls.NoSuchVoteException {
215                    return getPersistence()
216                                       .findByQuestionId_Last(questionId, orderByComparator);
217            }
218    
219            /**
220            * Returns the last polls vote in the ordered set where questionId = &#63;.
221            *
222            * @param questionId the question ID
223            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
224            * @return the last matching polls vote, or <code>null</code> if a matching polls vote could not be found
225            * @throws SystemException if a system exception occurred
226            */
227            public static com.liferay.portlet.polls.model.PollsVote fetchByQuestionId_Last(
228                    long questionId,
229                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
230                    throws com.liferay.portal.kernel.exception.SystemException {
231                    return getPersistence()
232                                       .fetchByQuestionId_Last(questionId, orderByComparator);
233            }
234    
235            /**
236            * Returns the polls votes before and after the current polls vote in the ordered set where questionId = &#63;.
237            *
238            * @param voteId the primary key of the current polls vote
239            * @param questionId the question ID
240            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
241            * @return the previous, current, and next polls vote
242            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
243            * @throws SystemException if a system exception occurred
244            */
245            public static com.liferay.portlet.polls.model.PollsVote[] findByQuestionId_PrevAndNext(
246                    long voteId, long questionId,
247                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
248                    throws com.liferay.portal.kernel.exception.SystemException,
249                            com.liferay.portlet.polls.NoSuchVoteException {
250                    return getPersistence()
251                                       .findByQuestionId_PrevAndNext(voteId, questionId,
252                            orderByComparator);
253            }
254    
255            /**
256            * Removes all the polls votes where questionId = &#63; from the database.
257            *
258            * @param questionId the question ID
259            * @throws SystemException if a system exception occurred
260            */
261            public static void removeByQuestionId(long questionId)
262                    throws com.liferay.portal.kernel.exception.SystemException {
263                    getPersistence().removeByQuestionId(questionId);
264            }
265    
266            /**
267            * Returns the number of polls votes where questionId = &#63;.
268            *
269            * @param questionId the question ID
270            * @return the number of matching polls votes
271            * @throws SystemException if a system exception occurred
272            */
273            public static int countByQuestionId(long questionId)
274                    throws com.liferay.portal.kernel.exception.SystemException {
275                    return getPersistence().countByQuestionId(questionId);
276            }
277    
278            /**
279            * Returns all the polls votes where choiceId = &#63;.
280            *
281            * @param choiceId the choice ID
282            * @return the matching polls votes
283            * @throws SystemException if a system exception occurred
284            */
285            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
286                    long choiceId)
287                    throws com.liferay.portal.kernel.exception.SystemException {
288                    return getPersistence().findByChoiceId(choiceId);
289            }
290    
291            /**
292            * Returns a range of all the polls votes where choiceId = &#63;.
293            *
294            * <p>
295            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.polls.model.impl.PollsVoteModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
296            * </p>
297            *
298            * @param choiceId the choice ID
299            * @param start the lower bound of the range of polls votes
300            * @param end the upper bound of the range of polls votes (not inclusive)
301            * @return the range of matching polls votes
302            * @throws SystemException if a system exception occurred
303            */
304            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
305                    long choiceId, int start, int end)
306                    throws com.liferay.portal.kernel.exception.SystemException {
307                    return getPersistence().findByChoiceId(choiceId, start, end);
308            }
309    
310            /**
311            * Returns an ordered range of all the polls votes where choiceId = &#63;.
312            *
313            * <p>
314            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.polls.model.impl.PollsVoteModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
315            * </p>
316            *
317            * @param choiceId the choice ID
318            * @param start the lower bound of the range of polls votes
319            * @param end the upper bound of the range of polls votes (not inclusive)
320            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
321            * @return the ordered range of matching polls votes
322            * @throws SystemException if a system exception occurred
323            */
324            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
325                    long choiceId, int start, int end,
326                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
327                    throws com.liferay.portal.kernel.exception.SystemException {
328                    return getPersistence()
329                                       .findByChoiceId(choiceId, start, end, orderByComparator);
330            }
331    
332            /**
333            * Returns the first polls vote in the ordered set where choiceId = &#63;.
334            *
335            * @param choiceId the choice ID
336            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
337            * @return the first matching polls vote
338            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
339            * @throws SystemException if a system exception occurred
340            */
341            public static com.liferay.portlet.polls.model.PollsVote findByChoiceId_First(
342                    long choiceId,
343                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
344                    throws com.liferay.portal.kernel.exception.SystemException,
345                            com.liferay.portlet.polls.NoSuchVoteException {
346                    return getPersistence().findByChoiceId_First(choiceId, orderByComparator);
347            }
348    
349            /**
350            * Returns the first polls vote in the ordered set where choiceId = &#63;.
351            *
352            * @param choiceId the choice ID
353            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
354            * @return the first matching polls vote, or <code>null</code> if a matching polls vote could not be found
355            * @throws SystemException if a system exception occurred
356            */
357            public static com.liferay.portlet.polls.model.PollsVote fetchByChoiceId_First(
358                    long choiceId,
359                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
360                    throws com.liferay.portal.kernel.exception.SystemException {
361                    return getPersistence()
362                                       .fetchByChoiceId_First(choiceId, orderByComparator);
363            }
364    
365            /**
366            * Returns the last polls vote in the ordered set where choiceId = &#63;.
367            *
368            * @param choiceId the choice ID
369            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
370            * @return the last matching polls vote
371            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
372            * @throws SystemException if a system exception occurred
373            */
374            public static com.liferay.portlet.polls.model.PollsVote findByChoiceId_Last(
375                    long choiceId,
376                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
377                    throws com.liferay.portal.kernel.exception.SystemException,
378                            com.liferay.portlet.polls.NoSuchVoteException {
379                    return getPersistence().findByChoiceId_Last(choiceId, orderByComparator);
380            }
381    
382            /**
383            * Returns the last polls vote in the ordered set where choiceId = &#63;.
384            *
385            * @param choiceId the choice ID
386            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
387            * @return the last matching polls vote, or <code>null</code> if a matching polls vote could not be found
388            * @throws SystemException if a system exception occurred
389            */
390            public static com.liferay.portlet.polls.model.PollsVote fetchByChoiceId_Last(
391                    long choiceId,
392                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
393                    throws com.liferay.portal.kernel.exception.SystemException {
394                    return getPersistence().fetchByChoiceId_Last(choiceId, orderByComparator);
395            }
396    
397            /**
398            * Returns the polls votes before and after the current polls vote in the ordered set where choiceId = &#63;.
399            *
400            * @param voteId the primary key of the current polls vote
401            * @param choiceId the choice ID
402            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
403            * @return the previous, current, and next polls vote
404            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
405            * @throws SystemException if a system exception occurred
406            */
407            public static com.liferay.portlet.polls.model.PollsVote[] findByChoiceId_PrevAndNext(
408                    long voteId, long choiceId,
409                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
410                    throws com.liferay.portal.kernel.exception.SystemException,
411                            com.liferay.portlet.polls.NoSuchVoteException {
412                    return getPersistence()
413                                       .findByChoiceId_PrevAndNext(voteId, choiceId,
414                            orderByComparator);
415            }
416    
417            /**
418            * Removes all the polls votes where choiceId = &#63; from the database.
419            *
420            * @param choiceId the choice ID
421            * @throws SystemException if a system exception occurred
422            */
423            public static void removeByChoiceId(long choiceId)
424                    throws com.liferay.portal.kernel.exception.SystemException {
425                    getPersistence().removeByChoiceId(choiceId);
426            }
427    
428            /**
429            * Returns the number of polls votes where choiceId = &#63;.
430            *
431            * @param choiceId the choice ID
432            * @return the number of matching polls votes
433            * @throws SystemException if a system exception occurred
434            */
435            public static int countByChoiceId(long choiceId)
436                    throws com.liferay.portal.kernel.exception.SystemException {
437                    return getPersistence().countByChoiceId(choiceId);
438            }
439    
440            /**
441            * 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.
442            *
443            * @param questionId the question ID
444            * @param userId the user ID
445            * @return the matching polls vote
446            * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found
447            * @throws SystemException if a system exception occurred
448            */
449            public static com.liferay.portlet.polls.model.PollsVote findByQ_U(
450                    long questionId, long userId)
451                    throws com.liferay.portal.kernel.exception.SystemException,
452                            com.liferay.portlet.polls.NoSuchVoteException {
453                    return getPersistence().findByQ_U(questionId, userId);
454            }
455    
456            /**
457            * 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.
458            *
459            * @param questionId the question ID
460            * @param userId the user ID
461            * @return the matching polls vote, or <code>null</code> if a matching polls vote could not be found
462            * @throws SystemException if a system exception occurred
463            */
464            public static com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
465                    long questionId, long userId)
466                    throws com.liferay.portal.kernel.exception.SystemException {
467                    return getPersistence().fetchByQ_U(questionId, userId);
468            }
469    
470            /**
471            * 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.
472            *
473            * @param questionId the question ID
474            * @param userId the user ID
475            * @param retrieveFromCache whether to use the finder cache
476            * @return the matching polls vote, or <code>null</code> if a matching polls vote could not be found
477            * @throws SystemException if a system exception occurred
478            */
479            public static com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
480                    long questionId, long userId, boolean retrieveFromCache)
481                    throws com.liferay.portal.kernel.exception.SystemException {
482                    return getPersistence().fetchByQ_U(questionId, userId, retrieveFromCache);
483            }
484    
485            /**
486            * Removes the polls vote where questionId = &#63; and userId = &#63; from the database.
487            *
488            * @param questionId the question ID
489            * @param userId the user ID
490            * @return the polls vote that was removed
491            * @throws SystemException if a system exception occurred
492            */
493            public static com.liferay.portlet.polls.model.PollsVote removeByQ_U(
494                    long questionId, long userId)
495                    throws com.liferay.portal.kernel.exception.SystemException,
496                            com.liferay.portlet.polls.NoSuchVoteException {
497                    return getPersistence().removeByQ_U(questionId, userId);
498            }
499    
500            /**
501            * Returns the number of polls votes where questionId = &#63; and userId = &#63;.
502            *
503            * @param questionId the question ID
504            * @param userId the user ID
505            * @return the number of matching polls votes
506            * @throws SystemException if a system exception occurred
507            */
508            public static int countByQ_U(long questionId, long userId)
509                    throws com.liferay.portal.kernel.exception.SystemException {
510                    return getPersistence().countByQ_U(questionId, userId);
511            }
512    
513            /**
514            * Caches the polls vote in the entity cache if it is enabled.
515            *
516            * @param pollsVote the polls vote
517            */
518            public static void cacheResult(
519                    com.liferay.portlet.polls.model.PollsVote pollsVote) {
520                    getPersistence().cacheResult(pollsVote);
521            }
522    
523            /**
524            * Caches the polls votes in the entity cache if it is enabled.
525            *
526            * @param pollsVotes the polls votes
527            */
528            public static void cacheResult(
529                    java.util.List<com.liferay.portlet.polls.model.PollsVote> pollsVotes) {
530                    getPersistence().cacheResult(pollsVotes);
531            }
532    
533            /**
534            * Creates a new polls vote with the primary key. Does not add the polls vote to the database.
535            *
536            * @param voteId the primary key for the new polls vote
537            * @return the new polls vote
538            */
539            public static com.liferay.portlet.polls.model.PollsVote create(long voteId) {
540                    return getPersistence().create(voteId);
541            }
542    
543            /**
544            * Removes the polls vote with the primary key from the database. Also notifies the appropriate model listeners.
545            *
546            * @param voteId the primary key of the polls vote
547            * @return the polls vote that was removed
548            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
549            * @throws SystemException if a system exception occurred
550            */
551            public static com.liferay.portlet.polls.model.PollsVote remove(long voteId)
552                    throws com.liferay.portal.kernel.exception.SystemException,
553                            com.liferay.portlet.polls.NoSuchVoteException {
554                    return getPersistence().remove(voteId);
555            }
556    
557            public static com.liferay.portlet.polls.model.PollsVote updateImpl(
558                    com.liferay.portlet.polls.model.PollsVote pollsVote)
559                    throws com.liferay.portal.kernel.exception.SystemException {
560                    return getPersistence().updateImpl(pollsVote);
561            }
562    
563            /**
564            * Returns the polls vote with the primary key or throws a {@link com.liferay.portlet.polls.NoSuchVoteException} if it could not be found.
565            *
566            * @param voteId the primary key of the polls vote
567            * @return the polls vote
568            * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found
569            * @throws SystemException if a system exception occurred
570            */
571            public static com.liferay.portlet.polls.model.PollsVote findByPrimaryKey(
572                    long voteId)
573                    throws com.liferay.portal.kernel.exception.SystemException,
574                            com.liferay.portlet.polls.NoSuchVoteException {
575                    return getPersistence().findByPrimaryKey(voteId);
576            }
577    
578            /**
579            * Returns the polls vote with the primary key or returns <code>null</code> if it could not be found.
580            *
581            * @param voteId the primary key of the polls vote
582            * @return the polls vote, or <code>null</code> if a polls vote with the primary key could not be found
583            * @throws SystemException if a system exception occurred
584            */
585            public static com.liferay.portlet.polls.model.PollsVote fetchByPrimaryKey(
586                    long voteId) throws com.liferay.portal.kernel.exception.SystemException {
587                    return getPersistence().fetchByPrimaryKey(voteId);
588            }
589    
590            /**
591            * Returns all the polls votes.
592            *
593            * @return the polls votes
594            * @throws SystemException if a system exception occurred
595            */
596            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll()
597                    throws com.liferay.portal.kernel.exception.SystemException {
598                    return getPersistence().findAll();
599            }
600    
601            /**
602            * Returns a range of all the polls votes.
603            *
604            * <p>
605            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.polls.model.impl.PollsVoteModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
606            * </p>
607            *
608            * @param start the lower bound of the range of polls votes
609            * @param end the upper bound of the range of polls votes (not inclusive)
610            * @return the range of polls votes
611            * @throws SystemException if a system exception occurred
612            */
613            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll(
614                    int start, int end)
615                    throws com.liferay.portal.kernel.exception.SystemException {
616                    return getPersistence().findAll(start, end);
617            }
618    
619            /**
620            * Returns an ordered range of all the polls votes.
621            *
622            * <p>
623            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.polls.model.impl.PollsVoteModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
624            * </p>
625            *
626            * @param start the lower bound of the range of polls votes
627            * @param end the upper bound of the range of polls votes (not inclusive)
628            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
629            * @return the ordered range of polls votes
630            * @throws SystemException if a system exception occurred
631            */
632            public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll(
633                    int start, int end,
634                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
635                    throws com.liferay.portal.kernel.exception.SystemException {
636                    return getPersistence().findAll(start, end, orderByComparator);
637            }
638    
639            /**
640            * Removes all the polls votes from the database.
641            *
642            * @throws SystemException if a system exception occurred
643            */
644            public static void removeAll()
645                    throws com.liferay.portal.kernel.exception.SystemException {
646                    getPersistence().removeAll();
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    }