1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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  /**
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      public static void cacheResult(
41          com.liferay.portlet.polls.model.PollsVote pollsVote) {
42          getPersistence().cacheResult(pollsVote);
43      }
44  
45      public static void cacheResult(
46          java.util.List<com.liferay.portlet.polls.model.PollsVote> pollsVotes) {
47          getPersistence().cacheResult(pollsVotes);
48      }
49  
50      public static void clearCache() {
51          getPersistence().clearCache();
52      }
53  
54      public static com.liferay.portlet.polls.model.PollsVote create(long voteId) {
55          return getPersistence().create(voteId);
56      }
57  
58      public static com.liferay.portlet.polls.model.PollsVote remove(long voteId)
59          throws com.liferay.portal.SystemException,
60              com.liferay.portlet.polls.NoSuchVoteException {
61          return getPersistence().remove(voteId);
62      }
63  
64      public static com.liferay.portlet.polls.model.PollsVote remove(
65          com.liferay.portlet.polls.model.PollsVote pollsVote)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().remove(pollsVote);
68      }
69  
70      /**
71       * @deprecated Use {@link #update(PollsVote, boolean merge)}.
72       */
73      public static com.liferay.portlet.polls.model.PollsVote update(
74          com.liferay.portlet.polls.model.PollsVote pollsVote)
75          throws com.liferay.portal.SystemException {
76          return getPersistence().update(pollsVote);
77      }
78  
79      /**
80       * Add, update, or merge, the entity. This method also calls the model
81       * listeners to trigger the proper events associated with adding, deleting,
82       * or updating an entity.
83       *
84       * @param  pollsVote the entity to add, update, or merge
85       * @param  merge boolean value for whether to merge the entity. The default
86       *         value is false. Setting merge to true is more expensive and
87       *         should only be true when pollsVote is transient. See
88       *         LEP-5473 for a detailed discussion of this method.
89       * @return the entity that was added, updated, or merged
90       */
91      public static com.liferay.portlet.polls.model.PollsVote update(
92          com.liferay.portlet.polls.model.PollsVote pollsVote, boolean merge)
93          throws com.liferay.portal.SystemException {
94          return getPersistence().update(pollsVote, merge);
95      }
96  
97      public static com.liferay.portlet.polls.model.PollsVote updateImpl(
98          com.liferay.portlet.polls.model.PollsVote pollsVote, boolean merge)
99          throws com.liferay.portal.SystemException {
100         return getPersistence().updateImpl(pollsVote, merge);
101     }
102 
103     public static com.liferay.portlet.polls.model.PollsVote findByPrimaryKey(
104         long voteId)
105         throws com.liferay.portal.SystemException,
106             com.liferay.portlet.polls.NoSuchVoteException {
107         return getPersistence().findByPrimaryKey(voteId);
108     }
109 
110     public static com.liferay.portlet.polls.model.PollsVote fetchByPrimaryKey(
111         long voteId) throws com.liferay.portal.SystemException {
112         return getPersistence().fetchByPrimaryKey(voteId);
113     }
114 
115     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
116         long questionId) throws com.liferay.portal.SystemException {
117         return getPersistence().findByQuestionId(questionId);
118     }
119 
120     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
121         long questionId, int start, int end)
122         throws com.liferay.portal.SystemException {
123         return getPersistence().findByQuestionId(questionId, start, end);
124     }
125 
126     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
127         long questionId, int start, int end,
128         com.liferay.portal.kernel.util.OrderByComparator obc)
129         throws com.liferay.portal.SystemException {
130         return getPersistence().findByQuestionId(questionId, start, end, obc);
131     }
132 
133     public static com.liferay.portlet.polls.model.PollsVote findByQuestionId_First(
134         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
135         throws com.liferay.portal.SystemException,
136             com.liferay.portlet.polls.NoSuchVoteException {
137         return getPersistence().findByQuestionId_First(questionId, obc);
138     }
139 
140     public static com.liferay.portlet.polls.model.PollsVote findByQuestionId_Last(
141         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.SystemException,
143             com.liferay.portlet.polls.NoSuchVoteException {
144         return getPersistence().findByQuestionId_Last(questionId, obc);
145     }
146 
147     public static com.liferay.portlet.polls.model.PollsVote[] findByQuestionId_PrevAndNext(
148         long voteId, long questionId,
149         com.liferay.portal.kernel.util.OrderByComparator obc)
150         throws com.liferay.portal.SystemException,
151             com.liferay.portlet.polls.NoSuchVoteException {
152         return getPersistence()
153                    .findByQuestionId_PrevAndNext(voteId, questionId, obc);
154     }
155 
156     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
157         long choiceId) throws com.liferay.portal.SystemException {
158         return getPersistence().findByChoiceId(choiceId);
159     }
160 
161     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
162         long choiceId, int start, int end)
163         throws com.liferay.portal.SystemException {
164         return getPersistence().findByChoiceId(choiceId, start, end);
165     }
166 
167     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
168         long choiceId, int start, int end,
169         com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws com.liferay.portal.SystemException {
171         return getPersistence().findByChoiceId(choiceId, start, end, obc);
172     }
173 
174     public static com.liferay.portlet.polls.model.PollsVote findByChoiceId_First(
175         long choiceId, com.liferay.portal.kernel.util.OrderByComparator obc)
176         throws com.liferay.portal.SystemException,
177             com.liferay.portlet.polls.NoSuchVoteException {
178         return getPersistence().findByChoiceId_First(choiceId, obc);
179     }
180 
181     public static com.liferay.portlet.polls.model.PollsVote findByChoiceId_Last(
182         long choiceId, com.liferay.portal.kernel.util.OrderByComparator obc)
183         throws com.liferay.portal.SystemException,
184             com.liferay.portlet.polls.NoSuchVoteException {
185         return getPersistence().findByChoiceId_Last(choiceId, obc);
186     }
187 
188     public static com.liferay.portlet.polls.model.PollsVote[] findByChoiceId_PrevAndNext(
189         long voteId, long choiceId,
190         com.liferay.portal.kernel.util.OrderByComparator obc)
191         throws com.liferay.portal.SystemException,
192             com.liferay.portlet.polls.NoSuchVoteException {
193         return getPersistence().findByChoiceId_PrevAndNext(voteId, choiceId, obc);
194     }
195 
196     public static com.liferay.portlet.polls.model.PollsVote findByQ_U(
197         long questionId, long userId)
198         throws com.liferay.portal.SystemException,
199             com.liferay.portlet.polls.NoSuchVoteException {
200         return getPersistence().findByQ_U(questionId, userId);
201     }
202 
203     public static com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
204         long questionId, long userId) throws com.liferay.portal.SystemException {
205         return getPersistence().fetchByQ_U(questionId, userId);
206     }
207 
208     public static com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
209         long questionId, long userId, boolean retrieveFromCache)
210         throws com.liferay.portal.SystemException {
211         return getPersistence().fetchByQ_U(questionId, userId, retrieveFromCache);
212     }
213 
214     public static java.util.List<Object> findWithDynamicQuery(
215         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
216         throws com.liferay.portal.SystemException {
217         return getPersistence().findWithDynamicQuery(dynamicQuery);
218     }
219 
220     public static java.util.List<Object> findWithDynamicQuery(
221         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
222         int end) throws com.liferay.portal.SystemException {
223         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
224     }
225 
226     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll()
227         throws com.liferay.portal.SystemException {
228         return getPersistence().findAll();
229     }
230 
231     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll(
232         int start, int end) throws com.liferay.portal.SystemException {
233         return getPersistence().findAll(start, end);
234     }
235 
236     public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll(
237         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
238         throws com.liferay.portal.SystemException {
239         return getPersistence().findAll(start, end, obc);
240     }
241 
242     public static void removeByQuestionId(long questionId)
243         throws com.liferay.portal.SystemException {
244         getPersistence().removeByQuestionId(questionId);
245     }
246 
247     public static void removeByChoiceId(long choiceId)
248         throws com.liferay.portal.SystemException {
249         getPersistence().removeByChoiceId(choiceId);
250     }
251 
252     public static void removeByQ_U(long questionId, long userId)
253         throws com.liferay.portal.SystemException,
254             com.liferay.portlet.polls.NoSuchVoteException {
255         getPersistence().removeByQ_U(questionId, userId);
256     }
257 
258     public static void removeAll() throws com.liferay.portal.SystemException {
259         getPersistence().removeAll();
260     }
261 
262     public static int countByQuestionId(long questionId)
263         throws com.liferay.portal.SystemException {
264         return getPersistence().countByQuestionId(questionId);
265     }
266 
267     public static int countByChoiceId(long choiceId)
268         throws com.liferay.portal.SystemException {
269         return getPersistence().countByChoiceId(choiceId);
270     }
271 
272     public static int countByQ_U(long questionId, long userId)
273         throws com.liferay.portal.SystemException {
274         return getPersistence().countByQ_U(questionId, userId);
275     }
276 
277     public static int countAll() throws com.liferay.portal.SystemException {
278         return getPersistence().countAll();
279     }
280 
281     public static PollsVotePersistence getPersistence() {
282         return _persistence;
283     }
284 
285     public void setPersistence(PollsVotePersistence persistence) {
286         _persistence = persistence;
287     }
288 
289     private static PollsVotePersistence _persistence;
290 }