1   /**
2    * Copyright (c) 2000-2010 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   *
12   * 
13   */
14  
15  package com.liferay.portlet.polls.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  
21  import com.liferay.portlet.polls.model.PollsVote;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="PollsVoteUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * @author    Brian Wing Shun Chan
34   * @see       PollsVotePersistence
35   * @see       PollsVotePersistenceImpl
36   * @generated
37   */
38  public class PollsVoteUtil {
39      /**
40       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
41       */
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
48       */
49      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
50          throws SystemException {
51          return getPersistence().findWithDynamicQuery(dynamicQuery);
52      }
53  
54      /**
55       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
56       */
57      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
58          int start, int end) throws SystemException {
59          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
60      }
61  
62      /**
63       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
64       */
65      public static PollsVote remove(PollsVote pollsVote)
66          throws SystemException {
67          return getPersistence().remove(pollsVote);
68      }
69  
70      /**
71       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
72       */
73      public static PollsVote update(PollsVote pollsVote, boolean merge)
74          throws SystemException {
75          return getPersistence().update(pollsVote, merge);
76      }
77  
78      public static void cacheResult(
79          com.liferay.portlet.polls.model.PollsVote pollsVote) {
80          getPersistence().cacheResult(pollsVote);
81      }
82  
83      public static void cacheResult(
84          java.util.List<com.liferay.portlet.polls.model.PollsVote> pollsVotes) {
85          getPersistence().cacheResult(pollsVotes);
86      }
87  
88      public static com.liferay.portlet.polls.model.PollsVote create(long voteId) {
89          return getPersistence().create(voteId);
90      }
91  
92      public static com.liferay.portlet.polls.model.PollsVote remove(long voteId)
93          throws com.liferay.portal.SystemException,
94              com.liferay.portlet.polls.NoSuchVoteException {
95          return getPersistence().remove(voteId);
96      }
97  
98      /**
99       * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
100      */
101     public static com.liferay.portlet.polls.model.PollsVote update(
102         com.liferay.portlet.polls.model.PollsVote pollsVote)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().update(pollsVote);
105     }
106 
107     public static com.liferay.portlet.polls.model.PollsVote updateImpl(
108         com.liferay.portlet.polls.model.PollsVote pollsVote, boolean merge)
109         throws com.liferay.portal.SystemException {
110         return getPersistence().updateImpl(pollsVote, merge);
111     }
112 
113     public static com.liferay.portlet.polls.model.PollsVote findByPrimaryKey(
114         long voteId)
115         throws com.liferay.portal.SystemException,
116             com.liferay.portlet.polls.NoSuchVoteException {
117         return getPersistence().findByPrimaryKey(voteId);
118     }
119 
120     public static com.liferay.portlet.polls.model.PollsVote fetchByPrimaryKey(
121         long voteId) throws com.liferay.portal.SystemException {
122         return getPersistence().fetchByPrimaryKey(voteId);
123     }
124 
125     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
126         long questionId) throws com.liferay.portal.SystemException {
127         return getPersistence().findByQuestionId(questionId);
128     }
129 
130     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
131         long questionId, int start, int end)
132         throws com.liferay.portal.SystemException {
133         return getPersistence().findByQuestionId(questionId, start, end);
134     }
135 
136     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
137         long questionId, int start, int end,
138         com.liferay.portal.kernel.util.OrderByComparator obc)
139         throws com.liferay.portal.SystemException {
140         return getPersistence().findByQuestionId(questionId, start, end, obc);
141     }
142 
143     public static com.liferay.portlet.polls.model.PollsVote findByQuestionId_First(
144         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
145         throws com.liferay.portal.SystemException,
146             com.liferay.portlet.polls.NoSuchVoteException {
147         return getPersistence().findByQuestionId_First(questionId, obc);
148     }
149 
150     public static com.liferay.portlet.polls.model.PollsVote findByQuestionId_Last(
151         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.SystemException,
153             com.liferay.portlet.polls.NoSuchVoteException {
154         return getPersistence().findByQuestionId_Last(questionId, obc);
155     }
156 
157     public static com.liferay.portlet.polls.model.PollsVote[] findByQuestionId_PrevAndNext(
158         long voteId, long questionId,
159         com.liferay.portal.kernel.util.OrderByComparator obc)
160         throws com.liferay.portal.SystemException,
161             com.liferay.portlet.polls.NoSuchVoteException {
162         return getPersistence()
163                    .findByQuestionId_PrevAndNext(voteId, questionId, obc);
164     }
165 
166     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
167         long choiceId) throws com.liferay.portal.SystemException {
168         return getPersistence().findByChoiceId(choiceId);
169     }
170 
171     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
172         long choiceId, int start, int end)
173         throws com.liferay.portal.SystemException {
174         return getPersistence().findByChoiceId(choiceId, start, end);
175     }
176 
177     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
178         long choiceId, int start, int end,
179         com.liferay.portal.kernel.util.OrderByComparator obc)
180         throws com.liferay.portal.SystemException {
181         return getPersistence().findByChoiceId(choiceId, start, end, obc);
182     }
183 
184     public static com.liferay.portlet.polls.model.PollsVote findByChoiceId_First(
185         long choiceId, com.liferay.portal.kernel.util.OrderByComparator obc)
186         throws com.liferay.portal.SystemException,
187             com.liferay.portlet.polls.NoSuchVoteException {
188         return getPersistence().findByChoiceId_First(choiceId, obc);
189     }
190 
191     public static com.liferay.portlet.polls.model.PollsVote findByChoiceId_Last(
192         long choiceId, com.liferay.portal.kernel.util.OrderByComparator obc)
193         throws com.liferay.portal.SystemException,
194             com.liferay.portlet.polls.NoSuchVoteException {
195         return getPersistence().findByChoiceId_Last(choiceId, obc);
196     }
197 
198     public static com.liferay.portlet.polls.model.PollsVote[] findByChoiceId_PrevAndNext(
199         long voteId, long choiceId,
200         com.liferay.portal.kernel.util.OrderByComparator obc)
201         throws com.liferay.portal.SystemException,
202             com.liferay.portlet.polls.NoSuchVoteException {
203         return getPersistence().findByChoiceId_PrevAndNext(voteId, choiceId, obc);
204     }
205 
206     public static com.liferay.portlet.polls.model.PollsVote findByQ_U(
207         long questionId, long userId)
208         throws com.liferay.portal.SystemException,
209             com.liferay.portlet.polls.NoSuchVoteException {
210         return getPersistence().findByQ_U(questionId, userId);
211     }
212 
213     public static com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
214         long questionId, long userId) throws com.liferay.portal.SystemException {
215         return getPersistence().fetchByQ_U(questionId, userId);
216     }
217 
218     public static com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
219         long questionId, long userId, boolean retrieveFromCache)
220         throws com.liferay.portal.SystemException {
221         return getPersistence().fetchByQ_U(questionId, userId, retrieveFromCache);
222     }
223 
224     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll()
225         throws com.liferay.portal.SystemException {
226         return getPersistence().findAll();
227     }
228 
229     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> 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.PollsVote> 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 removeByQuestionId(long questionId)
241         throws com.liferay.portal.SystemException {
242         getPersistence().removeByQuestionId(questionId);
243     }
244 
245     public static void removeByChoiceId(long choiceId)
246         throws com.liferay.portal.SystemException {
247         getPersistence().removeByChoiceId(choiceId);
248     }
249 
250     public static void removeByQ_U(long questionId, long userId)
251         throws com.liferay.portal.SystemException,
252             com.liferay.portlet.polls.NoSuchVoteException {
253         getPersistence().removeByQ_U(questionId, userId);
254     }
255 
256     public static void removeAll() throws com.liferay.portal.SystemException {
257         getPersistence().removeAll();
258     }
259 
260     public static int countByQuestionId(long questionId)
261         throws com.liferay.portal.SystemException {
262         return getPersistence().countByQuestionId(questionId);
263     }
264 
265     public static int countByChoiceId(long choiceId)
266         throws com.liferay.portal.SystemException {
267         return getPersistence().countByChoiceId(choiceId);
268     }
269 
270     public static int countByQ_U(long questionId, long userId)
271         throws com.liferay.portal.SystemException {
272         return getPersistence().countByQ_U(questionId, userId);
273     }
274 
275     public static int countAll() throws com.liferay.portal.SystemException {
276         return getPersistence().countAll();
277     }
278 
279     public static PollsVotePersistence getPersistence() {
280         if (_persistence == null) {
281             _persistence = (PollsVotePersistence)PortalBeanLocatorUtil.locate(PollsVotePersistence.class.getName());
282         }
283 
284         return _persistence;
285     }
286 
287     public void setPersistence(PollsVotePersistence persistence) {
288         _persistence = persistence;
289     }
290 
291     private static PollsVotePersistence _persistence;
292 }