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.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     * Caching information and settings can be found in <code>portal.properties</code>
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             * NOTE FOR DEVELOPERS:
036             *
037             * Never modify or reference this interface directly. Always use {@link PollsChoiceUtil} to access the polls choice persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
038             */
039    
040            /**
041            * Caches the polls choice in the entity cache if it is enabled.
042            *
043            * @param pollsChoice the polls choice
044            */
045            public void cacheResult(
046                    com.liferay.portlet.polls.model.PollsChoice pollsChoice);
047    
048            /**
049            * Caches the polls choices in the entity cache if it is enabled.
050            *
051            * @param pollsChoices the polls choices
052            */
053            public void cacheResult(
054                    java.util.List<com.liferay.portlet.polls.model.PollsChoice> pollsChoices);
055    
056            /**
057            * Creates a new polls choice with the primary key. Does not add the polls choice to the database.
058            *
059            * @param choiceId the primary key for the new polls choice
060            * @return the new polls choice
061            */
062            public com.liferay.portlet.polls.model.PollsChoice create(long choiceId);
063    
064            /**
065            * Removes the polls choice with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param choiceId the primary key of the polls choice
068            * @return the polls choice that was removed
069            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a polls choice with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public com.liferay.portlet.polls.model.PollsChoice remove(long choiceId)
073                    throws com.liferay.portal.kernel.exception.SystemException,
074                            com.liferay.portlet.polls.NoSuchChoiceException;
075    
076            public com.liferay.portlet.polls.model.PollsChoice updateImpl(
077                    com.liferay.portlet.polls.model.PollsChoice pollsChoice, boolean merge)
078                    throws com.liferay.portal.kernel.exception.SystemException;
079    
080            /**
081            * Returns the polls choice with the primary key or throws a {@link com.liferay.portlet.polls.NoSuchChoiceException} if it could not be found.
082            *
083            * @param choiceId the primary key of the polls choice
084            * @return the polls choice
085            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a polls choice with the primary key could not be found
086            * @throws SystemException if a system exception occurred
087            */
088            public com.liferay.portlet.polls.model.PollsChoice findByPrimaryKey(
089                    long choiceId)
090                    throws com.liferay.portal.kernel.exception.SystemException,
091                            com.liferay.portlet.polls.NoSuchChoiceException;
092    
093            /**
094            * Returns the polls choice with the primary key or returns <code>null</code> if it could not be found.
095            *
096            * @param choiceId the primary key of the polls choice
097            * @return the polls choice, or <code>null</code> if a polls choice with the primary key could not be found
098            * @throws SystemException if a system exception occurred
099            */
100            public com.liferay.portlet.polls.model.PollsChoice fetchByPrimaryKey(
101                    long choiceId)
102                    throws com.liferay.portal.kernel.exception.SystemException;
103    
104            /**
105            * Returns all the polls choices where uuid = &#63;.
106            *
107            * @param uuid the uuid
108            * @return the matching polls choices
109            * @throws SystemException if a system exception occurred
110            */
111            public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
112                    java.lang.String uuid)
113                    throws com.liferay.portal.kernel.exception.SystemException;
114    
115            /**
116            * Returns a range of all the polls choices where uuid = &#63;.
117            *
118            * <p>
119            * 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.
120            * </p>
121            *
122            * @param uuid the uuid
123            * @param start the lower bound of the range of polls choices
124            * @param end the upper bound of the range of polls choices (not inclusive)
125            * @return the range of matching polls choices
126            * @throws SystemException if a system exception occurred
127            */
128            public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
129                    java.lang.String uuid, int start, int end)
130                    throws com.liferay.portal.kernel.exception.SystemException;
131    
132            /**
133            * Returns an ordered range of all the polls choices where uuid = &#63;.
134            *
135            * <p>
136            * 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.
137            * </p>
138            *
139            * @param uuid the uuid
140            * @param start the lower bound of the range of polls choices
141            * @param end the upper bound of the range of polls choices (not inclusive)
142            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
143            * @return the ordered range of matching polls choices
144            * @throws SystemException if a system exception occurred
145            */
146            public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
147                    java.lang.String uuid, int start, int end,
148                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
149                    throws com.liferay.portal.kernel.exception.SystemException;
150    
151            /**
152            * Returns the first polls choice in the ordered set where uuid = &#63;.
153            *
154            * @param uuid the uuid
155            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
156            * @return the first matching polls choice
157            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found
158            * @throws SystemException if a system exception occurred
159            */
160            public com.liferay.portlet.polls.model.PollsChoice findByUuid_First(
161                    java.lang.String uuid,
162                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
163                    throws com.liferay.portal.kernel.exception.SystemException,
164                            com.liferay.portlet.polls.NoSuchChoiceException;
165    
166            /**
167            * Returns the first polls choice in the ordered set where uuid = &#63;.
168            *
169            * @param uuid the uuid
170            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
171            * @return the first matching polls choice, or <code>null</code> if a matching polls choice could not be found
172            * @throws SystemException if a system exception occurred
173            */
174            public com.liferay.portlet.polls.model.PollsChoice fetchByUuid_First(
175                    java.lang.String uuid,
176                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
177                    throws com.liferay.portal.kernel.exception.SystemException;
178    
179            /**
180            * Returns the last polls choice in the ordered set where uuid = &#63;.
181            *
182            * @param uuid the uuid
183            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
184            * @return the last matching polls choice
185            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found
186            * @throws SystemException if a system exception occurred
187            */
188            public com.liferay.portlet.polls.model.PollsChoice findByUuid_Last(
189                    java.lang.String uuid,
190                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
191                    throws com.liferay.portal.kernel.exception.SystemException,
192                            com.liferay.portlet.polls.NoSuchChoiceException;
193    
194            /**
195            * Returns the last polls choice in the ordered set where uuid = &#63;.
196            *
197            * @param uuid the uuid
198            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
199            * @return the last matching polls choice, or <code>null</code> if a matching polls choice could not be found
200            * @throws SystemException if a system exception occurred
201            */
202            public com.liferay.portlet.polls.model.PollsChoice fetchByUuid_Last(
203                    java.lang.String uuid,
204                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
205                    throws com.liferay.portal.kernel.exception.SystemException;
206    
207            /**
208            * Returns the polls choices before and after the current polls choice in the ordered set where uuid = &#63;.
209            *
210            * @param choiceId the primary key of the current polls choice
211            * @param uuid the uuid
212            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
213            * @return the previous, current, and next polls choice
214            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a polls choice with the primary key could not be found
215            * @throws SystemException if a system exception occurred
216            */
217            public com.liferay.portlet.polls.model.PollsChoice[] findByUuid_PrevAndNext(
218                    long choiceId, java.lang.String uuid,
219                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
220                    throws com.liferay.portal.kernel.exception.SystemException,
221                            com.liferay.portlet.polls.NoSuchChoiceException;
222    
223            /**
224            * Returns all the polls choices where questionId = &#63;.
225            *
226            * @param questionId the question ID
227            * @return the matching polls choices
228            * @throws SystemException if a system exception occurred
229            */
230            public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
231                    long questionId)
232                    throws com.liferay.portal.kernel.exception.SystemException;
233    
234            /**
235            * Returns a range of all the polls choices where questionId = &#63;.
236            *
237            * <p>
238            * 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.
239            * </p>
240            *
241            * @param questionId the question ID
242            * @param start the lower bound of the range of polls choices
243            * @param end the upper bound of the range of polls choices (not inclusive)
244            * @return the range of matching polls choices
245            * @throws SystemException if a system exception occurred
246            */
247            public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
248                    long questionId, int start, int end)
249                    throws com.liferay.portal.kernel.exception.SystemException;
250    
251            /**
252            * Returns an ordered range of all the polls choices where questionId = &#63;.
253            *
254            * <p>
255            * 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.
256            * </p>
257            *
258            * @param questionId the question ID
259            * @param start the lower bound of the range of polls choices
260            * @param end the upper bound of the range of polls choices (not inclusive)
261            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
262            * @return the ordered range of matching polls choices
263            * @throws SystemException if a system exception occurred
264            */
265            public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
266                    long questionId, int start, int end,
267                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
268                    throws com.liferay.portal.kernel.exception.SystemException;
269    
270            /**
271            * Returns the first polls choice in the ordered set where questionId = &#63;.
272            *
273            * @param questionId the question ID
274            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
275            * @return the first matching polls choice
276            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found
277            * @throws SystemException if a system exception occurred
278            */
279            public com.liferay.portlet.polls.model.PollsChoice findByQuestionId_First(
280                    long questionId,
281                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
282                    throws com.liferay.portal.kernel.exception.SystemException,
283                            com.liferay.portlet.polls.NoSuchChoiceException;
284    
285            /**
286            * Returns the first polls choice in the ordered set where questionId = &#63;.
287            *
288            * @param questionId the question ID
289            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
290            * @return the first matching polls choice, or <code>null</code> if a matching polls choice could not be found
291            * @throws SystemException if a system exception occurred
292            */
293            public com.liferay.portlet.polls.model.PollsChoice fetchByQuestionId_First(
294                    long questionId,
295                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
296                    throws com.liferay.portal.kernel.exception.SystemException;
297    
298            /**
299            * Returns the last polls choice in the ordered set where questionId = &#63;.
300            *
301            * @param questionId the question ID
302            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
303            * @return the last matching polls choice
304            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found
305            * @throws SystemException if a system exception occurred
306            */
307            public com.liferay.portlet.polls.model.PollsChoice findByQuestionId_Last(
308                    long questionId,
309                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
310                    throws com.liferay.portal.kernel.exception.SystemException,
311                            com.liferay.portlet.polls.NoSuchChoiceException;
312    
313            /**
314            * Returns the last polls choice in the ordered set where questionId = &#63;.
315            *
316            * @param questionId the question ID
317            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
318            * @return the last matching polls choice, or <code>null</code> if a matching polls choice could not be found
319            * @throws SystemException if a system exception occurred
320            */
321            public com.liferay.portlet.polls.model.PollsChoice fetchByQuestionId_Last(
322                    long questionId,
323                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
324                    throws com.liferay.portal.kernel.exception.SystemException;
325    
326            /**
327            * Returns the polls choices before and after the current polls choice in the ordered set where questionId = &#63;.
328            *
329            * @param choiceId the primary key of the current polls choice
330            * @param questionId the question ID
331            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
332            * @return the previous, current, and next polls choice
333            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a polls choice with the primary key could not be found
334            * @throws SystemException if a system exception occurred
335            */
336            public com.liferay.portlet.polls.model.PollsChoice[] findByQuestionId_PrevAndNext(
337                    long choiceId, long questionId,
338                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
339                    throws com.liferay.portal.kernel.exception.SystemException,
340                            com.liferay.portlet.polls.NoSuchChoiceException;
341    
342            /**
343            * 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.
344            *
345            * @param questionId the question ID
346            * @param name the name
347            * @return the matching polls choice
348            * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found
349            * @throws SystemException if a system exception occurred
350            */
351            public com.liferay.portlet.polls.model.PollsChoice findByQ_N(
352                    long questionId, java.lang.String name)
353                    throws com.liferay.portal.kernel.exception.SystemException,
354                            com.liferay.portlet.polls.NoSuchChoiceException;
355    
356            /**
357            * 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.
358            *
359            * @param questionId the question ID
360            * @param name the name
361            * @return the matching polls choice, or <code>null</code> if a matching polls choice could not be found
362            * @throws SystemException if a system exception occurred
363            */
364            public com.liferay.portlet.polls.model.PollsChoice fetchByQ_N(
365                    long questionId, java.lang.String name)
366                    throws com.liferay.portal.kernel.exception.SystemException;
367    
368            /**
369            * 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.
370            *
371            * @param questionId the question ID
372            * @param name the name
373            * @param retrieveFromCache whether to use the finder cache
374            * @return the matching polls choice, or <code>null</code> if a matching polls choice could not be found
375            * @throws SystemException if a system exception occurred
376            */
377            public com.liferay.portlet.polls.model.PollsChoice fetchByQ_N(
378                    long questionId, java.lang.String name, boolean retrieveFromCache)
379                    throws com.liferay.portal.kernel.exception.SystemException;
380    
381            /**
382            * Returns all the polls choices.
383            *
384            * @return the polls choices
385            * @throws SystemException if a system exception occurred
386            */
387            public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll()
388                    throws com.liferay.portal.kernel.exception.SystemException;
389    
390            /**
391            * Returns a range of all the polls choices.
392            *
393            * <p>
394            * 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.
395            * </p>
396            *
397            * @param start the lower bound of the range of polls choices
398            * @param end the upper bound of the range of polls choices (not inclusive)
399            * @return the range of polls choices
400            * @throws SystemException if a system exception occurred
401            */
402            public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll(
403                    int start, int end)
404                    throws com.liferay.portal.kernel.exception.SystemException;
405    
406            /**
407            * Returns an ordered range of all the polls choices.
408            *
409            * <p>
410            * 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.
411            * </p>
412            *
413            * @param start the lower bound of the range of polls choices
414            * @param end the upper bound of the range of polls choices (not inclusive)
415            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
416            * @return the ordered range of polls choices
417            * @throws SystemException if a system exception occurred
418            */
419            public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll(
420                    int start, int end,
421                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
422                    throws com.liferay.portal.kernel.exception.SystemException;
423    
424            /**
425            * Removes all the polls choices where uuid = &#63; from the database.
426            *
427            * @param uuid the uuid
428            * @throws SystemException if a system exception occurred
429            */
430            public void removeByUuid(java.lang.String uuid)
431                    throws com.liferay.portal.kernel.exception.SystemException;
432    
433            /**
434            * Removes all the polls choices where questionId = &#63; from the database.
435            *
436            * @param questionId the question ID
437            * @throws SystemException if a system exception occurred
438            */
439            public void removeByQuestionId(long questionId)
440                    throws com.liferay.portal.kernel.exception.SystemException;
441    
442            /**
443            * Removes the polls choice where questionId = &#63; and name = &#63; from the database.
444            *
445            * @param questionId the question ID
446            * @param name the name
447            * @return the polls choice that was removed
448            * @throws SystemException if a system exception occurred
449            */
450            public com.liferay.portlet.polls.model.PollsChoice removeByQ_N(
451                    long questionId, java.lang.String name)
452                    throws com.liferay.portal.kernel.exception.SystemException,
453                            com.liferay.portlet.polls.NoSuchChoiceException;
454    
455            /**
456            * Removes all the polls choices from the database.
457            *
458            * @throws SystemException if a system exception occurred
459            */
460            public void removeAll()
461                    throws com.liferay.portal.kernel.exception.SystemException;
462    
463            /**
464            * Returns the number of polls choices where uuid = &#63;.
465            *
466            * @param uuid the uuid
467            * @return the number of matching polls choices
468            * @throws SystemException if a system exception occurred
469            */
470            public int countByUuid(java.lang.String uuid)
471                    throws com.liferay.portal.kernel.exception.SystemException;
472    
473            /**
474            * Returns the number of polls choices where questionId = &#63;.
475            *
476            * @param questionId the question ID
477            * @return the number of matching polls choices
478            * @throws SystemException if a system exception occurred
479            */
480            public int countByQuestionId(long questionId)
481                    throws com.liferay.portal.kernel.exception.SystemException;
482    
483            /**
484            * Returns the number of polls choices where questionId = &#63; and name = &#63;.
485            *
486            * @param questionId the question ID
487            * @param name the name
488            * @return the number of matching polls choices
489            * @throws SystemException if a system exception occurred
490            */
491            public int countByQ_N(long questionId, java.lang.String name)
492                    throws com.liferay.portal.kernel.exception.SystemException;
493    
494            /**
495            * Returns the number of polls choices.
496            *
497            * @return the number of polls choices
498            * @throws SystemException if a system exception occurred
499            */
500            public int countAll()
501                    throws com.liferay.portal.kernel.exception.SystemException;
502    }