001
014
015 package com.liferay.portlet.polls.service.base;
016
017 import com.liferay.portal.kernel.bean.BeanReference;
018 import com.liferay.portal.kernel.bean.IdentifiableBean;
019 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
020 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
021 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
022 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
023 import com.liferay.portal.kernel.dao.orm.Projection;
024 import com.liferay.portal.kernel.exception.PortalException;
025 import com.liferay.portal.kernel.exception.SystemException;
026 import com.liferay.portal.kernel.search.Indexable;
027 import com.liferay.portal.kernel.search.IndexableType;
028 import com.liferay.portal.kernel.util.OrderByComparator;
029 import com.liferay.portal.model.PersistedModel;
030 import com.liferay.portal.service.BaseLocalServiceImpl;
031 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
032 import com.liferay.portal.service.persistence.SystemEventPersistence;
033 import com.liferay.portal.service.persistence.UserFinder;
034 import com.liferay.portal.service.persistence.UserPersistence;
035
036 import com.liferay.portlet.polls.model.PollsQuestion;
037 import com.liferay.portlet.polls.service.PollsQuestionLocalService;
038 import com.liferay.portlet.polls.service.persistence.PollsChoicePersistence;
039 import com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence;
040 import com.liferay.portlet.polls.service.persistence.PollsVotePersistence;
041
042 import java.io.Serializable;
043
044 import java.util.List;
045
046 import javax.sql.DataSource;
047
048
060 public abstract class PollsQuestionLocalServiceBaseImpl
061 extends BaseLocalServiceImpl implements PollsQuestionLocalService,
062 IdentifiableBean {
063
068
069
076 @Indexable(type = IndexableType.REINDEX)
077 @Override
078 public PollsQuestion addPollsQuestion(PollsQuestion pollsQuestion)
079 throws SystemException {
080 pollsQuestion.setNew(true);
081
082 return pollsQuestionPersistence.update(pollsQuestion);
083 }
084
085
091 @Override
092 public PollsQuestion createPollsQuestion(long questionId) {
093 return pollsQuestionPersistence.create(questionId);
094 }
095
096
104 @Indexable(type = IndexableType.DELETE)
105 @Override
106 public PollsQuestion deletePollsQuestion(long questionId)
107 throws PortalException, SystemException {
108 return pollsQuestionPersistence.remove(questionId);
109 }
110
111
118 @Indexable(type = IndexableType.DELETE)
119 @Override
120 public PollsQuestion deletePollsQuestion(PollsQuestion pollsQuestion)
121 throws SystemException {
122 return pollsQuestionPersistence.remove(pollsQuestion);
123 }
124
125 @Override
126 public DynamicQuery dynamicQuery() {
127 Class<?> clazz = getClass();
128
129 return DynamicQueryFactoryUtil.forClass(PollsQuestion.class,
130 clazz.getClassLoader());
131 }
132
133
140 @Override
141 @SuppressWarnings("rawtypes")
142 public List dynamicQuery(DynamicQuery dynamicQuery)
143 throws SystemException {
144 return pollsQuestionPersistence.findWithDynamicQuery(dynamicQuery);
145 }
146
147
160 @Override
161 @SuppressWarnings("rawtypes")
162 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
163 throws SystemException {
164 return pollsQuestionPersistence.findWithDynamicQuery(dynamicQuery,
165 start, end);
166 }
167
168
182 @Override
183 @SuppressWarnings("rawtypes")
184 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
185 OrderByComparator orderByComparator) throws SystemException {
186 return pollsQuestionPersistence.findWithDynamicQuery(dynamicQuery,
187 start, end, orderByComparator);
188 }
189
190
197 @Override
198 public long dynamicQueryCount(DynamicQuery dynamicQuery)
199 throws SystemException {
200 return pollsQuestionPersistence.countWithDynamicQuery(dynamicQuery);
201 }
202
203
211 @Override
212 public long dynamicQueryCount(DynamicQuery dynamicQuery,
213 Projection projection) throws SystemException {
214 return pollsQuestionPersistence.countWithDynamicQuery(dynamicQuery,
215 projection);
216 }
217
218 @Override
219 public PollsQuestion fetchPollsQuestion(long questionId)
220 throws SystemException {
221 return pollsQuestionPersistence.fetchByPrimaryKey(questionId);
222 }
223
224
232 @Override
233 public PollsQuestion fetchPollsQuestionByUuidAndCompanyId(String uuid,
234 long companyId) throws SystemException {
235 return pollsQuestionPersistence.fetchByUuid_C_First(uuid, companyId,
236 null);
237 }
238
239
247 @Override
248 public PollsQuestion fetchPollsQuestionByUuidAndGroupId(String uuid,
249 long groupId) throws SystemException {
250 return pollsQuestionPersistence.fetchByUUID_G(uuid, groupId);
251 }
252
253
261 @Override
262 public PollsQuestion getPollsQuestion(long questionId)
263 throws PortalException, SystemException {
264 return pollsQuestionPersistence.findByPrimaryKey(questionId);
265 }
266
267 @Override
268 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
269 throws PortalException, SystemException {
270 return pollsQuestionPersistence.findByPrimaryKey(primaryKeyObj);
271 }
272
273
282 @Override
283 public PollsQuestion getPollsQuestionByUuidAndCompanyId(String uuid,
284 long companyId) throws PortalException, SystemException {
285 return pollsQuestionPersistence.findByUuid_C_First(uuid, companyId, null);
286 }
287
288
297 @Override
298 public PollsQuestion getPollsQuestionByUuidAndGroupId(String uuid,
299 long groupId) throws PortalException, SystemException {
300 return pollsQuestionPersistence.findByUUID_G(uuid, groupId);
301 }
302
303
315 @Override
316 public List<PollsQuestion> getPollsQuestions(int start, int end)
317 throws SystemException {
318 return pollsQuestionPersistence.findAll(start, end);
319 }
320
321
327 @Override
328 public int getPollsQuestionsCount() throws SystemException {
329 return pollsQuestionPersistence.countAll();
330 }
331
332
339 @Indexable(type = IndexableType.REINDEX)
340 @Override
341 public PollsQuestion updatePollsQuestion(PollsQuestion pollsQuestion)
342 throws SystemException {
343 return pollsQuestionPersistence.update(pollsQuestion);
344 }
345
346
351 public com.liferay.portlet.polls.service.PollsChoiceLocalService getPollsChoiceLocalService() {
352 return pollsChoiceLocalService;
353 }
354
355
360 public void setPollsChoiceLocalService(
361 com.liferay.portlet.polls.service.PollsChoiceLocalService pollsChoiceLocalService) {
362 this.pollsChoiceLocalService = pollsChoiceLocalService;
363 }
364
365
370 public com.liferay.portlet.polls.service.PollsChoiceService getPollsChoiceService() {
371 return pollsChoiceService;
372 }
373
374
379 public void setPollsChoiceService(
380 com.liferay.portlet.polls.service.PollsChoiceService pollsChoiceService) {
381 this.pollsChoiceService = pollsChoiceService;
382 }
383
384
389 public PollsChoicePersistence getPollsChoicePersistence() {
390 return pollsChoicePersistence;
391 }
392
393
398 public void setPollsChoicePersistence(
399 PollsChoicePersistence pollsChoicePersistence) {
400 this.pollsChoicePersistence = pollsChoicePersistence;
401 }
402
403
408 public com.liferay.portlet.polls.service.PollsQuestionLocalService getPollsQuestionLocalService() {
409 return pollsQuestionLocalService;
410 }
411
412
417 public void setPollsQuestionLocalService(
418 com.liferay.portlet.polls.service.PollsQuestionLocalService pollsQuestionLocalService) {
419 this.pollsQuestionLocalService = pollsQuestionLocalService;
420 }
421
422
427 public com.liferay.portlet.polls.service.PollsQuestionService getPollsQuestionService() {
428 return pollsQuestionService;
429 }
430
431
436 public void setPollsQuestionService(
437 com.liferay.portlet.polls.service.PollsQuestionService pollsQuestionService) {
438 this.pollsQuestionService = pollsQuestionService;
439 }
440
441
446 public PollsQuestionPersistence getPollsQuestionPersistence() {
447 return pollsQuestionPersistence;
448 }
449
450
455 public void setPollsQuestionPersistence(
456 PollsQuestionPersistence pollsQuestionPersistence) {
457 this.pollsQuestionPersistence = pollsQuestionPersistence;
458 }
459
460
465 public com.liferay.portlet.polls.service.PollsVoteLocalService getPollsVoteLocalService() {
466 return pollsVoteLocalService;
467 }
468
469
474 public void setPollsVoteLocalService(
475 com.liferay.portlet.polls.service.PollsVoteLocalService pollsVoteLocalService) {
476 this.pollsVoteLocalService = pollsVoteLocalService;
477 }
478
479
484 public com.liferay.portlet.polls.service.PollsVoteService getPollsVoteService() {
485 return pollsVoteService;
486 }
487
488
493 public void setPollsVoteService(
494 com.liferay.portlet.polls.service.PollsVoteService pollsVoteService) {
495 this.pollsVoteService = pollsVoteService;
496 }
497
498
503 public PollsVotePersistence getPollsVotePersistence() {
504 return pollsVotePersistence;
505 }
506
507
512 public void setPollsVotePersistence(
513 PollsVotePersistence pollsVotePersistence) {
514 this.pollsVotePersistence = pollsVotePersistence;
515 }
516
517
522 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
523 return counterLocalService;
524 }
525
526
531 public void setCounterLocalService(
532 com.liferay.counter.service.CounterLocalService counterLocalService) {
533 this.counterLocalService = counterLocalService;
534 }
535
536
541 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
542 return resourceLocalService;
543 }
544
545
550 public void setResourceLocalService(
551 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
552 this.resourceLocalService = resourceLocalService;
553 }
554
555
560 public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
561 return systemEventLocalService;
562 }
563
564
569 public void setSystemEventLocalService(
570 com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
571 this.systemEventLocalService = systemEventLocalService;
572 }
573
574
579 public SystemEventPersistence getSystemEventPersistence() {
580 return systemEventPersistence;
581 }
582
583
588 public void setSystemEventPersistence(
589 SystemEventPersistence systemEventPersistence) {
590 this.systemEventPersistence = systemEventPersistence;
591 }
592
593
598 public com.liferay.portal.service.UserLocalService getUserLocalService() {
599 return userLocalService;
600 }
601
602
607 public void setUserLocalService(
608 com.liferay.portal.service.UserLocalService userLocalService) {
609 this.userLocalService = userLocalService;
610 }
611
612
617 public com.liferay.portal.service.UserService getUserService() {
618 return userService;
619 }
620
621
626 public void setUserService(
627 com.liferay.portal.service.UserService userService) {
628 this.userService = userService;
629 }
630
631
636 public UserPersistence getUserPersistence() {
637 return userPersistence;
638 }
639
640
645 public void setUserPersistence(UserPersistence userPersistence) {
646 this.userPersistence = userPersistence;
647 }
648
649
654 public UserFinder getUserFinder() {
655 return userFinder;
656 }
657
658
663 public void setUserFinder(UserFinder userFinder) {
664 this.userFinder = userFinder;
665 }
666
667 public void afterPropertiesSet() {
668 persistedModelLocalServiceRegistry.register("com.liferay.portlet.polls.model.PollsQuestion",
669 pollsQuestionLocalService);
670 }
671
672 public void destroy() {
673 persistedModelLocalServiceRegistry.unregister(
674 "com.liferay.portlet.polls.model.PollsQuestion");
675 }
676
677
682 @Override
683 public String getBeanIdentifier() {
684 return _beanIdentifier;
685 }
686
687
692 @Override
693 public void setBeanIdentifier(String beanIdentifier) {
694 _beanIdentifier = beanIdentifier;
695 }
696
697 protected Class<?> getModelClass() {
698 return PollsQuestion.class;
699 }
700
701 protected String getModelClassName() {
702 return PollsQuestion.class.getName();
703 }
704
705
710 protected void runSQL(String sql) throws SystemException {
711 try {
712 DataSource dataSource = pollsQuestionPersistence.getDataSource();
713
714 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
715 sql, new int[0]);
716
717 sqlUpdate.update();
718 }
719 catch (Exception e) {
720 throw new SystemException(e);
721 }
722 }
723
724 @BeanReference(type = com.liferay.portlet.polls.service.PollsChoiceLocalService.class)
725 protected com.liferay.portlet.polls.service.PollsChoiceLocalService pollsChoiceLocalService;
726 @BeanReference(type = com.liferay.portlet.polls.service.PollsChoiceService.class)
727 protected com.liferay.portlet.polls.service.PollsChoiceService pollsChoiceService;
728 @BeanReference(type = PollsChoicePersistence.class)
729 protected PollsChoicePersistence pollsChoicePersistence;
730 @BeanReference(type = com.liferay.portlet.polls.service.PollsQuestionLocalService.class)
731 protected com.liferay.portlet.polls.service.PollsQuestionLocalService pollsQuestionLocalService;
732 @BeanReference(type = com.liferay.portlet.polls.service.PollsQuestionService.class)
733 protected com.liferay.portlet.polls.service.PollsQuestionService pollsQuestionService;
734 @BeanReference(type = PollsQuestionPersistence.class)
735 protected PollsQuestionPersistence pollsQuestionPersistence;
736 @BeanReference(type = com.liferay.portlet.polls.service.PollsVoteLocalService.class)
737 protected com.liferay.portlet.polls.service.PollsVoteLocalService pollsVoteLocalService;
738 @BeanReference(type = com.liferay.portlet.polls.service.PollsVoteService.class)
739 protected com.liferay.portlet.polls.service.PollsVoteService pollsVoteService;
740 @BeanReference(type = PollsVotePersistence.class)
741 protected PollsVotePersistence pollsVotePersistence;
742 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
743 protected com.liferay.counter.service.CounterLocalService counterLocalService;
744 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
745 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
746 @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
747 protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
748 @BeanReference(type = SystemEventPersistence.class)
749 protected SystemEventPersistence systemEventPersistence;
750 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
751 protected com.liferay.portal.service.UserLocalService userLocalService;
752 @BeanReference(type = com.liferay.portal.service.UserService.class)
753 protected com.liferay.portal.service.UserService userService;
754 @BeanReference(type = UserPersistence.class)
755 protected UserPersistence userPersistence;
756 @BeanReference(type = UserFinder.class)
757 protected UserFinder userFinder;
758 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
759 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
760 private String _beanIdentifier;
761 }