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