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