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