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