1   /**
2    * Copyright (c) 2000-2008 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.base;
24  
25  import com.liferay.counter.service.CounterLocalService;
26  import com.liferay.counter.service.CounterService;
27  
28  import com.liferay.portal.PortalException;
29  import com.liferay.portal.SystemException;
30  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
31  
32  import com.liferay.portlet.polls.model.PollsVote;
33  import com.liferay.portlet.polls.service.PollsChoiceLocalService;
34  import com.liferay.portlet.polls.service.PollsQuestionLocalService;
35  import com.liferay.portlet.polls.service.PollsQuestionService;
36  import com.liferay.portlet.polls.service.PollsVoteLocalService;
37  import com.liferay.portlet.polls.service.PollsVoteService;
38  import com.liferay.portlet.polls.service.persistence.PollsChoiceFinder;
39  import com.liferay.portlet.polls.service.persistence.PollsChoicePersistence;
40  import com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence;
41  import com.liferay.portlet.polls.service.persistence.PollsVotePersistence;
42  
43  import java.util.List;
44  
45  /**
46   * <a href="PollsVoteLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
47   *
48   * @author Brian Wing Shun Chan
49   *
50   */
51  public abstract class PollsVoteLocalServiceBaseImpl
52      implements PollsVoteLocalService {
53      public PollsVote addPollsVote(PollsVote pollsVote)
54          throws SystemException {
55          pollsVote.setNew(true);
56  
57          return pollsVotePersistence.update(pollsVote, false);
58      }
59  
60      public PollsVote createPollsVote(long voteId) {
61          return pollsVotePersistence.create(voteId);
62      }
63  
64      public void deletePollsVote(long voteId)
65          throws PortalException, SystemException {
66          pollsVotePersistence.remove(voteId);
67      }
68  
69      public void deletePollsVote(PollsVote pollsVote) throws SystemException {
70          pollsVotePersistence.remove(pollsVote);
71      }
72  
73      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
74          throws SystemException {
75          return pollsVotePersistence.findWithDynamicQuery(dynamicQuery);
76      }
77  
78      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
79          int end) throws SystemException {
80          return pollsVotePersistence.findWithDynamicQuery(dynamicQuery, start,
81              end);
82      }
83  
84      public PollsVote getPollsVote(long voteId)
85          throws PortalException, SystemException {
86          return pollsVotePersistence.findByPrimaryKey(voteId);
87      }
88  
89      public List<PollsVote> getPollsVotes(int start, int end)
90          throws SystemException {
91          return pollsVotePersistence.findAll(start, end);
92      }
93  
94      public int getPollsVotesCount() throws SystemException {
95          return pollsVotePersistence.countAll();
96      }
97  
98      public PollsVote updatePollsVote(PollsVote pollsVote)
99          throws SystemException {
100         pollsVote.setNew(false);
101 
102         return pollsVotePersistence.update(pollsVote, true);
103     }
104 
105     public PollsChoiceLocalService getPollsChoiceLocalService() {
106         return pollsChoiceLocalService;
107     }
108 
109     public void setPollsChoiceLocalService(
110         PollsChoiceLocalService pollsChoiceLocalService) {
111         this.pollsChoiceLocalService = pollsChoiceLocalService;
112     }
113 
114     public PollsChoicePersistence getPollsChoicePersistence() {
115         return pollsChoicePersistence;
116     }
117 
118     public void setPollsChoicePersistence(
119         PollsChoicePersistence pollsChoicePersistence) {
120         this.pollsChoicePersistence = pollsChoicePersistence;
121     }
122 
123     public PollsChoiceFinder getPollsChoiceFinder() {
124         return pollsChoiceFinder;
125     }
126 
127     public void setPollsChoiceFinder(PollsChoiceFinder pollsChoiceFinder) {
128         this.pollsChoiceFinder = pollsChoiceFinder;
129     }
130 
131     public PollsQuestionLocalService getPollsQuestionLocalService() {
132         return pollsQuestionLocalService;
133     }
134 
135     public void setPollsQuestionLocalService(
136         PollsQuestionLocalService pollsQuestionLocalService) {
137         this.pollsQuestionLocalService = pollsQuestionLocalService;
138     }
139 
140     public PollsQuestionService getPollsQuestionService() {
141         return pollsQuestionService;
142     }
143 
144     public void setPollsQuestionService(
145         PollsQuestionService pollsQuestionService) {
146         this.pollsQuestionService = pollsQuestionService;
147     }
148 
149     public PollsQuestionPersistence getPollsQuestionPersistence() {
150         return pollsQuestionPersistence;
151     }
152 
153     public void setPollsQuestionPersistence(
154         PollsQuestionPersistence pollsQuestionPersistence) {
155         this.pollsQuestionPersistence = pollsQuestionPersistence;
156     }
157 
158     public PollsVoteLocalService getPollsVoteLocalService() {
159         return pollsVoteLocalService;
160     }
161 
162     public void setPollsVoteLocalService(
163         PollsVoteLocalService pollsVoteLocalService) {
164         this.pollsVoteLocalService = pollsVoteLocalService;
165     }
166 
167     public PollsVoteService getPollsVoteService() {
168         return pollsVoteService;
169     }
170 
171     public void setPollsVoteService(PollsVoteService pollsVoteService) {
172         this.pollsVoteService = pollsVoteService;
173     }
174 
175     public PollsVotePersistence getPollsVotePersistence() {
176         return pollsVotePersistence;
177     }
178 
179     public void setPollsVotePersistence(
180         PollsVotePersistence pollsVotePersistence) {
181         this.pollsVotePersistence = pollsVotePersistence;
182     }
183 
184     public CounterLocalService getCounterLocalService() {
185         return counterLocalService;
186     }
187 
188     public void setCounterLocalService(CounterLocalService counterLocalService) {
189         this.counterLocalService = counterLocalService;
190     }
191 
192     public CounterService getCounterService() {
193         return counterService;
194     }
195 
196     public void setCounterService(CounterService counterService) {
197         this.counterService = counterService;
198     }
199 
200     @javax.annotation.Resource(name = "com.liferay.portlet.polls.service.PollsChoiceLocalService.impl")
201     protected PollsChoiceLocalService pollsChoiceLocalService;
202     @javax.annotation.Resource(name = "com.liferay.portlet.polls.service.persistence.PollsChoicePersistence.impl")
203     protected PollsChoicePersistence pollsChoicePersistence;
204     @javax.annotation.Resource(name = "com.liferay.portlet.polls.service.persistence.PollsChoiceFinder.impl")
205     protected PollsChoiceFinder pollsChoiceFinder;
206     @javax.annotation.Resource(name = "com.liferay.portlet.polls.service.PollsQuestionLocalService.impl")
207     protected PollsQuestionLocalService pollsQuestionLocalService;
208     @javax.annotation.Resource(name = "com.liferay.portlet.polls.service.PollsQuestionService.impl")
209     protected PollsQuestionService pollsQuestionService;
210     @javax.annotation.Resource(name = "com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence.impl")
211     protected PollsQuestionPersistence pollsQuestionPersistence;
212     @javax.annotation.Resource(name = "com.liferay.portlet.polls.service.PollsVoteLocalService.impl")
213     protected PollsVoteLocalService pollsVoteLocalService;
214     @javax.annotation.Resource(name = "com.liferay.portlet.polls.service.PollsVoteService.impl")
215     protected PollsVoteService pollsVoteService;
216     @javax.annotation.Resource(name = "com.liferay.portlet.polls.service.persistence.PollsVotePersistence.impl")
217     protected PollsVotePersistence pollsVotePersistence;
218     @javax.annotation.Resource(name = "com.liferay.counter.service.CounterLocalService.impl")
219     protected CounterLocalService counterLocalService;
220     @javax.annotation.Resource(name = "com.liferay.counter.service.CounterService.impl")
221     protected CounterService counterService;
222 }