001
014
015 package com.liferay.portlet.polls.service.base;
016
017 import com.liferay.counter.service.CounterLocalService;
018
019 import com.liferay.portal.kernel.annotation.BeanReference;
020 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
023 import com.liferay.portal.kernel.exception.PortalException;
024 import com.liferay.portal.kernel.exception.SystemException;
025 import com.liferay.portal.kernel.util.OrderByComparator;
026 import com.liferay.portal.service.ResourceLocalService;
027 import com.liferay.portal.service.ResourceService;
028 import com.liferay.portal.service.UserLocalService;
029 import com.liferay.portal.service.UserService;
030 import com.liferay.portal.service.persistence.ResourceFinder;
031 import com.liferay.portal.service.persistence.ResourcePersistence;
032 import com.liferay.portal.service.persistence.UserFinder;
033 import com.liferay.portal.service.persistence.UserPersistence;
034
035 import com.liferay.portlet.polls.model.PollsChoice;
036 import com.liferay.portlet.polls.service.PollsChoiceLocalService;
037 import com.liferay.portlet.polls.service.PollsQuestionLocalService;
038 import com.liferay.portlet.polls.service.PollsQuestionService;
039 import com.liferay.portlet.polls.service.PollsVoteLocalService;
040 import com.liferay.portlet.polls.service.PollsVoteService;
041 import com.liferay.portlet.polls.service.persistence.PollsChoiceFinder;
042 import com.liferay.portlet.polls.service.persistence.PollsChoicePersistence;
043 import com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence;
044 import com.liferay.portlet.polls.service.persistence.PollsVotePersistence;
045
046 import java.util.List;
047
048 import javax.sql.DataSource;
049
050
066 public abstract class PollsChoiceLocalServiceBaseImpl
067 implements PollsChoiceLocalService {
068
075 public PollsChoice addPollsChoice(PollsChoice pollsChoice)
076 throws SystemException {
077 pollsChoice.setNew(true);
078
079 return pollsChoicePersistence.update(pollsChoice, false);
080 }
081
082
088 public PollsChoice createPollsChoice(long choiceId) {
089 return pollsChoicePersistence.create(choiceId);
090 }
091
092
099 public void deletePollsChoice(long choiceId)
100 throws PortalException, SystemException {
101 pollsChoicePersistence.remove(choiceId);
102 }
103
104
110 public void deletePollsChoice(PollsChoice pollsChoice)
111 throws SystemException {
112 pollsChoicePersistence.remove(pollsChoice);
113 }
114
115
122 @SuppressWarnings("rawtypes")
123 public List dynamicQuery(DynamicQuery dynamicQuery)
124 throws SystemException {
125 return pollsChoicePersistence.findWithDynamicQuery(dynamicQuery);
126 }
127
128
141 @SuppressWarnings("rawtypes")
142 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
143 throws SystemException {
144 return pollsChoicePersistence.findWithDynamicQuery(dynamicQuery, start,
145 end);
146 }
147
148
162 @SuppressWarnings("rawtypes")
163 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
164 OrderByComparator orderByComparator) throws SystemException {
165 return pollsChoicePersistence.findWithDynamicQuery(dynamicQuery, start,
166 end, orderByComparator);
167 }
168
169
176 public long dynamicQueryCount(DynamicQuery dynamicQuery)
177 throws SystemException {
178 return pollsChoicePersistence.countWithDynamicQuery(dynamicQuery);
179 }
180
181
189 public PollsChoice getPollsChoice(long choiceId)
190 throws PortalException, SystemException {
191 return pollsChoicePersistence.findByPrimaryKey(choiceId);
192 }
193
194
206 public List<PollsChoice> getPollsChoices(int start, int end)
207 throws SystemException {
208 return pollsChoicePersistence.findAll(start, end);
209 }
210
211
217 public int getPollsChoicesCount() throws SystemException {
218 return pollsChoicePersistence.countAll();
219 }
220
221
228 public PollsChoice updatePollsChoice(PollsChoice pollsChoice)
229 throws SystemException {
230 pollsChoice.setNew(false);
231
232 return pollsChoicePersistence.update(pollsChoice, true);
233 }
234
235
243 public PollsChoice updatePollsChoice(PollsChoice pollsChoice, boolean merge)
244 throws SystemException {
245 pollsChoice.setNew(false);
246
247 return pollsChoicePersistence.update(pollsChoice, merge);
248 }
249
250
255 public PollsChoiceLocalService getPollsChoiceLocalService() {
256 return pollsChoiceLocalService;
257 }
258
259
264 public void setPollsChoiceLocalService(
265 PollsChoiceLocalService pollsChoiceLocalService) {
266 this.pollsChoiceLocalService = pollsChoiceLocalService;
267 }
268
269
274 public PollsChoicePersistence getPollsChoicePersistence() {
275 return pollsChoicePersistence;
276 }
277
278
283 public void setPollsChoicePersistence(
284 PollsChoicePersistence pollsChoicePersistence) {
285 this.pollsChoicePersistence = pollsChoicePersistence;
286 }
287
288
293 public PollsChoiceFinder getPollsChoiceFinder() {
294 return pollsChoiceFinder;
295 }
296
297
302 public void setPollsChoiceFinder(PollsChoiceFinder pollsChoiceFinder) {
303 this.pollsChoiceFinder = pollsChoiceFinder;
304 }
305
306
311 public PollsQuestionLocalService getPollsQuestionLocalService() {
312 return pollsQuestionLocalService;
313 }
314
315
320 public void setPollsQuestionLocalService(
321 PollsQuestionLocalService pollsQuestionLocalService) {
322 this.pollsQuestionLocalService = pollsQuestionLocalService;
323 }
324
325
330 public PollsQuestionService getPollsQuestionService() {
331 return pollsQuestionService;
332 }
333
334
339 public void setPollsQuestionService(
340 PollsQuestionService pollsQuestionService) {
341 this.pollsQuestionService = pollsQuestionService;
342 }
343
344
349 public PollsQuestionPersistence getPollsQuestionPersistence() {
350 return pollsQuestionPersistence;
351 }
352
353
358 public void setPollsQuestionPersistence(
359 PollsQuestionPersistence pollsQuestionPersistence) {
360 this.pollsQuestionPersistence = pollsQuestionPersistence;
361 }
362
363
368 public PollsVoteLocalService getPollsVoteLocalService() {
369 return pollsVoteLocalService;
370 }
371
372
377 public void setPollsVoteLocalService(
378 PollsVoteLocalService pollsVoteLocalService) {
379 this.pollsVoteLocalService = pollsVoteLocalService;
380 }
381
382
387 public PollsVoteService getPollsVoteService() {
388 return pollsVoteService;
389 }
390
391
396 public void setPollsVoteService(PollsVoteService pollsVoteService) {
397 this.pollsVoteService = pollsVoteService;
398 }
399
400
405 public PollsVotePersistence getPollsVotePersistence() {
406 return pollsVotePersistence;
407 }
408
409
414 public void setPollsVotePersistence(
415 PollsVotePersistence pollsVotePersistence) {
416 this.pollsVotePersistence = pollsVotePersistence;
417 }
418
419
424 public CounterLocalService getCounterLocalService() {
425 return counterLocalService;
426 }
427
428
433 public void setCounterLocalService(CounterLocalService counterLocalService) {
434 this.counterLocalService = counterLocalService;
435 }
436
437
442 public ResourceLocalService getResourceLocalService() {
443 return resourceLocalService;
444 }
445
446
451 public void setResourceLocalService(
452 ResourceLocalService resourceLocalService) {
453 this.resourceLocalService = resourceLocalService;
454 }
455
456
461 public ResourceService getResourceService() {
462 return resourceService;
463 }
464
465
470 public void setResourceService(ResourceService resourceService) {
471 this.resourceService = resourceService;
472 }
473
474
479 public ResourcePersistence getResourcePersistence() {
480 return resourcePersistence;
481 }
482
483
488 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
489 this.resourcePersistence = resourcePersistence;
490 }
491
492
497 public ResourceFinder getResourceFinder() {
498 return resourceFinder;
499 }
500
501
506 public void setResourceFinder(ResourceFinder resourceFinder) {
507 this.resourceFinder = resourceFinder;
508 }
509
510
515 public UserLocalService getUserLocalService() {
516 return userLocalService;
517 }
518
519
524 public void setUserLocalService(UserLocalService userLocalService) {
525 this.userLocalService = userLocalService;
526 }
527
528
533 public UserService getUserService() {
534 return userService;
535 }
536
537
542 public void setUserService(UserService userService) {
543 this.userService = userService;
544 }
545
546
551 public UserPersistence getUserPersistence() {
552 return userPersistence;
553 }
554
555
560 public void setUserPersistence(UserPersistence userPersistence) {
561 this.userPersistence = userPersistence;
562 }
563
564
569 public UserFinder getUserFinder() {
570 return userFinder;
571 }
572
573
578 public void setUserFinder(UserFinder userFinder) {
579 this.userFinder = userFinder;
580 }
581
582
587 protected void runSQL(String sql) throws SystemException {
588 try {
589 DataSource dataSource = pollsChoicePersistence.getDataSource();
590
591 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
592 sql, new int[0]);
593
594 sqlUpdate.update();
595 }
596 catch (Exception e) {
597 throw new SystemException(e);
598 }
599 }
600
601 @BeanReference(type = PollsChoiceLocalService.class)
602 protected PollsChoiceLocalService pollsChoiceLocalService;
603 @BeanReference(type = PollsChoicePersistence.class)
604 protected PollsChoicePersistence pollsChoicePersistence;
605 @BeanReference(type = PollsChoiceFinder.class)
606 protected PollsChoiceFinder pollsChoiceFinder;
607 @BeanReference(type = PollsQuestionLocalService.class)
608 protected PollsQuestionLocalService pollsQuestionLocalService;
609 @BeanReference(type = PollsQuestionService.class)
610 protected PollsQuestionService pollsQuestionService;
611 @BeanReference(type = PollsQuestionPersistence.class)
612 protected PollsQuestionPersistence pollsQuestionPersistence;
613 @BeanReference(type = PollsVoteLocalService.class)
614 protected PollsVoteLocalService pollsVoteLocalService;
615 @BeanReference(type = PollsVoteService.class)
616 protected PollsVoteService pollsVoteService;
617 @BeanReference(type = PollsVotePersistence.class)
618 protected PollsVotePersistence pollsVotePersistence;
619 @BeanReference(type = CounterLocalService.class)
620 protected CounterLocalService counterLocalService;
621 @BeanReference(type = ResourceLocalService.class)
622 protected ResourceLocalService resourceLocalService;
623 @BeanReference(type = ResourceService.class)
624 protected ResourceService resourceService;
625 @BeanReference(type = ResourcePersistence.class)
626 protected ResourcePersistence resourcePersistence;
627 @BeanReference(type = ResourceFinder.class)
628 protected ResourceFinder resourceFinder;
629 @BeanReference(type = UserLocalService.class)
630 protected UserLocalService userLocalService;
631 @BeanReference(type = UserService.class)
632 protected UserService userService;
633 @BeanReference(type = UserPersistence.class)
634 protected UserPersistence userPersistence;
635 @BeanReference(type = UserFinder.class)
636 protected UserFinder userFinder;
637 }