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.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.persistence.PollsChoicePersistence;
038 import com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence;
039 import com.liferay.portlet.polls.service.persistence.PollsVotePersistence;
040
041 import java.io.Serializable;
042
043 import java.util.List;
044
045 import javax.sql.DataSource;
046
047
059 public abstract class PollsChoiceLocalServiceBaseImpl
060 extends BaseLocalServiceImpl implements PollsChoiceLocalService,
061 IdentifiableBean {
062
067
068
075 @Indexable(type = IndexableType.REINDEX)
076 @Override
077 public PollsChoice addPollsChoice(PollsChoice pollsChoice)
078 throws SystemException {
079 pollsChoice.setNew(true);
080
081 return pollsChoicePersistence.update(pollsChoice);
082 }
083
084
090 @Override
091 public PollsChoice createPollsChoice(long choiceId) {
092 return pollsChoicePersistence.create(choiceId);
093 }
094
095
103 @Indexable(type = IndexableType.DELETE)
104 @Override
105 public PollsChoice deletePollsChoice(long choiceId)
106 throws PortalException, SystemException {
107 return pollsChoicePersistence.remove(choiceId);
108 }
109
110
117 @Indexable(type = IndexableType.DELETE)
118 @Override
119 public PollsChoice deletePollsChoice(PollsChoice pollsChoice)
120 throws SystemException {
121 return pollsChoicePersistence.remove(pollsChoice);
122 }
123
124 @Override
125 public DynamicQuery dynamicQuery() {
126 Class<?> clazz = getClass();
127
128 return DynamicQueryFactoryUtil.forClass(PollsChoice.class,
129 clazz.getClassLoader());
130 }
131
132
139 @Override
140 @SuppressWarnings("rawtypes")
141 public List dynamicQuery(DynamicQuery dynamicQuery)
142 throws SystemException {
143 return pollsChoicePersistence.findWithDynamicQuery(dynamicQuery);
144 }
145
146
159 @Override
160 @SuppressWarnings("rawtypes")
161 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
162 throws SystemException {
163 return pollsChoicePersistence.findWithDynamicQuery(dynamicQuery, start,
164 end);
165 }
166
167
181 @Override
182 @SuppressWarnings("rawtypes")
183 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
184 OrderByComparator orderByComparator) throws SystemException {
185 return pollsChoicePersistence.findWithDynamicQuery(dynamicQuery, start,
186 end, orderByComparator);
187 }
188
189
196 @Override
197 public long dynamicQueryCount(DynamicQuery dynamicQuery)
198 throws SystemException {
199 return pollsChoicePersistence.countWithDynamicQuery(dynamicQuery);
200 }
201
202
210 @Override
211 public long dynamicQueryCount(DynamicQuery dynamicQuery,
212 Projection projection) throws SystemException {
213 return pollsChoicePersistence.countWithDynamicQuery(dynamicQuery,
214 projection);
215 }
216
217 @Override
218 public PollsChoice fetchPollsChoice(long choiceId)
219 throws SystemException {
220 return pollsChoicePersistence.fetchByPrimaryKey(choiceId);
221 }
222
223
231 @Override
232 public PollsChoice fetchPollsChoiceByUuidAndCompanyId(String uuid,
233 long companyId) throws SystemException {
234 return pollsChoicePersistence.fetchByUuid_C_First(uuid, companyId, null);
235 }
236
237
245 @Override
246 public PollsChoice fetchPollsChoiceByUuidAndGroupId(String uuid,
247 long groupId) throws SystemException {
248 return pollsChoicePersistence.fetchByUUID_G(uuid, groupId);
249 }
250
251
259 @Override
260 public PollsChoice getPollsChoice(long choiceId)
261 throws PortalException, SystemException {
262 return pollsChoicePersistence.findByPrimaryKey(choiceId);
263 }
264
265 @Override
266 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
267 throws PortalException, SystemException {
268 return pollsChoicePersistence.findByPrimaryKey(primaryKeyObj);
269 }
270
271
280 @Override
281 public PollsChoice getPollsChoiceByUuidAndCompanyId(String uuid,
282 long companyId) throws PortalException, SystemException {
283 return pollsChoicePersistence.findByUuid_C_First(uuid, companyId, null);
284 }
285
286
295 @Override
296 public PollsChoice getPollsChoiceByUuidAndGroupId(String uuid, long groupId)
297 throws PortalException, SystemException {
298 return pollsChoicePersistence.findByUUID_G(uuid, groupId);
299 }
300
301
313 @Override
314 public List<PollsChoice> getPollsChoices(int start, int end)
315 throws SystemException {
316 return pollsChoicePersistence.findAll(start, end);
317 }
318
319
325 @Override
326 public int getPollsChoicesCount() throws SystemException {
327 return pollsChoicePersistence.countAll();
328 }
329
330
337 @Indexable(type = IndexableType.REINDEX)
338 @Override
339 public PollsChoice updatePollsChoice(PollsChoice pollsChoice)
340 throws SystemException {
341 return pollsChoicePersistence.update(pollsChoice);
342 }
343
344
349 public com.liferay.portlet.polls.service.PollsChoiceLocalService getPollsChoiceLocalService() {
350 return pollsChoiceLocalService;
351 }
352
353
358 public void setPollsChoiceLocalService(
359 com.liferay.portlet.polls.service.PollsChoiceLocalService pollsChoiceLocalService) {
360 this.pollsChoiceLocalService = pollsChoiceLocalService;
361 }
362
363
368 public com.liferay.portlet.polls.service.PollsChoiceService getPollsChoiceService() {
369 return pollsChoiceService;
370 }
371
372
377 public void setPollsChoiceService(
378 com.liferay.portlet.polls.service.PollsChoiceService pollsChoiceService) {
379 this.pollsChoiceService = pollsChoiceService;
380 }
381
382
387 public PollsChoicePersistence getPollsChoicePersistence() {
388 return pollsChoicePersistence;
389 }
390
391
396 public void setPollsChoicePersistence(
397 PollsChoicePersistence pollsChoicePersistence) {
398 this.pollsChoicePersistence = pollsChoicePersistence;
399 }
400
401
406 public com.liferay.portlet.polls.service.PollsQuestionLocalService getPollsQuestionLocalService() {
407 return pollsQuestionLocalService;
408 }
409
410
415 public void setPollsQuestionLocalService(
416 com.liferay.portlet.polls.service.PollsQuestionLocalService pollsQuestionLocalService) {
417 this.pollsQuestionLocalService = pollsQuestionLocalService;
418 }
419
420
425 public com.liferay.portlet.polls.service.PollsQuestionService getPollsQuestionService() {
426 return pollsQuestionService;
427 }
428
429
434 public void setPollsQuestionService(
435 com.liferay.portlet.polls.service.PollsQuestionService pollsQuestionService) {
436 this.pollsQuestionService = pollsQuestionService;
437 }
438
439
444 public PollsQuestionPersistence getPollsQuestionPersistence() {
445 return pollsQuestionPersistence;
446 }
447
448
453 public void setPollsQuestionPersistence(
454 PollsQuestionPersistence pollsQuestionPersistence) {
455 this.pollsQuestionPersistence = pollsQuestionPersistence;
456 }
457
458
463 public com.liferay.portlet.polls.service.PollsVoteLocalService getPollsVoteLocalService() {
464 return pollsVoteLocalService;
465 }
466
467
472 public void setPollsVoteLocalService(
473 com.liferay.portlet.polls.service.PollsVoteLocalService pollsVoteLocalService) {
474 this.pollsVoteLocalService = pollsVoteLocalService;
475 }
476
477
482 public com.liferay.portlet.polls.service.PollsVoteService getPollsVoteService() {
483 return pollsVoteService;
484 }
485
486
491 public void setPollsVoteService(
492 com.liferay.portlet.polls.service.PollsVoteService pollsVoteService) {
493 this.pollsVoteService = pollsVoteService;
494 }
495
496
501 public PollsVotePersistence getPollsVotePersistence() {
502 return pollsVotePersistence;
503 }
504
505
510 public void setPollsVotePersistence(
511 PollsVotePersistence pollsVotePersistence) {
512 this.pollsVotePersistence = pollsVotePersistence;
513 }
514
515
520 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
521 return counterLocalService;
522 }
523
524
529 public void setCounterLocalService(
530 com.liferay.counter.service.CounterLocalService counterLocalService) {
531 this.counterLocalService = counterLocalService;
532 }
533
534
539 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
540 return resourceLocalService;
541 }
542
543
548 public void setResourceLocalService(
549 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
550 this.resourceLocalService = resourceLocalService;
551 }
552
553
558 public com.liferay.portal.service.UserLocalService getUserLocalService() {
559 return userLocalService;
560 }
561
562
567 public void setUserLocalService(
568 com.liferay.portal.service.UserLocalService userLocalService) {
569 this.userLocalService = userLocalService;
570 }
571
572
577 public com.liferay.portal.service.UserService getUserService() {
578 return userService;
579 }
580
581
586 public void setUserService(
587 com.liferay.portal.service.UserService userService) {
588 this.userService = userService;
589 }
590
591
596 public UserPersistence getUserPersistence() {
597 return userPersistence;
598 }
599
600
605 public void setUserPersistence(UserPersistence userPersistence) {
606 this.userPersistence = userPersistence;
607 }
608
609
614 public UserFinder getUserFinder() {
615 return userFinder;
616 }
617
618
623 public void setUserFinder(UserFinder userFinder) {
624 this.userFinder = userFinder;
625 }
626
627 public void afterPropertiesSet() {
628 persistedModelLocalServiceRegistry.register("com.liferay.portlet.polls.model.PollsChoice",
629 pollsChoiceLocalService);
630 }
631
632 public void destroy() {
633 persistedModelLocalServiceRegistry.unregister(
634 "com.liferay.portlet.polls.model.PollsChoice");
635 }
636
637
642 @Override
643 public String getBeanIdentifier() {
644 return _beanIdentifier;
645 }
646
647
652 @Override
653 public void setBeanIdentifier(String beanIdentifier) {
654 _beanIdentifier = beanIdentifier;
655 }
656
657 protected Class<?> getModelClass() {
658 return PollsChoice.class;
659 }
660
661 protected String getModelClassName() {
662 return PollsChoice.class.getName();
663 }
664
665
670 protected void runSQL(String sql) throws SystemException {
671 try {
672 DataSource dataSource = pollsChoicePersistence.getDataSource();
673
674 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
675 sql, new int[0]);
676
677 sqlUpdate.update();
678 }
679 catch (Exception e) {
680 throw new SystemException(e);
681 }
682 }
683
684 @BeanReference(type = com.liferay.portlet.polls.service.PollsChoiceLocalService.class)
685 protected com.liferay.portlet.polls.service.PollsChoiceLocalService pollsChoiceLocalService;
686 @BeanReference(type = com.liferay.portlet.polls.service.PollsChoiceService.class)
687 protected com.liferay.portlet.polls.service.PollsChoiceService pollsChoiceService;
688 @BeanReference(type = PollsChoicePersistence.class)
689 protected PollsChoicePersistence pollsChoicePersistence;
690 @BeanReference(type = com.liferay.portlet.polls.service.PollsQuestionLocalService.class)
691 protected com.liferay.portlet.polls.service.PollsQuestionLocalService pollsQuestionLocalService;
692 @BeanReference(type = com.liferay.portlet.polls.service.PollsQuestionService.class)
693 protected com.liferay.portlet.polls.service.PollsQuestionService pollsQuestionService;
694 @BeanReference(type = PollsQuestionPersistence.class)
695 protected PollsQuestionPersistence pollsQuestionPersistence;
696 @BeanReference(type = com.liferay.portlet.polls.service.PollsVoteLocalService.class)
697 protected com.liferay.portlet.polls.service.PollsVoteLocalService pollsVoteLocalService;
698 @BeanReference(type = com.liferay.portlet.polls.service.PollsVoteService.class)
699 protected com.liferay.portlet.polls.service.PollsVoteService pollsVoteService;
700 @BeanReference(type = PollsVotePersistence.class)
701 protected PollsVotePersistence pollsVotePersistence;
702 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
703 protected com.liferay.counter.service.CounterLocalService counterLocalService;
704 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
705 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
706 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
707 protected com.liferay.portal.service.UserLocalService userLocalService;
708 @BeanReference(type = com.liferay.portal.service.UserService.class)
709 protected com.liferay.portal.service.UserService userService;
710 @BeanReference(type = UserPersistence.class)
711 protected UserPersistence userPersistence;
712 @BeanReference(type = UserFinder.class)
713 protected UserFinder userFinder;
714 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
715 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
716 private String _beanIdentifier;
717 }