1
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.bean.InitializingBean;
31 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
32 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
33
34 import com.liferay.portlet.polls.model.PollsVote;
35 import com.liferay.portlet.polls.service.PollsChoiceLocalService;
36 import com.liferay.portlet.polls.service.PollsQuestionLocalService;
37 import com.liferay.portlet.polls.service.PollsQuestionService;
38 import com.liferay.portlet.polls.service.PollsVoteLocalService;
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
52 public abstract class PollsVoteLocalServiceBaseImpl
53 implements PollsVoteLocalService, InitializingBean {
54 public PollsVote addPollsVote(PollsVote pollsVote)
55 throws SystemException {
56 pollsVote.setNew(true);
57
58 return pollsVotePersistence.update(pollsVote, false);
59 }
60
61 public void deletePollsVote(long voteId)
62 throws PortalException, SystemException {
63 pollsVotePersistence.remove(voteId);
64 }
65
66 public void deletePollsVote(PollsVote pollsVote) throws SystemException {
67 pollsVotePersistence.remove(pollsVote);
68 }
69
70 public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
71 throws SystemException {
72 return pollsVotePersistence.findWithDynamicQuery(dynamicQuery);
73 }
74
75 public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
76 int end) throws SystemException {
77 return pollsVotePersistence.findWithDynamicQuery(dynamicQuery, start,
78 end);
79 }
80
81 public PollsVote getPollsVote(long voteId)
82 throws PortalException, SystemException {
83 return pollsVotePersistence.findByPrimaryKey(voteId);
84 }
85
86 public List<PollsVote> getPollsVotes(int start, int end)
87 throws SystemException {
88 return pollsVotePersistence.findAll(start, end);
89 }
90
91 public int getPollsVotesCount() throws SystemException {
92 return pollsVotePersistence.countAll();
93 }
94
95 public PollsVote updatePollsVote(PollsVote pollsVote)
96 throws SystemException {
97 pollsVote.setNew(false);
98
99 return pollsVotePersistence.update(pollsVote, true);
100 }
101
102 public PollsChoiceLocalService getPollsChoiceLocalService() {
103 return pollsChoiceLocalService;
104 }
105
106 public void setPollsChoiceLocalService(
107 PollsChoiceLocalService pollsChoiceLocalService) {
108 this.pollsChoiceLocalService = pollsChoiceLocalService;
109 }
110
111 public PollsChoicePersistence getPollsChoicePersistence() {
112 return pollsChoicePersistence;
113 }
114
115 public void setPollsChoicePersistence(
116 PollsChoicePersistence pollsChoicePersistence) {
117 this.pollsChoicePersistence = pollsChoicePersistence;
118 }
119
120 public PollsChoiceFinder getPollsChoiceFinder() {
121 return pollsChoiceFinder;
122 }
123
124 public void setPollsChoiceFinder(PollsChoiceFinder pollsChoiceFinder) {
125 this.pollsChoiceFinder = pollsChoiceFinder;
126 }
127
128 public PollsQuestionLocalService getPollsQuestionLocalService() {
129 return pollsQuestionLocalService;
130 }
131
132 public void setPollsQuestionLocalService(
133 PollsQuestionLocalService pollsQuestionLocalService) {
134 this.pollsQuestionLocalService = pollsQuestionLocalService;
135 }
136
137 public PollsQuestionService getPollsQuestionService() {
138 return pollsQuestionService;
139 }
140
141 public void setPollsQuestionService(
142 PollsQuestionService pollsQuestionService) {
143 this.pollsQuestionService = pollsQuestionService;
144 }
145
146 public PollsQuestionPersistence getPollsQuestionPersistence() {
147 return pollsQuestionPersistence;
148 }
149
150 public void setPollsQuestionPersistence(
151 PollsQuestionPersistence pollsQuestionPersistence) {
152 this.pollsQuestionPersistence = pollsQuestionPersistence;
153 }
154
155 public PollsVotePersistence getPollsVotePersistence() {
156 return pollsVotePersistence;
157 }
158
159 public void setPollsVotePersistence(
160 PollsVotePersistence pollsVotePersistence) {
161 this.pollsVotePersistence = pollsVotePersistence;
162 }
163
164 public CounterLocalService getCounterLocalService() {
165 return counterLocalService;
166 }
167
168 public void setCounterLocalService(CounterLocalService counterLocalService) {
169 this.counterLocalService = counterLocalService;
170 }
171
172 public CounterService getCounterService() {
173 return counterService;
174 }
175
176 public void setCounterService(CounterService counterService) {
177 this.counterService = counterService;
178 }
179
180 public void afterPropertiesSet() {
181 if (pollsChoiceLocalService == null) {
182 pollsChoiceLocalService = (PollsChoiceLocalService)PortalBeanLocatorUtil.locate(PollsChoiceLocalService.class.getName() +
183 ".impl");
184 }
185
186 if (pollsChoicePersistence == null) {
187 pollsChoicePersistence = (PollsChoicePersistence)PortalBeanLocatorUtil.locate(PollsChoicePersistence.class.getName() +
188 ".impl");
189 }
190
191 if (pollsChoiceFinder == null) {
192 pollsChoiceFinder = (PollsChoiceFinder)PortalBeanLocatorUtil.locate(PollsChoiceFinder.class.getName() +
193 ".impl");
194 }
195
196 if (pollsQuestionLocalService == null) {
197 pollsQuestionLocalService = (PollsQuestionLocalService)PortalBeanLocatorUtil.locate(PollsQuestionLocalService.class.getName() +
198 ".impl");
199 }
200
201 if (pollsQuestionService == null) {
202 pollsQuestionService = (PollsQuestionService)PortalBeanLocatorUtil.locate(PollsQuestionService.class.getName() +
203 ".impl");
204 }
205
206 if (pollsQuestionPersistence == null) {
207 pollsQuestionPersistence = (PollsQuestionPersistence)PortalBeanLocatorUtil.locate(PollsQuestionPersistence.class.getName() +
208 ".impl");
209 }
210
211 if (pollsVotePersistence == null) {
212 pollsVotePersistence = (PollsVotePersistence)PortalBeanLocatorUtil.locate(PollsVotePersistence.class.getName() +
213 ".impl");
214 }
215
216 if (counterLocalService == null) {
217 counterLocalService = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName() +
218 ".impl");
219 }
220
221 if (counterService == null) {
222 counterService = (CounterService)PortalBeanLocatorUtil.locate(CounterService.class.getName() +
223 ".impl");
224 }
225 }
226
227 protected PollsChoiceLocalService pollsChoiceLocalService;
228 protected PollsChoicePersistence pollsChoicePersistence;
229 protected PollsChoiceFinder pollsChoiceFinder;
230 protected PollsQuestionLocalService pollsQuestionLocalService;
231 protected PollsQuestionService pollsQuestionService;
232 protected PollsQuestionPersistence pollsQuestionPersistence;
233 protected PollsVotePersistence pollsVotePersistence;
234 protected CounterLocalService counterLocalService;
235 protected CounterService counterService;
236 }