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 com.liferay.portlet.polls.model.PollsChoice create(
33          long choiceId) {
34          return getPersistence().create(choiceId);
35      }
36  
37      public static com.liferay.portlet.polls.model.PollsChoice remove(
38          long choiceId)
39          throws com.liferay.portal.SystemException,
40              com.liferay.portlet.polls.NoSuchChoiceException {
41          return getPersistence().remove(choiceId);
42      }
43  
44      public static com.liferay.portlet.polls.model.PollsChoice remove(
45          com.liferay.portlet.polls.model.PollsChoice pollsChoice)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(pollsChoice);
48      }
49  
50      /**
51       * @deprecated Use <code>update(PollsChoice pollsChoice, boolean merge)</code>.
52       */
53      public static com.liferay.portlet.polls.model.PollsChoice update(
54          com.liferay.portlet.polls.model.PollsChoice pollsChoice)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(pollsChoice);
57      }
58  
59      /**
60       * Add, update, or merge, the entity. This method also calls the model
61       * listeners to trigger the proper events associated with adding, deleting,
62       * or updating an entity.
63       *
64       * @param        pollsChoice the entity to add, update, or merge
65       * @param        merge boolean value for whether to merge the entity. The
66       *                default value is false. Setting merge to true is more
67       *                expensive and should only be true when pollsChoice is
68       *                transient. See LEP-5473 for a detailed discussion of this
69       *                method.
70       * @return        true if the portlet can be displayed via Ajax
71       */
72      public static com.liferay.portlet.polls.model.PollsChoice update(
73          com.liferay.portlet.polls.model.PollsChoice pollsChoice, boolean merge)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(pollsChoice, merge);
76      }
77  
78      public static com.liferay.portlet.polls.model.PollsChoice updateImpl(
79          com.liferay.portlet.polls.model.PollsChoice pollsChoice, boolean merge)
80          throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(pollsChoice, merge);
82      }
83  
84      public static com.liferay.portlet.polls.model.PollsChoice findByPrimaryKey(
85          long choiceId)
86          throws com.liferay.portal.SystemException,
87              com.liferay.portlet.polls.NoSuchChoiceException {
88          return getPersistence().findByPrimaryKey(choiceId);
89      }
90  
91      public static com.liferay.portlet.polls.model.PollsChoice fetchByPrimaryKey(
92          long choiceId) throws com.liferay.portal.SystemException {
93          return getPersistence().fetchByPrimaryKey(choiceId);
94      }
95  
96      public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
97          java.lang.String uuid) throws com.liferay.portal.SystemException {
98          return getPersistence().findByUuid(uuid);
99      }
100 
101     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
102         java.lang.String uuid, int start, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByUuid(uuid, start, end);
105     }
106 
107     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
108         java.lang.String uuid, int start, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByUuid(uuid, start, end, obc);
112     }
113 
114     public static com.liferay.portlet.polls.model.PollsChoice findByUuid_First(
115         java.lang.String uuid,
116         com.liferay.portal.kernel.util.OrderByComparator obc)
117         throws com.liferay.portal.SystemException,
118             com.liferay.portlet.polls.NoSuchChoiceException {
119         return getPersistence().findByUuid_First(uuid, obc);
120     }
121 
122     public static com.liferay.portlet.polls.model.PollsChoice findByUuid_Last(
123         java.lang.String uuid,
124         com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.SystemException,
126             com.liferay.portlet.polls.NoSuchChoiceException {
127         return getPersistence().findByUuid_Last(uuid, obc);
128     }
129 
130     public static com.liferay.portlet.polls.model.PollsChoice[] findByUuid_PrevAndNext(
131         long choiceId, java.lang.String uuid,
132         com.liferay.portal.kernel.util.OrderByComparator obc)
133         throws com.liferay.portal.SystemException,
134             com.liferay.portlet.polls.NoSuchChoiceException {
135         return getPersistence().findByUuid_PrevAndNext(choiceId, uuid, obc);
136     }
137 
138     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
139         long questionId) throws com.liferay.portal.SystemException {
140         return getPersistence().findByQuestionId(questionId);
141     }
142 
143     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
144         long questionId, int start, int end)
145         throws com.liferay.portal.SystemException {
146         return getPersistence().findByQuestionId(questionId, start, end);
147     }
148 
149     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
150         long questionId, int start, int end,
151         com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.SystemException {
153         return getPersistence().findByQuestionId(questionId, start, end, obc);
154     }
155 
156     public static com.liferay.portlet.polls.model.PollsChoice findByQuestionId_First(
157         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
158         throws com.liferay.portal.SystemException,
159             com.liferay.portlet.polls.NoSuchChoiceException {
160         return getPersistence().findByQuestionId_First(questionId, obc);
161     }
162 
163     public static com.liferay.portlet.polls.model.PollsChoice findByQuestionId_Last(
164         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
165         throws com.liferay.portal.SystemException,
166             com.liferay.portlet.polls.NoSuchChoiceException {
167         return getPersistence().findByQuestionId_Last(questionId, obc);
168     }
169 
170     public static com.liferay.portlet.polls.model.PollsChoice[] findByQuestionId_PrevAndNext(
171         long choiceId, long questionId,
172         com.liferay.portal.kernel.util.OrderByComparator obc)
173         throws com.liferay.portal.SystemException,
174             com.liferay.portlet.polls.NoSuchChoiceException {
175         return getPersistence()
176                    .findByQuestionId_PrevAndNext(choiceId, questionId, obc);
177     }
178 
179     public static com.liferay.portlet.polls.model.PollsChoice findByQ_N(
180         long questionId, java.lang.String name)
181         throws com.liferay.portal.SystemException,
182             com.liferay.portlet.polls.NoSuchChoiceException {
183         return getPersistence().findByQ_N(questionId, name);
184     }
185 
186     public static com.liferay.portlet.polls.model.PollsChoice fetchByQ_N(
187         long questionId, java.lang.String name)
188         throws com.liferay.portal.SystemException {
189         return getPersistence().fetchByQ_N(questionId, name);
190     }
191 
192     public static java.util.List<Object> findWithDynamicQuery(
193         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
194         throws com.liferay.portal.SystemException {
195         return getPersistence().findWithDynamicQuery(dynamicQuery);
196     }
197 
198     public static java.util.List<Object> findWithDynamicQuery(
199         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
200         int end) throws com.liferay.portal.SystemException {
201         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
202     }
203 
204     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll()
205         throws com.liferay.portal.SystemException {
206         return getPersistence().findAll();
207     }
208 
209     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll(
210         int start, int end) throws com.liferay.portal.SystemException {
211         return getPersistence().findAll(start, end);
212     }
213 
214     public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll(
215         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
216         throws com.liferay.portal.SystemException {
217         return getPersistence().findAll(start, end, obc);
218     }
219 
220     public static void removeByUuid(java.lang.String uuid)
221         throws com.liferay.portal.SystemException {
222         getPersistence().removeByUuid(uuid);
223     }
224 
225     public static void removeByQuestionId(long questionId)
226         throws com.liferay.portal.SystemException {
227         getPersistence().removeByQuestionId(questionId);
228     }
229 
230     public static void removeByQ_N(long questionId, java.lang.String name)
231         throws com.liferay.portal.SystemException,
232             com.liferay.portlet.polls.NoSuchChoiceException {
233         getPersistence().removeByQ_N(questionId, name);
234     }
235 
236     public static void removeAll() throws com.liferay.portal.SystemException {
237         getPersistence().removeAll();
238     }
239 
240     public static int countByUuid(java.lang.String uuid)
241         throws com.liferay.portal.SystemException {
242         return getPersistence().countByUuid(uuid);
243     }
244 
245     public static int countByQuestionId(long questionId)
246         throws com.liferay.portal.SystemException {
247         return getPersistence().countByQuestionId(questionId);
248     }
249 
250     public static int countByQ_N(long questionId, java.lang.String name)
251         throws com.liferay.portal.SystemException {
252         return getPersistence().countByQ_N(questionId, name);
253     }
254 
255     public static int countAll() throws com.liferay.portal.SystemException {
256         return getPersistence().countAll();
257     }
258 
259     public static PollsChoicePersistence getPersistence() {
260         return _persistence;
261     }
262 
263     public void setPersistence(PollsChoicePersistence persistence) {
264         _persistence = persistence;
265     }
266 
267     private static PollsChoicePersistence _persistence;
268 }