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