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