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