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.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  import com.liferay.counter.service.CounterService;
19  
20  import com.liferay.portal.PortalException;
21  import com.liferay.portal.SystemException;
22  import com.liferay.portal.kernel.annotation.BeanReference;
23  import com.liferay.portal.kernel.dao.db.DB;
24  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
25  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
26  import com.liferay.portal.kernel.util.OrderByComparator;
27  import com.liferay.portal.service.ResourceLocalService;
28  import com.liferay.portal.service.ResourceService;
29  import com.liferay.portal.service.UserLocalService;
30  import com.liferay.portal.service.UserService;
31  import com.liferay.portal.service.persistence.ResourceFinder;
32  import com.liferay.portal.service.persistence.ResourcePersistence;
33  import com.liferay.portal.service.persistence.UserFinder;
34  import com.liferay.portal.service.persistence.UserPersistence;
35  
36  import com.liferay.portlet.polls.model.PollsVote;
37  import com.liferay.portlet.polls.service.PollsChoiceLocalService;
38  import com.liferay.portlet.polls.service.PollsQuestionLocalService;
39  import com.liferay.portlet.polls.service.PollsQuestionService;
40  import com.liferay.portlet.polls.service.PollsVoteLocalService;
41  import com.liferay.portlet.polls.service.PollsVoteService;
42  import com.liferay.portlet.polls.service.persistence.PollsChoiceFinder;
43  import com.liferay.portlet.polls.service.persistence.PollsChoicePersistence;
44  import com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence;
45  import com.liferay.portlet.polls.service.persistence.PollsVotePersistence;
46  
47  import java.util.List;
48  
49  /**
50   * <a href="PollsVoteLocalServiceBaseImpl.java.html"><b><i>View Source</i></b>
51   * </a>
52   *
53   * @author Brian Wing Shun Chan
54   */
55  public abstract class PollsVoteLocalServiceBaseImpl
56      implements PollsVoteLocalService {
57      public PollsVote addPollsVote(PollsVote pollsVote)
58          throws SystemException {
59          pollsVote.setNew(true);
60  
61          return pollsVotePersistence.update(pollsVote, false);
62      }
63  
64      public PollsVote createPollsVote(long voteId) {
65          return pollsVotePersistence.create(voteId);
66      }
67  
68      public void deletePollsVote(long voteId)
69          throws PortalException, SystemException {
70          pollsVotePersistence.remove(voteId);
71      }
72  
73      public void deletePollsVote(PollsVote pollsVote) throws SystemException {
74          pollsVotePersistence.remove(pollsVote);
75      }
76  
77      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
78          throws SystemException {
79          return pollsVotePersistence.findWithDynamicQuery(dynamicQuery);
80      }
81  
82      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
83          int end) throws SystemException {
84          return pollsVotePersistence.findWithDynamicQuery(dynamicQuery, start,
85              end);
86      }
87  
88      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
89          int end, OrderByComparator orderByComparator) throws SystemException {
90          return pollsVotePersistence.findWithDynamicQuery(dynamicQuery, start,
91              end, orderByComparator);
92      }
93  
94      public int dynamicQueryCount(DynamicQuery dynamicQuery)
95          throws SystemException {
96          return pollsVotePersistence.countWithDynamicQuery(dynamicQuery);
97      }
98  
99      public PollsVote getPollsVote(long voteId)
100         throws PortalException, SystemException {
101         return pollsVotePersistence.findByPrimaryKey(voteId);
102     }
103 
104     public List<PollsVote> getPollsVotes(int start, int end)
105         throws SystemException {
106         return pollsVotePersistence.findAll(start, end);
107     }
108 
109     public int getPollsVotesCount() throws SystemException {
110         return pollsVotePersistence.countAll();
111     }
112 
113     public PollsVote updatePollsVote(PollsVote pollsVote)
114         throws SystemException {
115         pollsVote.setNew(false);
116 
117         return pollsVotePersistence.update(pollsVote, true);
118     }
119 
120     public PollsVote updatePollsVote(PollsVote pollsVote, boolean merge)
121         throws SystemException {
122         pollsVote.setNew(false);
123 
124         return pollsVotePersistence.update(pollsVote, merge);
125     }
126 
127     public PollsChoiceLocalService getPollsChoiceLocalService() {
128         return pollsChoiceLocalService;
129     }
130 
131     public void setPollsChoiceLocalService(
132         PollsChoiceLocalService pollsChoiceLocalService) {
133         this.pollsChoiceLocalService = pollsChoiceLocalService;
134     }
135 
136     public PollsChoicePersistence getPollsChoicePersistence() {
137         return pollsChoicePersistence;
138     }
139 
140     public void setPollsChoicePersistence(
141         PollsChoicePersistence pollsChoicePersistence) {
142         this.pollsChoicePersistence = pollsChoicePersistence;
143     }
144 
145     public PollsChoiceFinder getPollsChoiceFinder() {
146         return pollsChoiceFinder;
147     }
148 
149     public void setPollsChoiceFinder(PollsChoiceFinder pollsChoiceFinder) {
150         this.pollsChoiceFinder = pollsChoiceFinder;
151     }
152 
153     public PollsQuestionLocalService getPollsQuestionLocalService() {
154         return pollsQuestionLocalService;
155     }
156 
157     public void setPollsQuestionLocalService(
158         PollsQuestionLocalService pollsQuestionLocalService) {
159         this.pollsQuestionLocalService = pollsQuestionLocalService;
160     }
161 
162     public PollsQuestionService getPollsQuestionService() {
163         return pollsQuestionService;
164     }
165 
166     public void setPollsQuestionService(
167         PollsQuestionService pollsQuestionService) {
168         this.pollsQuestionService = pollsQuestionService;
169     }
170 
171     public PollsQuestionPersistence getPollsQuestionPersistence() {
172         return pollsQuestionPersistence;
173     }
174 
175     public void setPollsQuestionPersistence(
176         PollsQuestionPersistence pollsQuestionPersistence) {
177         this.pollsQuestionPersistence = pollsQuestionPersistence;
178     }
179 
180     public PollsVoteLocalService getPollsVoteLocalService() {
181         return pollsVoteLocalService;
182     }
183 
184     public void setPollsVoteLocalService(
185         PollsVoteLocalService pollsVoteLocalService) {
186         this.pollsVoteLocalService = pollsVoteLocalService;
187     }
188 
189     public PollsVoteService getPollsVoteService() {
190         return pollsVoteService;
191     }
192 
193     public void setPollsVoteService(PollsVoteService pollsVoteService) {
194         this.pollsVoteService = pollsVoteService;
195     }
196 
197     public PollsVotePersistence getPollsVotePersistence() {
198         return pollsVotePersistence;
199     }
200 
201     public void setPollsVotePersistence(
202         PollsVotePersistence pollsVotePersistence) {
203         this.pollsVotePersistence = pollsVotePersistence;
204     }
205 
206     public CounterLocalService getCounterLocalService() {
207         return counterLocalService;
208     }
209 
210     public void setCounterLocalService(CounterLocalService counterLocalService) {
211         this.counterLocalService = counterLocalService;
212     }
213 
214     public CounterService getCounterService() {
215         return counterService;
216     }
217 
218     public void setCounterService(CounterService counterService) {
219         this.counterService = counterService;
220     }
221 
222     public ResourceLocalService getResourceLocalService() {
223         return resourceLocalService;
224     }
225 
226     public void setResourceLocalService(
227         ResourceLocalService resourceLocalService) {
228         this.resourceLocalService = resourceLocalService;
229     }
230 
231     public ResourceService getResourceService() {
232         return resourceService;
233     }
234 
235     public void setResourceService(ResourceService resourceService) {
236         this.resourceService = resourceService;
237     }
238 
239     public ResourcePersistence getResourcePersistence() {
240         return resourcePersistence;
241     }
242 
243     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
244         this.resourcePersistence = resourcePersistence;
245     }
246 
247     public ResourceFinder getResourceFinder() {
248         return resourceFinder;
249     }
250 
251     public void setResourceFinder(ResourceFinder resourceFinder) {
252         this.resourceFinder = resourceFinder;
253     }
254 
255     public UserLocalService getUserLocalService() {
256         return userLocalService;
257     }
258 
259     public void setUserLocalService(UserLocalService userLocalService) {
260         this.userLocalService = userLocalService;
261     }
262 
263     public UserService getUserService() {
264         return userService;
265     }
266 
267     public void setUserService(UserService userService) {
268         this.userService = userService;
269     }
270 
271     public UserPersistence getUserPersistence() {
272         return userPersistence;
273     }
274 
275     public void setUserPersistence(UserPersistence userPersistence) {
276         this.userPersistence = userPersistence;
277     }
278 
279     public UserFinder getUserFinder() {
280         return userFinder;
281     }
282 
283     public void setUserFinder(UserFinder userFinder) {
284         this.userFinder = userFinder;
285     }
286 
287     protected void runSQL(String sql) throws SystemException {
288         try {
289             DB db = DBFactoryUtil.getDB();
290 
291             db.runSQL(sql);
292         }
293         catch (Exception e) {
294             throw new SystemException(e);
295         }
296     }
297 
298     @BeanReference(type = PollsChoiceLocalService.class)
299     protected PollsChoiceLocalService pollsChoiceLocalService;
300     @BeanReference(type = PollsChoicePersistence.class)
301     protected PollsChoicePersistence pollsChoicePersistence;
302     @BeanReference(type = PollsChoiceFinder.class)
303     protected PollsChoiceFinder pollsChoiceFinder;
304     @BeanReference(type = PollsQuestionLocalService.class)
305     protected PollsQuestionLocalService pollsQuestionLocalService;
306     @BeanReference(type = PollsQuestionService.class)
307     protected PollsQuestionService pollsQuestionService;
308     @BeanReference(type = PollsQuestionPersistence.class)
309     protected PollsQuestionPersistence pollsQuestionPersistence;
310     @BeanReference(type = PollsVoteLocalService.class)
311     protected PollsVoteLocalService pollsVoteLocalService;
312     @BeanReference(type = PollsVoteService.class)
313     protected PollsVoteService pollsVoteService;
314     @BeanReference(type = PollsVotePersistence.class)
315     protected PollsVotePersistence pollsVotePersistence;
316     @BeanReference(type = CounterLocalService.class)
317     protected CounterLocalService counterLocalService;
318     @BeanReference(type = CounterService.class)
319     protected CounterService counterService;
320     @BeanReference(type = ResourceLocalService.class)
321     protected ResourceLocalService resourceLocalService;
322     @BeanReference(type = ResourceService.class)
323     protected ResourceService resourceService;
324     @BeanReference(type = ResourcePersistence.class)
325     protected ResourcePersistence resourcePersistence;
326     @BeanReference(type = ResourceFinder.class)
327     protected ResourceFinder resourceFinder;
328     @BeanReference(type = UserLocalService.class)
329     protected UserLocalService userLocalService;
330     @BeanReference(type = UserService.class)
331     protected UserService userService;
332     @BeanReference(type = UserPersistence.class)
333     protected UserPersistence userPersistence;
334     @BeanReference(type = UserFinder.class)
335     protected UserFinder userFinder;
336 }