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