1
22
23 package com.liferay.portlet.polls.service.base;
24
25 import com.liferay.counter.service.CounterLocalService;
26 import com.liferay.counter.service.CounterLocalServiceFactory;
27 import com.liferay.counter.service.CounterService;
28 import com.liferay.counter.service.CounterServiceFactory;
29
30 import com.liferay.portal.SystemException;
31 import com.liferay.portal.kernel.dao.DynamicQueryInitializer;
32
33 import com.liferay.portlet.polls.model.PollsChoice;
34 import com.liferay.portlet.polls.model.impl.PollsChoiceImpl;
35 import com.liferay.portlet.polls.service.PollsChoiceLocalService;
36 import com.liferay.portlet.polls.service.PollsQuestionLocalService;
37 import com.liferay.portlet.polls.service.PollsQuestionLocalServiceFactory;
38 import com.liferay.portlet.polls.service.PollsQuestionService;
39 import com.liferay.portlet.polls.service.PollsQuestionServiceFactory;
40 import com.liferay.portlet.polls.service.PollsVoteLocalService;
41 import com.liferay.portlet.polls.service.PollsVoteLocalServiceFactory;
42 import com.liferay.portlet.polls.service.PollsVoteService;
43 import com.liferay.portlet.polls.service.PollsVoteServiceFactory;
44 import com.liferay.portlet.polls.service.persistence.PollsChoiceFinder;
45 import com.liferay.portlet.polls.service.persistence.PollsChoiceFinderUtil;
46 import com.liferay.portlet.polls.service.persistence.PollsChoicePersistence;
47 import com.liferay.portlet.polls.service.persistence.PollsChoiceUtil;
48 import com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence;
49 import com.liferay.portlet.polls.service.persistence.PollsQuestionUtil;
50 import com.liferay.portlet.polls.service.persistence.PollsVotePersistence;
51 import com.liferay.portlet.polls.service.persistence.PollsVoteUtil;
52
53 import org.springframework.beans.factory.InitializingBean;
54
55 import java.util.List;
56
57
63 public abstract class PollsChoiceLocalServiceBaseImpl
64 implements PollsChoiceLocalService, InitializingBean {
65 public PollsChoice addPollsChoice(PollsChoice model)
66 throws SystemException {
67 PollsChoice pollsChoice = new PollsChoiceImpl();
68
69 pollsChoice.setNew(true);
70
71 pollsChoice.setUuid(model.getUuid());
72 pollsChoice.setChoiceId(model.getChoiceId());
73 pollsChoice.setQuestionId(model.getQuestionId());
74 pollsChoice.setName(model.getName());
75 pollsChoice.setDescription(model.getDescription());
76
77 return pollsChoicePersistence.update(pollsChoice);
78 }
79
80 public List dynamicQuery(DynamicQueryInitializer queryInitializer)
81 throws SystemException {
82 return pollsChoicePersistence.findWithDynamicQuery(queryInitializer);
83 }
84
85 public List dynamicQuery(DynamicQueryInitializer queryInitializer,
86 int begin, int end) throws SystemException {
87 return pollsChoicePersistence.findWithDynamicQuery(queryInitializer,
88 begin, end);
89 }
90
91 public PollsChoice updatePollsChoice(PollsChoice model)
92 throws SystemException {
93 PollsChoice pollsChoice = new PollsChoiceImpl();
94
95 pollsChoice.setNew(false);
96
97 pollsChoice.setUuid(model.getUuid());
98 pollsChoice.setChoiceId(model.getChoiceId());
99 pollsChoice.setQuestionId(model.getQuestionId());
100 pollsChoice.setName(model.getName());
101 pollsChoice.setDescription(model.getDescription());
102
103 return pollsChoicePersistence.update(pollsChoice);
104 }
105
106 public PollsChoicePersistence getPollsChoicePersistence() {
107 return pollsChoicePersistence;
108 }
109
110 public void setPollsChoicePersistence(
111 PollsChoicePersistence pollsChoicePersistence) {
112 this.pollsChoicePersistence = pollsChoicePersistence;
113 }
114
115 public PollsChoiceFinder getPollsChoiceFinder() {
116 return pollsChoiceFinder;
117 }
118
119 public void setPollsChoiceFinder(PollsChoiceFinder pollsChoiceFinder) {
120 this.pollsChoiceFinder = pollsChoiceFinder;
121 }
122
123 public PollsQuestionLocalService getPollsQuestionLocalService() {
124 return pollsQuestionLocalService;
125 }
126
127 public void setPollsQuestionLocalService(
128 PollsQuestionLocalService pollsQuestionLocalService) {
129 this.pollsQuestionLocalService = pollsQuestionLocalService;
130 }
131
132 public PollsQuestionService getPollsQuestionService() {
133 return pollsQuestionService;
134 }
135
136 public void setPollsQuestionService(
137 PollsQuestionService pollsQuestionService) {
138 this.pollsQuestionService = pollsQuestionService;
139 }
140
141 public PollsQuestionPersistence getPollsQuestionPersistence() {
142 return pollsQuestionPersistence;
143 }
144
145 public void setPollsQuestionPersistence(
146 PollsQuestionPersistence pollsQuestionPersistence) {
147 this.pollsQuestionPersistence = pollsQuestionPersistence;
148 }
149
150 public PollsVoteLocalService getPollsVoteLocalService() {
151 return pollsVoteLocalService;
152 }
153
154 public void setPollsVoteLocalService(
155 PollsVoteLocalService pollsVoteLocalService) {
156 this.pollsVoteLocalService = pollsVoteLocalService;
157 }
158
159 public PollsVoteService getPollsVoteService() {
160 return pollsVoteService;
161 }
162
163 public void setPollsVoteService(PollsVoteService pollsVoteService) {
164 this.pollsVoteService = pollsVoteService;
165 }
166
167 public PollsVotePersistence getPollsVotePersistence() {
168 return pollsVotePersistence;
169 }
170
171 public void setPollsVotePersistence(
172 PollsVotePersistence pollsVotePersistence) {
173 this.pollsVotePersistence = pollsVotePersistence;
174 }
175
176 public CounterLocalService getCounterLocalService() {
177 return counterLocalService;
178 }
179
180 public void setCounterLocalService(CounterLocalService counterLocalService) {
181 this.counterLocalService = counterLocalService;
182 }
183
184 public CounterService getCounterService() {
185 return counterService;
186 }
187
188 public void setCounterService(CounterService counterService) {
189 this.counterService = counterService;
190 }
191
192 public void afterPropertiesSet() {
193 if (pollsChoicePersistence == null) {
194 pollsChoicePersistence = PollsChoiceUtil.getPersistence();
195 }
196
197 if (pollsChoiceFinder == null) {
198 pollsChoiceFinder = PollsChoiceFinderUtil.getFinder();
199 }
200
201 if (pollsQuestionLocalService == null) {
202 pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getImpl();
203 }
204
205 if (pollsQuestionService == null) {
206 pollsQuestionService = PollsQuestionServiceFactory.getImpl();
207 }
208
209 if (pollsQuestionPersistence == null) {
210 pollsQuestionPersistence = PollsQuestionUtil.getPersistence();
211 }
212
213 if (pollsVoteLocalService == null) {
214 pollsVoteLocalService = PollsVoteLocalServiceFactory.getImpl();
215 }
216
217 if (pollsVoteService == null) {
218 pollsVoteService = PollsVoteServiceFactory.getImpl();
219 }
220
221 if (pollsVotePersistence == null) {
222 pollsVotePersistence = PollsVoteUtil.getPersistence();
223 }
224
225 if (counterLocalService == null) {
226 counterLocalService = CounterLocalServiceFactory.getImpl();
227 }
228
229 if (counterService == null) {
230 counterService = CounterServiceFactory.getImpl();
231 }
232 }
233
234 protected PollsChoicePersistence pollsChoicePersistence;
235 protected PollsChoiceFinder pollsChoiceFinder;
236 protected PollsQuestionLocalService pollsQuestionLocalService;
237 protected PollsQuestionService pollsQuestionService;
238 protected PollsQuestionPersistence pollsQuestionPersistence;
239 protected PollsVoteLocalService pollsVoteLocalService;
240 protected PollsVoteService pollsVoteService;
241 protected PollsVotePersistence pollsVotePersistence;
242 protected CounterLocalService counterLocalService;
243 protected CounterService counterService;
244 }