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