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