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.PollsChoice;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the polls choice service. This utility wraps {@link PollsChoicePersistenceImpl} 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 PollsChoicePersistence
037     * @see PollsChoicePersistenceImpl
038     * @generated
039     */
040    public class PollsChoiceUtil {
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(PollsChoice pollsChoice) {
058                    getPersistence().clearCache(pollsChoice);
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<PollsChoice> 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<PollsChoice> 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<PollsChoice> 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 PollsChoice update(PollsChoice pollsChoice, boolean merge)
101                    throws SystemException {
102                    return getPersistence().update(pollsChoice, merge);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
107             */
108            public static PollsChoice update(PollsChoice pollsChoice, boolean merge,
109                    ServiceContext serviceContext) throws SystemException {
110                    return getPersistence().update(pollsChoice, merge, serviceContext);
111            }
112    
113            /**
114            * Caches the polls choice in the entity cache if it is enabled.
115            *
116            * @param pollsChoice the polls choice
117            */
118            public static void cacheResult(
119                    com.liferay.portlet.polls.model.PollsChoice pollsChoice) {
120                    getPersistence().cacheResult(pollsChoice);
121            }
122    
123            /**
124            * Caches the polls choices in the entity cache if it is enabled.
125            *
126            * @param pollsChoices the polls choices
127            */
128            public static void cacheResult(
129                    java.util.List<com.liferay.portlet.polls.model.PollsChoice> pollsChoices) {
130                    getPersistence().cacheResult(pollsChoices);
131            }
132    
133            /**
134            * Creates a new polls choice with the primary key. Does not add the polls choice to the database.
135            *
136            * @param choiceId the primary key for the new polls choice
137            * @return the new polls choice
138            */
139            public static com.liferay.portlet.polls.model.PollsChoice create(
140                    long choiceId) {
141                    return getPersistence().create(choiceId);
142            }
143    
144            /**
145            * Removes the polls choice with the primary key from the database. Also notifies the appropriate model listeners.
146            *
147            * @param choiceId the primary key of the polls choice
148            * @return the polls choice that was removed
149            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a polls choice with the primary key could not be found
150            * @throws SystemException if a system exception occurred
151            */
152            public static com.liferay.portlet.polls.model.PollsChoice remove(
153                    long choiceId)
154                    throws com.liferay.portal.kernel.exception.SystemException,
155                            com.liferay.portlet.polls.NoSuchChoiceException {
156                    return getPersistence().remove(choiceId);
157            }
158    
159            public static com.liferay.portlet.polls.model.PollsChoice updateImpl(
160                    com.liferay.portlet.polls.model.PollsChoice pollsChoice, boolean merge)
161                    throws com.liferay.portal.kernel.exception.SystemException {
162                    return getPersistence().updateImpl(pollsChoice, merge);
163            }
164    
165            /**
166            * Returns the polls choice with the primary key or throws a {@link com.liferay.portlet.polls.NoSuchChoiceException} if it could not be found.
167            *
168            * @param choiceId the primary key of the polls choice
169            * @return the polls choice
170            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a polls choice with the primary key could not be found
171            * @throws SystemException if a system exception occurred
172            */
173            public static com.liferay.portlet.polls.model.PollsChoice findByPrimaryKey(
174                    long choiceId)
175                    throws com.liferay.portal.kernel.exception.SystemException,
176                            com.liferay.portlet.polls.NoSuchChoiceException {
177                    return getPersistence().findByPrimaryKey(choiceId);
178            }
179    
180            /**
181            * Returns the polls choice with the primary key or returns <code>null</code> if it could not be found.
182            *
183            * @param choiceId the primary key of the polls choice
184            * @return the polls choice, or <code>null</code> if a polls choice with the primary key could not be found
185            * @throws SystemException if a system exception occurred
186            */
187            public static com.liferay.portlet.polls.model.PollsChoice fetchByPrimaryKey(
188                    long choiceId)
189                    throws com.liferay.portal.kernel.exception.SystemException {
190                    return getPersistence().fetchByPrimaryKey(choiceId);
191            }
192    
193            /**
194            * Returns all the polls choices where uuid = &#63;.
195            *
196            * @param uuid the uuid
197            * @return the matching polls choices
198            * @throws SystemException if a system exception occurred
199            */
200            public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
201                    java.lang.String uuid)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return getPersistence().findByUuid(uuid);
204            }
205    
206            /**
207            * Returns a range of all the polls choices where uuid = &#63;.
208            *
209            * <p>
210            * 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.
211            * </p>
212            *
213            * @param uuid the uuid
214            * @param start the lower bound of the range of polls choices
215            * @param end the upper bound of the range of polls choices (not inclusive)
216            * @return the range of matching polls choices
217            * @throws SystemException if a system exception occurred
218            */
219            public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
220                    java.lang.String uuid, int start, int end)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getPersistence().findByUuid(uuid, start, end);
223            }
224    
225            /**
226            * Returns an ordered range of all the polls choices where uuid = &#63;.
227            *
228            * <p>
229            * 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.
230            * </p>
231            *
232            * @param uuid the uuid
233            * @param start the lower bound of the range of polls choices
234            * @param end the upper bound of the range of polls choices (not inclusive)
235            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
236            * @return the ordered range of matching polls choices
237            * @throws SystemException if a system exception occurred
238            */
239            public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
240                    java.lang.String uuid, int start, int end,
241                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getPersistence().findByUuid(uuid, start, end, orderByComparator);
244            }
245    
246            /**
247            * Returns the first polls choice in the ordered set where uuid = &#63;.
248            *
249            * @param uuid the uuid
250            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
251            * @return the first matching polls choice
252            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found
253            * @throws SystemException if a system exception occurred
254            */
255            public static com.liferay.portlet.polls.model.PollsChoice findByUuid_First(
256                    java.lang.String uuid,
257                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
258                    throws com.liferay.portal.kernel.exception.SystemException,
259                            com.liferay.portlet.polls.NoSuchChoiceException {
260                    return getPersistence().findByUuid_First(uuid, orderByComparator);
261            }
262    
263            /**
264            * Returns the first polls choice in the ordered set where uuid = &#63;.
265            *
266            * @param uuid the uuid
267            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
268            * @return the first matching polls choice, or <code>null</code> if a matching polls choice could not be found
269            * @throws SystemException if a system exception occurred
270            */
271            public static com.liferay.portlet.polls.model.PollsChoice fetchByUuid_First(
272                    java.lang.String uuid,
273                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
274                    throws com.liferay.portal.kernel.exception.SystemException {
275                    return getPersistence().fetchByUuid_First(uuid, orderByComparator);
276            }
277    
278            /**
279            * Returns the last polls choice in the ordered set where uuid = &#63;.
280            *
281            * @param uuid the uuid
282            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
283            * @return the last matching polls choice
284            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found
285            * @throws SystemException if a system exception occurred
286            */
287            public static com.liferay.portlet.polls.model.PollsChoice findByUuid_Last(
288                    java.lang.String uuid,
289                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
290                    throws com.liferay.portal.kernel.exception.SystemException,
291                            com.liferay.portlet.polls.NoSuchChoiceException {
292                    return getPersistence().findByUuid_Last(uuid, orderByComparator);
293            }
294    
295            /**
296            * Returns the last polls choice in the ordered set where uuid = &#63;.
297            *
298            * @param uuid the uuid
299            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
300            * @return the last matching polls choice, or <code>null</code> if a matching polls choice could not be found
301            * @throws SystemException if a system exception occurred
302            */
303            public static com.liferay.portlet.polls.model.PollsChoice fetchByUuid_Last(
304                    java.lang.String uuid,
305                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
306                    throws com.liferay.portal.kernel.exception.SystemException {
307                    return getPersistence().fetchByUuid_Last(uuid, orderByComparator);
308            }
309    
310            /**
311            * Returns the polls choices before and after the current polls choice in the ordered set where uuid = &#63;.
312            *
313            * @param choiceId the primary key of the current polls choice
314            * @param uuid the uuid
315            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
316            * @return the previous, current, and next polls choice
317            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a polls choice with the primary key could not be found
318            * @throws SystemException if a system exception occurred
319            */
320            public static com.liferay.portlet.polls.model.PollsChoice[] findByUuid_PrevAndNext(
321                    long choiceId, java.lang.String uuid,
322                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
323                    throws com.liferay.portal.kernel.exception.SystemException,
324                            com.liferay.portlet.polls.NoSuchChoiceException {
325                    return getPersistence()
326                                       .findByUuid_PrevAndNext(choiceId, uuid, orderByComparator);
327            }
328    
329            /**
330            * Returns all the polls choices where questionId = &#63;.
331            *
332            * @param questionId the question ID
333            * @return the matching polls choices
334            * @throws SystemException if a system exception occurred
335            */
336            public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
337                    long questionId)
338                    throws com.liferay.portal.kernel.exception.SystemException {
339                    return getPersistence().findByQuestionId(questionId);
340            }
341    
342            /**
343            * Returns a range of all the polls choices where questionId = &#63;.
344            *
345            * <p>
346            * 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.
347            * </p>
348            *
349            * @param questionId the question ID
350            * @param start the lower bound of the range of polls choices
351            * @param end the upper bound of the range of polls choices (not inclusive)
352            * @return the range of matching polls choices
353            * @throws SystemException if a system exception occurred
354            */
355            public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
356                    long questionId, int start, int end)
357                    throws com.liferay.portal.kernel.exception.SystemException {
358                    return getPersistence().findByQuestionId(questionId, start, end);
359            }
360    
361            /**
362            * Returns an ordered range of all the polls choices where questionId = &#63;.
363            *
364            * <p>
365            * 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.
366            * </p>
367            *
368            * @param questionId the question ID
369            * @param start the lower bound of the range of polls choices
370            * @param end the upper bound of the range of polls choices (not inclusive)
371            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
372            * @return the ordered range of matching polls choices
373            * @throws SystemException if a system exception occurred
374            */
375            public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
376                    long questionId, int start, int end,
377                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
378                    throws com.liferay.portal.kernel.exception.SystemException {
379                    return getPersistence()
380                                       .findByQuestionId(questionId, start, end, orderByComparator);
381            }
382    
383            /**
384            * Returns the first polls choice in the ordered set where questionId = &#63;.
385            *
386            * @param questionId the question ID
387            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
388            * @return the first matching polls choice
389            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found
390            * @throws SystemException if a system exception occurred
391            */
392            public static com.liferay.portlet.polls.model.PollsChoice findByQuestionId_First(
393                    long questionId,
394                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
395                    throws com.liferay.portal.kernel.exception.SystemException,
396                            com.liferay.portlet.polls.NoSuchChoiceException {
397                    return getPersistence()
398                                       .findByQuestionId_First(questionId, orderByComparator);
399            }
400    
401            /**
402            * Returns the first polls choice in the ordered set where questionId = &#63;.
403            *
404            * @param questionId the question ID
405            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
406            * @return the first matching polls choice, or <code>null</code> if a matching polls choice could not be found
407            * @throws SystemException if a system exception occurred
408            */
409            public static com.liferay.portlet.polls.model.PollsChoice fetchByQuestionId_First(
410                    long questionId,
411                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
412                    throws com.liferay.portal.kernel.exception.SystemException {
413                    return getPersistence()
414                                       .fetchByQuestionId_First(questionId, orderByComparator);
415            }
416    
417            /**
418            * Returns the last polls choice in the ordered set where questionId = &#63;.
419            *
420            * @param questionId the question ID
421            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
422            * @return the last matching polls choice
423            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found
424            * @throws SystemException if a system exception occurred
425            */
426            public static com.liferay.portlet.polls.model.PollsChoice findByQuestionId_Last(
427                    long questionId,
428                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
429                    throws com.liferay.portal.kernel.exception.SystemException,
430                            com.liferay.portlet.polls.NoSuchChoiceException {
431                    return getPersistence()
432                                       .findByQuestionId_Last(questionId, orderByComparator);
433            }
434    
435            /**
436            * Returns the last polls choice in the ordered set where questionId = &#63;.
437            *
438            * @param questionId the question ID
439            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
440            * @return the last matching polls choice, or <code>null</code> if a matching polls choice could not be found
441            * @throws SystemException if a system exception occurred
442            */
443            public static com.liferay.portlet.polls.model.PollsChoice fetchByQuestionId_Last(
444                    long questionId,
445                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
446                    throws com.liferay.portal.kernel.exception.SystemException {
447                    return getPersistence()
448                                       .fetchByQuestionId_Last(questionId, orderByComparator);
449            }
450    
451            /**
452            * Returns the polls choices before and after the current polls choice in the ordered set where questionId = &#63;.
453            *
454            * @param choiceId the primary key of the current polls choice
455            * @param questionId the question ID
456            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
457            * @return the previous, current, and next polls choice
458            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a polls choice 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.PollsChoice[] findByQuestionId_PrevAndNext(
462                    long choiceId, long questionId,
463                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
464                    throws com.liferay.portal.kernel.exception.SystemException,
465                            com.liferay.portlet.polls.NoSuchChoiceException {
466                    return getPersistence()
467                                       .findByQuestionId_PrevAndNext(choiceId, questionId,
468                            orderByComparator);
469            }
470    
471            /**
472            * Returns the polls choice where questionId = &#63; and name = &#63; or throws a {@link com.liferay.portlet.polls.NoSuchChoiceException} if it could not be found.
473            *
474            * @param questionId the question ID
475            * @param name the name
476            * @return the matching polls choice
477            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found
478            * @throws SystemException if a system exception occurred
479            */
480            public static com.liferay.portlet.polls.model.PollsChoice findByQ_N(
481                    long questionId, java.lang.String name)
482                    throws com.liferay.portal.kernel.exception.SystemException,
483                            com.liferay.portlet.polls.NoSuchChoiceException {
484                    return getPersistence().findByQ_N(questionId, name);
485            }
486    
487            /**
488            * Returns the polls choice where questionId = &#63; and name = &#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 name the name
492            * @return the matching polls choice, or <code>null</code> if a matching polls choice could not be found
493            * @throws SystemException if a system exception occurred
494            */
495            public static com.liferay.portlet.polls.model.PollsChoice fetchByQ_N(
496                    long questionId, java.lang.String name)
497                    throws com.liferay.portal.kernel.exception.SystemException {
498                    return getPersistence().fetchByQ_N(questionId, name);
499            }
500    
501            /**
502            * Returns the polls choice where questionId = &#63; and name = &#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 name the name
506            * @param retrieveFromCache whether to use the finder cache
507            * @return the matching polls choice, or <code>null</code> if a matching polls choice could not be found
508            * @throws SystemException if a system exception occurred
509            */
510            public static com.liferay.portlet.polls.model.PollsChoice fetchByQ_N(
511                    long questionId, java.lang.String name, boolean retrieveFromCache)
512                    throws com.liferay.portal.kernel.exception.SystemException {
513                    return getPersistence().fetchByQ_N(questionId, name, retrieveFromCache);
514            }
515    
516            /**
517            * Returns all the polls choices.
518            *
519            * @return the polls choices
520            * @throws SystemException if a system exception occurred
521            */
522            public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll()
523                    throws com.liferay.portal.kernel.exception.SystemException {
524                    return getPersistence().findAll();
525            }
526    
527            /**
528            * Returns a range of all the polls choices.
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 choices
535            * @param end the upper bound of the range of polls choices (not inclusive)
536            * @return the range of polls choices
537            * @throws SystemException if a system exception occurred
538            */
539            public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> 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 choices.
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 choices
553            * @param end the upper bound of the range of polls choices (not inclusive)
554            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
555            * @return the ordered range of polls choices
556            * @throws SystemException if a system exception occurred
557            */
558            public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> 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 choices where uuid = &#63; from the database.
567            *
568            * @param uuid the uuid
569            * @throws SystemException if a system exception occurred
570            */
571            public static void removeByUuid(java.lang.String uuid)
572                    throws com.liferay.portal.kernel.exception.SystemException {
573                    getPersistence().removeByUuid(uuid);
574            }
575    
576            /**
577            * Removes all the polls choices where questionId = &#63; from the database.
578            *
579            * @param questionId the question ID
580            * @throws SystemException if a system exception occurred
581            */
582            public static void removeByQuestionId(long questionId)
583                    throws com.liferay.portal.kernel.exception.SystemException {
584                    getPersistence().removeByQuestionId(questionId);
585            }
586    
587            /**
588            * Removes the polls choice where questionId = &#63; and name = &#63; from the database.
589            *
590            * @param questionId the question ID
591            * @param name the name
592            * @return the polls choice that was removed
593            * @throws SystemException if a system exception occurred
594            */
595            public static com.liferay.portlet.polls.model.PollsChoice removeByQ_N(
596                    long questionId, java.lang.String name)
597                    throws com.liferay.portal.kernel.exception.SystemException,
598                            com.liferay.portlet.polls.NoSuchChoiceException {
599                    return getPersistence().removeByQ_N(questionId, name);
600            }
601    
602            /**
603            * Removes all the polls choices 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 choices where uuid = &#63;.
614            *
615            * @param uuid the uuid
616            * @return the number of matching polls choices
617            * @throws SystemException if a system exception occurred
618            */
619            public static int countByUuid(java.lang.String uuid)
620                    throws com.liferay.portal.kernel.exception.SystemException {
621                    return getPersistence().countByUuid(uuid);
622            }
623    
624            /**
625            * Returns the number of polls choices where questionId = &#63;.
626            *
627            * @param questionId the question ID
628            * @return the number of matching polls choices
629            * @throws SystemException if a system exception occurred
630            */
631            public static int countByQuestionId(long questionId)
632                    throws com.liferay.portal.kernel.exception.SystemException {
633                    return getPersistence().countByQuestionId(questionId);
634            }
635    
636            /**
637            * Returns the number of polls choices where questionId = &#63; and name = &#63;.
638            *
639            * @param questionId the question ID
640            * @param name the name
641            * @return the number of matching polls choices
642            * @throws SystemException if a system exception occurred
643            */
644            public static int countByQ_N(long questionId, java.lang.String name)
645                    throws com.liferay.portal.kernel.exception.SystemException {
646                    return getPersistence().countByQ_N(questionId, name);
647            }
648    
649            /**
650            * Returns the number of polls choices.
651            *
652            * @return the number of polls choices
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 PollsChoicePersistence getPersistence() {
661                    if (_persistence == null) {
662                            _persistence = (PollsChoicePersistence)PortalBeanLocatorUtil.locate(PollsChoicePersistence.class.getName());
663    
664                            ReferenceRegistry.registerReference(PollsChoiceUtil.class,
665                                    "_persistence");
666                    }
667    
668                    return _persistence;
669            }
670    
671            /**
672             * @deprecated
673             */
674            public void setPersistence(PollsChoicePersistence persistence) {
675            }
676    
677            private static PollsChoicePersistence _persistence;
678    }