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.bean.BeanReference;
020 import com.liferay.portal.kernel.bean.IdentifiableBean;
021 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
024 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
025 import com.liferay.portal.kernel.exception.PortalException;
026 import com.liferay.portal.kernel.exception.SystemException;
027 import com.liferay.portal.kernel.search.Indexable;
028 import com.liferay.portal.kernel.search.IndexableType;
029 import com.liferay.portal.kernel.util.OrderByComparator;
030 import com.liferay.portal.model.PersistedModel;
031 import com.liferay.portal.service.BaseLocalServiceImpl;
032 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
033 import com.liferay.portal.service.ResourceLocalService;
034 import com.liferay.portal.service.UserLocalService;
035 import com.liferay.portal.service.UserService;
036 import com.liferay.portal.service.persistence.UserFinder;
037 import com.liferay.portal.service.persistence.UserPersistence;
038
039 import com.liferay.portlet.polls.model.PollsChoice;
040 import com.liferay.portlet.polls.service.PollsChoiceLocalService;
041 import com.liferay.portlet.polls.service.PollsChoiceService;
042 import com.liferay.portlet.polls.service.PollsQuestionLocalService;
043 import com.liferay.portlet.polls.service.PollsQuestionService;
044 import com.liferay.portlet.polls.service.PollsVoteLocalService;
045 import com.liferay.portlet.polls.service.PollsVoteService;
046 import com.liferay.portlet.polls.service.persistence.PollsChoiceFinder;
047 import com.liferay.portlet.polls.service.persistence.PollsChoicePersistence;
048 import com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence;
049 import com.liferay.portlet.polls.service.persistence.PollsVotePersistence;
050
051 import java.io.Serializable;
052
053 import java.util.List;
054
055 import javax.sql.DataSource;
056
057
069 public abstract class PollsChoiceLocalServiceBaseImpl
070 extends BaseLocalServiceImpl implements PollsChoiceLocalService,
071 IdentifiableBean {
072
077
078
085 @Indexable(type = IndexableType.REINDEX)
086 public PollsChoice addPollsChoice(PollsChoice pollsChoice)
087 throws SystemException {
088 pollsChoice.setNew(true);
089
090 return pollsChoicePersistence.update(pollsChoice);
091 }
092
093
099 public PollsChoice createPollsChoice(long choiceId) {
100 return pollsChoicePersistence.create(choiceId);
101 }
102
103
111 @Indexable(type = IndexableType.DELETE)
112 public PollsChoice deletePollsChoice(long choiceId)
113 throws PortalException, SystemException {
114 return pollsChoicePersistence.remove(choiceId);
115 }
116
117
124 @Indexable(type = IndexableType.DELETE)
125 public PollsChoice deletePollsChoice(PollsChoice pollsChoice)
126 throws SystemException {
127 return pollsChoicePersistence.remove(pollsChoice);
128 }
129
130 public DynamicQuery dynamicQuery() {
131 Class<?> clazz = getClass();
132
133 return DynamicQueryFactoryUtil.forClass(PollsChoice.class,
134 clazz.getClassLoader());
135 }
136
137
144 @SuppressWarnings("rawtypes")
145 public List dynamicQuery(DynamicQuery dynamicQuery)
146 throws SystemException {
147 return pollsChoicePersistence.findWithDynamicQuery(dynamicQuery);
148 }
149
150
163 @SuppressWarnings("rawtypes")
164 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
165 throws SystemException {
166 return pollsChoicePersistence.findWithDynamicQuery(dynamicQuery, start,
167 end);
168 }
169
170
184 @SuppressWarnings("rawtypes")
185 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
186 OrderByComparator orderByComparator) throws SystemException {
187 return pollsChoicePersistence.findWithDynamicQuery(dynamicQuery, start,
188 end, orderByComparator);
189 }
190
191
198 public long dynamicQueryCount(DynamicQuery dynamicQuery)
199 throws SystemException {
200 return pollsChoicePersistence.countWithDynamicQuery(dynamicQuery);
201 }
202
203 public PollsChoice fetchPollsChoice(long choiceId)
204 throws SystemException {
205 return pollsChoicePersistence.fetchByPrimaryKey(choiceId);
206 }
207
208
216 public PollsChoice getPollsChoice(long choiceId)
217 throws PortalException, SystemException {
218 return pollsChoicePersistence.findByPrimaryKey(choiceId);
219 }
220
221 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
222 throws PortalException, SystemException {
223 return pollsChoicePersistence.findByPrimaryKey(primaryKeyObj);
224 }
225
226
235 public PollsChoice getPollsChoiceByUuidAndGroupId(String uuid, long groupId)
236 throws PortalException, SystemException {
237 return pollsChoicePersistence.findByUUID_G(uuid, groupId);
238 }
239
240
252 public List<PollsChoice> getPollsChoices(int start, int end)
253 throws SystemException {
254 return pollsChoicePersistence.findAll(start, end);
255 }
256
257
263 public int getPollsChoicesCount() throws SystemException {
264 return pollsChoicePersistence.countAll();
265 }
266
267
274 @Indexable(type = IndexableType.REINDEX)
275 public PollsChoice updatePollsChoice(PollsChoice pollsChoice)
276 throws SystemException {
277 return pollsChoicePersistence.update(pollsChoice);
278 }
279
280
285 public PollsChoiceLocalService getPollsChoiceLocalService() {
286 return pollsChoiceLocalService;
287 }
288
289
294 public void setPollsChoiceLocalService(
295 PollsChoiceLocalService pollsChoiceLocalService) {
296 this.pollsChoiceLocalService = pollsChoiceLocalService;
297 }
298
299
304 public PollsChoiceService getPollsChoiceService() {
305 return pollsChoiceService;
306 }
307
308
313 public void setPollsChoiceService(PollsChoiceService pollsChoiceService) {
314 this.pollsChoiceService = pollsChoiceService;
315 }
316
317
322 public PollsChoicePersistence getPollsChoicePersistence() {
323 return pollsChoicePersistence;
324 }
325
326
331 public void setPollsChoicePersistence(
332 PollsChoicePersistence pollsChoicePersistence) {
333 this.pollsChoicePersistence = pollsChoicePersistence;
334 }
335
336
341 public PollsChoiceFinder getPollsChoiceFinder() {
342 return pollsChoiceFinder;
343 }
344
345
350 public void setPollsChoiceFinder(PollsChoiceFinder pollsChoiceFinder) {
351 this.pollsChoiceFinder = pollsChoiceFinder;
352 }
353
354
359 public PollsQuestionLocalService getPollsQuestionLocalService() {
360 return pollsQuestionLocalService;
361 }
362
363
368 public void setPollsQuestionLocalService(
369 PollsQuestionLocalService pollsQuestionLocalService) {
370 this.pollsQuestionLocalService = pollsQuestionLocalService;
371 }
372
373
378 public PollsQuestionService getPollsQuestionService() {
379 return pollsQuestionService;
380 }
381
382
387 public void setPollsQuestionService(
388 PollsQuestionService pollsQuestionService) {
389 this.pollsQuestionService = pollsQuestionService;
390 }
391
392
397 public PollsQuestionPersistence getPollsQuestionPersistence() {
398 return pollsQuestionPersistence;
399 }
400
401
406 public void setPollsQuestionPersistence(
407 PollsQuestionPersistence pollsQuestionPersistence) {
408 this.pollsQuestionPersistence = pollsQuestionPersistence;
409 }
410
411
416 public PollsVoteLocalService getPollsVoteLocalService() {
417 return pollsVoteLocalService;
418 }
419
420
425 public void setPollsVoteLocalService(
426 PollsVoteLocalService pollsVoteLocalService) {
427 this.pollsVoteLocalService = pollsVoteLocalService;
428 }
429
430
435 public PollsVoteService getPollsVoteService() {
436 return pollsVoteService;
437 }
438
439
444 public void setPollsVoteService(PollsVoteService pollsVoteService) {
445 this.pollsVoteService = pollsVoteService;
446 }
447
448
453 public PollsVotePersistence getPollsVotePersistence() {
454 return pollsVotePersistence;
455 }
456
457
462 public void setPollsVotePersistence(
463 PollsVotePersistence pollsVotePersistence) {
464 this.pollsVotePersistence = pollsVotePersistence;
465 }
466
467
472 public CounterLocalService getCounterLocalService() {
473 return counterLocalService;
474 }
475
476
481 public void setCounterLocalService(CounterLocalService counterLocalService) {
482 this.counterLocalService = counterLocalService;
483 }
484
485
490 public ResourceLocalService getResourceLocalService() {
491 return resourceLocalService;
492 }
493
494
499 public void setResourceLocalService(
500 ResourceLocalService resourceLocalService) {
501 this.resourceLocalService = resourceLocalService;
502 }
503
504
509 public UserLocalService getUserLocalService() {
510 return userLocalService;
511 }
512
513
518 public void setUserLocalService(UserLocalService userLocalService) {
519 this.userLocalService = userLocalService;
520 }
521
522
527 public UserService getUserService() {
528 return userService;
529 }
530
531
536 public void setUserService(UserService userService) {
537 this.userService = userService;
538 }
539
540
545 public UserPersistence getUserPersistence() {
546 return userPersistence;
547 }
548
549
554 public void setUserPersistence(UserPersistence userPersistence) {
555 this.userPersistence = userPersistence;
556 }
557
558
563 public UserFinder getUserFinder() {
564 return userFinder;
565 }
566
567
572 public void setUserFinder(UserFinder userFinder) {
573 this.userFinder = userFinder;
574 }
575
576 public void afterPropertiesSet() {
577 persistedModelLocalServiceRegistry.register("com.liferay.portlet.polls.model.PollsChoice",
578 pollsChoiceLocalService);
579 }
580
581 public void destroy() {
582 persistedModelLocalServiceRegistry.unregister(
583 "com.liferay.portlet.polls.model.PollsChoice");
584 }
585
586
591 public String getBeanIdentifier() {
592 return _beanIdentifier;
593 }
594
595
600 public void setBeanIdentifier(String beanIdentifier) {
601 _beanIdentifier = beanIdentifier;
602 }
603
604 protected Class<?> getModelClass() {
605 return PollsChoice.class;
606 }
607
608 protected String getModelClassName() {
609 return PollsChoice.class.getName();
610 }
611
612
617 protected void runSQL(String sql) throws SystemException {
618 try {
619 DataSource dataSource = pollsChoicePersistence.getDataSource();
620
621 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
622 sql, new int[0]);
623
624 sqlUpdate.update();
625 }
626 catch (Exception e) {
627 throw new SystemException(e);
628 }
629 }
630
631 @BeanReference(type = PollsChoiceLocalService.class)
632 protected PollsChoiceLocalService pollsChoiceLocalService;
633 @BeanReference(type = PollsChoiceService.class)
634 protected PollsChoiceService pollsChoiceService;
635 @BeanReference(type = PollsChoicePersistence.class)
636 protected PollsChoicePersistence pollsChoicePersistence;
637 @BeanReference(type = PollsChoiceFinder.class)
638 protected PollsChoiceFinder pollsChoiceFinder;
639 @BeanReference(type = PollsQuestionLocalService.class)
640 protected PollsQuestionLocalService pollsQuestionLocalService;
641 @BeanReference(type = PollsQuestionService.class)
642 protected PollsQuestionService pollsQuestionService;
643 @BeanReference(type = PollsQuestionPersistence.class)
644 protected PollsQuestionPersistence pollsQuestionPersistence;
645 @BeanReference(type = PollsVoteLocalService.class)
646 protected PollsVoteLocalService pollsVoteLocalService;
647 @BeanReference(type = PollsVoteService.class)
648 protected PollsVoteService pollsVoteService;
649 @BeanReference(type = PollsVotePersistence.class)
650 protected PollsVotePersistence pollsVotePersistence;
651 @BeanReference(type = CounterLocalService.class)
652 protected CounterLocalService counterLocalService;
653 @BeanReference(type = ResourceLocalService.class)
654 protected ResourceLocalService resourceLocalService;
655 @BeanReference(type = UserLocalService.class)
656 protected UserLocalService userLocalService;
657 @BeanReference(type = UserService.class)
658 protected UserService userService;
659 @BeanReference(type = UserPersistence.class)
660 protected UserPersistence userPersistence;
661 @BeanReference(type = UserFinder.class)
662 protected UserFinder userFinder;
663 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
664 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
665 private String _beanIdentifier;
666 }