1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.polls.service.persistence;
24  
25  /**
26   * <a href="PollsChoiceUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class PollsChoiceUtil {
32      public static void cacheResult(
33          com.liferay.portlet.polls.model.PollsChoice pollsChoice) {
34          getPersistence().cacheResult(pollsChoice);
35      }
36  
37      public static void cacheResult(
38          java.util.List<com.liferay.portlet.polls.model.PollsChoice> pollsChoices) {
39          getPersistence().cacheResult(pollsChoices);
40      }
41  
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      public static com.liferay.portlet.polls.model.PollsChoice create(
47          long choiceId) {
48          return getPersistence().create(choiceId);
49      }
50  
51      public static com.liferay.portlet.polls.model.PollsChoice remove(
52          long choiceId)
53          throws com.liferay.portal.SystemException,
54              com.liferay.portlet.polls.NoSuchChoiceException {
55          return getPersistence().remove(choiceId);
56      }
57  
58      public static com.liferay.portlet.polls.model.PollsChoice remove(
59          com.liferay.portlet.polls.model.PollsChoice pollsChoice)
60          throws com.liferay.portal.SystemException {
61          return getPersistence().remove(pollsChoice);
62      }
63  
64      /**
65       * @deprecated Use <code>update(PollsChoice pollsChoice, boolean merge)</code>.
66       */
67      public static com.liferay.portlet.polls.model.PollsChoice update(
68          com.liferay.portlet.polls.model.PollsChoice pollsChoice)
69          throws com.liferay.portal.SystemException {
70          return getPersistence().update(pollsChoice);
71      }
72  
73      /**
74       * Add, update, or merge, the entity. This method also calls the model
75       * listeners to trigger the proper events associated with adding, deleting,
76       * or updating an entity.
77       *
78       * @param        pollsChoice the entity to add, update, or merge
79       * @param        merge boolean value for whether to merge the entity. The
80       *                default value is false. Setting merge to true is more
81       *                expensive and should only be true when pollsChoice is
82       *                transient. See LEP-5473 for a detailed discussion of this
83       *                method.
84       * @return        true if the portlet can be displayed via Ajax
85       */
86      public static com.liferay.portlet.polls.model.PollsChoice update(
87          com.liferay.portlet.polls.model.PollsChoice pollsChoice, boolean merge)
88          throws com.liferay.portal.SystemException {
89          return getPersistence().update(pollsChoice, merge);
90      }
91  
92      public static com.liferay.portlet.polls.model.PollsChoice updateImpl(
93          com.liferay.portlet.polls.model.PollsChoice pollsChoice, boolean merge)
94          throws com.liferay.portal.SystemException {
95          return getPersistence().updateImpl(pollsChoice, merge);
96      }
97  
98      public static com.liferay.portlet.polls.model.PollsChoice findByPrimaryKey(
99          long choiceId)
100         throws com.liferay.portal.SystemException,
101             com.liferay.portlet.polls.NoSuchChoiceException {
102         return getPersistence().findByPrimaryKey(choiceId);
103     }
104 
105     public static com.liferay.portlet.polls.model.PollsChoice fetchByPrimaryKey(
106         long choiceId) throws com.liferay.portal.SystemException {
107         return getPersistence().fetchByPrimaryKey(choiceId);
108     }
109 
110     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
111         java.lang.String uuid) throws com.liferay.portal.SystemException {
112         return getPersistence().findByUuid(uuid);
113     }
114 
115     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
116         java.lang.String uuid, int start, int end)
117         throws com.liferay.portal.SystemException {
118         return getPersistence().findByUuid(uuid, start, end);
119     }
120 
121     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
122         java.lang.String uuid, int start, int end,
123         com.liferay.portal.kernel.util.OrderByComparator obc)
124         throws com.liferay.portal.SystemException {
125         return getPersistence().findByUuid(uuid, start, end, obc);
126     }
127 
128     public static com.liferay.portlet.polls.model.PollsChoice findByUuid_First(
129         java.lang.String uuid,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException,
132             com.liferay.portlet.polls.NoSuchChoiceException {
133         return getPersistence().findByUuid_First(uuid, obc);
134     }
135 
136     public static com.liferay.portlet.polls.model.PollsChoice findByUuid_Last(
137         java.lang.String uuid,
138         com.liferay.portal.kernel.util.OrderByComparator obc)
139         throws com.liferay.portal.SystemException,
140             com.liferay.portlet.polls.NoSuchChoiceException {
141         return getPersistence().findByUuid_Last(uuid, obc);
142     }
143 
144     public static com.liferay.portlet.polls.model.PollsChoice[] findByUuid_PrevAndNext(
145         long choiceId, java.lang.String uuid,
146         com.liferay.portal.kernel.util.OrderByComparator obc)
147         throws com.liferay.portal.SystemException,
148             com.liferay.portlet.polls.NoSuchChoiceException {
149         return getPersistence().findByUuid_PrevAndNext(choiceId, uuid, obc);
150     }
151 
152     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
153         long questionId) throws com.liferay.portal.SystemException {
154         return getPersistence().findByQuestionId(questionId);
155     }
156 
157     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
158         long questionId, int start, int end)
159         throws com.liferay.portal.SystemException {
160         return getPersistence().findByQuestionId(questionId, start, end);
161     }
162 
163     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
164         long questionId, int start, int end,
165         com.liferay.portal.kernel.util.OrderByComparator obc)
166         throws com.liferay.portal.SystemException {
167         return getPersistence().findByQuestionId(questionId, start, end, obc);
168     }
169 
170     public static com.liferay.portlet.polls.model.PollsChoice findByQuestionId_First(
171         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
172         throws com.liferay.portal.SystemException,
173             com.liferay.portlet.polls.NoSuchChoiceException {
174         return getPersistence().findByQuestionId_First(questionId, obc);
175     }
176 
177     public static com.liferay.portlet.polls.model.PollsChoice findByQuestionId_Last(
178         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
179         throws com.liferay.portal.SystemException,
180             com.liferay.portlet.polls.NoSuchChoiceException {
181         return getPersistence().findByQuestionId_Last(questionId, obc);
182     }
183 
184     public static com.liferay.portlet.polls.model.PollsChoice[] findByQuestionId_PrevAndNext(
185         long choiceId, long questionId,
186         com.liferay.portal.kernel.util.OrderByComparator obc)
187         throws com.liferay.portal.SystemException,
188             com.liferay.portlet.polls.NoSuchChoiceException {
189         return getPersistence()
190                    .findByQuestionId_PrevAndNext(choiceId, questionId, obc);
191     }
192 
193     public static com.liferay.portlet.polls.model.PollsChoice findByQ_N(
194         long questionId, java.lang.String name)
195         throws com.liferay.portal.SystemException,
196             com.liferay.portlet.polls.NoSuchChoiceException {
197         return getPersistence().findByQ_N(questionId, name);
198     }
199 
200     public static com.liferay.portlet.polls.model.PollsChoice fetchByQ_N(
201         long questionId, java.lang.String name)
202         throws com.liferay.portal.SystemException {
203         return getPersistence().fetchByQ_N(questionId, name);
204     }
205 
206     public static com.liferay.portlet.polls.model.PollsChoice fetchByQ_N(
207         long questionId, java.lang.String name, boolean retrieveFromCache)
208         throws com.liferay.portal.SystemException {
209         return getPersistence().fetchByQ_N(questionId, name, retrieveFromCache);
210     }
211 
212     public static java.util.List<Object> findWithDynamicQuery(
213         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
214         throws com.liferay.portal.SystemException {
215         return getPersistence().findWithDynamicQuery(dynamicQuery);
216     }
217 
218     public static java.util.List<Object> findWithDynamicQuery(
219         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
220         int end) throws com.liferay.portal.SystemException {
221         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
222     }
223 
224     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll()
225         throws com.liferay.portal.SystemException {
226         return getPersistence().findAll();
227     }
228 
229     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll(
230         int start, int end) throws com.liferay.portal.SystemException {
231         return getPersistence().findAll(start, end);
232     }
233 
234     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll(
235         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
236         throws com.liferay.portal.SystemException {
237         return getPersistence().findAll(start, end, obc);
238     }
239 
240     public static void removeByUuid(java.lang.String uuid)
241         throws com.liferay.portal.SystemException {
242         getPersistence().removeByUuid(uuid);
243     }
244 
245     public static void removeByQuestionId(long questionId)
246         throws com.liferay.portal.SystemException {
247         getPersistence().removeByQuestionId(questionId);
248     }
249 
250     public static void removeByQ_N(long questionId, java.lang.String name)
251         throws com.liferay.portal.SystemException,
252             com.liferay.portlet.polls.NoSuchChoiceException {
253         getPersistence().removeByQ_N(questionId, name);
254     }
255 
256     public static void removeAll() throws com.liferay.portal.SystemException {
257         getPersistence().removeAll();
258     }
259 
260     public static int countByUuid(java.lang.String uuid)
261         throws com.liferay.portal.SystemException {
262         return getPersistence().countByUuid(uuid);
263     }
264 
265     public static int countByQuestionId(long questionId)
266         throws com.liferay.portal.SystemException {
267         return getPersistence().countByQuestionId(questionId);
268     }
269 
270     public static int countByQ_N(long questionId, java.lang.String name)
271         throws com.liferay.portal.SystemException {
272         return getPersistence().countByQ_N(questionId, name);
273     }
274 
275     public static int countAll() throws com.liferay.portal.SystemException {
276         return getPersistence().countAll();
277     }
278 
279     public static PollsChoicePersistence getPersistence() {
280         return _persistence;
281     }
282 
283     public void setPersistence(PollsChoicePersistence persistence) {
284         _persistence = persistence;
285     }
286 
287     private static PollsChoicePersistence _persistence;
288 }