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.PollsVote;
036 import com.liferay.portlet.polls.service.PollsVoteLocalService;
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 PollsVoteLocalServiceBaseImpl extends BaseLocalServiceImpl
060 implements PollsVoteLocalService, IdentifiableBean {
061
066
067
074 @Indexable(type = IndexableType.REINDEX)
075 @Override
076 public PollsVote addPollsVote(PollsVote pollsVote)
077 throws SystemException {
078 pollsVote.setNew(true);
079
080 return pollsVotePersistence.update(pollsVote);
081 }
082
083
089 @Override
090 public PollsVote createPollsVote(long voteId) {
091 return pollsVotePersistence.create(voteId);
092 }
093
094
102 @Indexable(type = IndexableType.DELETE)
103 @Override
104 public PollsVote deletePollsVote(long voteId)
105 throws PortalException, SystemException {
106 return pollsVotePersistence.remove(voteId);
107 }
108
109
116 @Indexable(type = IndexableType.DELETE)
117 @Override
118 public PollsVote deletePollsVote(PollsVote pollsVote)
119 throws SystemException {
120 return pollsVotePersistence.remove(pollsVote);
121 }
122
123 @Override
124 public DynamicQuery dynamicQuery() {
125 Class<?> clazz = getClass();
126
127 return DynamicQueryFactoryUtil.forClass(PollsVote.class,
128 clazz.getClassLoader());
129 }
130
131
138 @Override
139 @SuppressWarnings("rawtypes")
140 public List dynamicQuery(DynamicQuery dynamicQuery)
141 throws SystemException {
142 return pollsVotePersistence.findWithDynamicQuery(dynamicQuery);
143 }
144
145
158 @Override
159 @SuppressWarnings("rawtypes")
160 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
161 throws SystemException {
162 return pollsVotePersistence.findWithDynamicQuery(dynamicQuery, start,
163 end);
164 }
165
166
180 @Override
181 @SuppressWarnings("rawtypes")
182 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
183 OrderByComparator orderByComparator) throws SystemException {
184 return pollsVotePersistence.findWithDynamicQuery(dynamicQuery, start,
185 end, orderByComparator);
186 }
187
188
195 @Override
196 public long dynamicQueryCount(DynamicQuery dynamicQuery)
197 throws SystemException {
198 return pollsVotePersistence.countWithDynamicQuery(dynamicQuery);
199 }
200
201
209 @Override
210 public long dynamicQueryCount(DynamicQuery dynamicQuery,
211 Projection projection) throws SystemException {
212 return pollsVotePersistence.countWithDynamicQuery(dynamicQuery,
213 projection);
214 }
215
216 @Override
217 public PollsVote fetchPollsVote(long voteId) throws SystemException {
218 return pollsVotePersistence.fetchByPrimaryKey(voteId);
219 }
220
221
229 @Override
230 public PollsVote fetchPollsVoteByUuidAndCompanyId(String uuid,
231 long companyId) throws SystemException {
232 return pollsVotePersistence.fetchByUuid_C_First(uuid, companyId, null);
233 }
234
235
243 @Override
244 public PollsVote fetchPollsVoteByUuidAndGroupId(String uuid, long groupId)
245 throws SystemException {
246 return pollsVotePersistence.fetchByUUID_G(uuid, groupId);
247 }
248
249
257 @Override
258 public PollsVote getPollsVote(long voteId)
259 throws PortalException, SystemException {
260 return pollsVotePersistence.findByPrimaryKey(voteId);
261 }
262
263 @Override
264 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
265 throws PortalException, SystemException {
266 return pollsVotePersistence.findByPrimaryKey(primaryKeyObj);
267 }
268
269
278 @Override
279 public PollsVote getPollsVoteByUuidAndCompanyId(String uuid, long companyId)
280 throws PortalException, SystemException {
281 return pollsVotePersistence.findByUuid_C_First(uuid, companyId, null);
282 }
283
284
293 @Override
294 public PollsVote getPollsVoteByUuidAndGroupId(String uuid, long groupId)
295 throws PortalException, SystemException {
296 return pollsVotePersistence.findByUUID_G(uuid, groupId);
297 }
298
299
311 @Override
312 public List<PollsVote> getPollsVotes(int start, int end)
313 throws SystemException {
314 return pollsVotePersistence.findAll(start, end);
315 }
316
317
323 @Override
324 public int getPollsVotesCount() throws SystemException {
325 return pollsVotePersistence.countAll();
326 }
327
328
335 @Indexable(type = IndexableType.REINDEX)
336 @Override
337 public PollsVote updatePollsVote(PollsVote pollsVote)
338 throws SystemException {
339 return pollsVotePersistence.update(pollsVote);
340 }
341
342
347 public com.liferay.portlet.polls.service.PollsChoiceLocalService getPollsChoiceLocalService() {
348 return pollsChoiceLocalService;
349 }
350
351
356 public void setPollsChoiceLocalService(
357 com.liferay.portlet.polls.service.PollsChoiceLocalService pollsChoiceLocalService) {
358 this.pollsChoiceLocalService = pollsChoiceLocalService;
359 }
360
361
366 public com.liferay.portlet.polls.service.PollsChoiceService getPollsChoiceService() {
367 return pollsChoiceService;
368 }
369
370
375 public void setPollsChoiceService(
376 com.liferay.portlet.polls.service.PollsChoiceService pollsChoiceService) {
377 this.pollsChoiceService = pollsChoiceService;
378 }
379
380
385 public PollsChoicePersistence getPollsChoicePersistence() {
386 return pollsChoicePersistence;
387 }
388
389
394 public void setPollsChoicePersistence(
395 PollsChoicePersistence pollsChoicePersistence) {
396 this.pollsChoicePersistence = pollsChoicePersistence;
397 }
398
399
404 public com.liferay.portlet.polls.service.PollsQuestionLocalService getPollsQuestionLocalService() {
405 return pollsQuestionLocalService;
406 }
407
408
413 public void setPollsQuestionLocalService(
414 com.liferay.portlet.polls.service.PollsQuestionLocalService pollsQuestionLocalService) {
415 this.pollsQuestionLocalService = pollsQuestionLocalService;
416 }
417
418
423 public com.liferay.portlet.polls.service.PollsQuestionService getPollsQuestionService() {
424 return pollsQuestionService;
425 }
426
427
432 public void setPollsQuestionService(
433 com.liferay.portlet.polls.service.PollsQuestionService pollsQuestionService) {
434 this.pollsQuestionService = pollsQuestionService;
435 }
436
437
442 public PollsQuestionPersistence getPollsQuestionPersistence() {
443 return pollsQuestionPersistence;
444 }
445
446
451 public void setPollsQuestionPersistence(
452 PollsQuestionPersistence pollsQuestionPersistence) {
453 this.pollsQuestionPersistence = pollsQuestionPersistence;
454 }
455
456
461 public com.liferay.portlet.polls.service.PollsVoteLocalService getPollsVoteLocalService() {
462 return pollsVoteLocalService;
463 }
464
465
470 public void setPollsVoteLocalService(
471 com.liferay.portlet.polls.service.PollsVoteLocalService pollsVoteLocalService) {
472 this.pollsVoteLocalService = pollsVoteLocalService;
473 }
474
475
480 public com.liferay.portlet.polls.service.PollsVoteService getPollsVoteService() {
481 return pollsVoteService;
482 }
483
484
489 public void setPollsVoteService(
490 com.liferay.portlet.polls.service.PollsVoteService pollsVoteService) {
491 this.pollsVoteService = pollsVoteService;
492 }
493
494
499 public PollsVotePersistence getPollsVotePersistence() {
500 return pollsVotePersistence;
501 }
502
503
508 public void setPollsVotePersistence(
509 PollsVotePersistence pollsVotePersistence) {
510 this.pollsVotePersistence = pollsVotePersistence;
511 }
512
513
518 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
519 return counterLocalService;
520 }
521
522
527 public void setCounterLocalService(
528 com.liferay.counter.service.CounterLocalService counterLocalService) {
529 this.counterLocalService = counterLocalService;
530 }
531
532
537 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
538 return resourceLocalService;
539 }
540
541
546 public void setResourceLocalService(
547 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
548 this.resourceLocalService = resourceLocalService;
549 }
550
551
556 public com.liferay.portal.service.UserLocalService getUserLocalService() {
557 return userLocalService;
558 }
559
560
565 public void setUserLocalService(
566 com.liferay.portal.service.UserLocalService userLocalService) {
567 this.userLocalService = userLocalService;
568 }
569
570
575 public com.liferay.portal.service.UserService getUserService() {
576 return userService;
577 }
578
579
584 public void setUserService(
585 com.liferay.portal.service.UserService userService) {
586 this.userService = userService;
587 }
588
589
594 public UserPersistence getUserPersistence() {
595 return userPersistence;
596 }
597
598
603 public void setUserPersistence(UserPersistence userPersistence) {
604 this.userPersistence = userPersistence;
605 }
606
607
612 public UserFinder getUserFinder() {
613 return userFinder;
614 }
615
616
621 public void setUserFinder(UserFinder userFinder) {
622 this.userFinder = userFinder;
623 }
624
625 public void afterPropertiesSet() {
626 persistedModelLocalServiceRegistry.register("com.liferay.portlet.polls.model.PollsVote",
627 pollsVoteLocalService);
628 }
629
630 public void destroy() {
631 persistedModelLocalServiceRegistry.unregister(
632 "com.liferay.portlet.polls.model.PollsVote");
633 }
634
635
640 @Override
641 public String getBeanIdentifier() {
642 return _beanIdentifier;
643 }
644
645
650 @Override
651 public void setBeanIdentifier(String beanIdentifier) {
652 _beanIdentifier = beanIdentifier;
653 }
654
655 protected Class<?> getModelClass() {
656 return PollsVote.class;
657 }
658
659 protected String getModelClassName() {
660 return PollsVote.class.getName();
661 }
662
663
668 protected void runSQL(String sql) throws SystemException {
669 try {
670 DataSource dataSource = pollsVotePersistence.getDataSource();
671
672 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
673 sql, new int[0]);
674
675 sqlUpdate.update();
676 }
677 catch (Exception e) {
678 throw new SystemException(e);
679 }
680 }
681
682 @BeanReference(type = com.liferay.portlet.polls.service.PollsChoiceLocalService.class)
683 protected com.liferay.portlet.polls.service.PollsChoiceLocalService pollsChoiceLocalService;
684 @BeanReference(type = com.liferay.portlet.polls.service.PollsChoiceService.class)
685 protected com.liferay.portlet.polls.service.PollsChoiceService pollsChoiceService;
686 @BeanReference(type = PollsChoicePersistence.class)
687 protected PollsChoicePersistence pollsChoicePersistence;
688 @BeanReference(type = com.liferay.portlet.polls.service.PollsQuestionLocalService.class)
689 protected com.liferay.portlet.polls.service.PollsQuestionLocalService pollsQuestionLocalService;
690 @BeanReference(type = com.liferay.portlet.polls.service.PollsQuestionService.class)
691 protected com.liferay.portlet.polls.service.PollsQuestionService pollsQuestionService;
692 @BeanReference(type = PollsQuestionPersistence.class)
693 protected PollsQuestionPersistence pollsQuestionPersistence;
694 @BeanReference(type = com.liferay.portlet.polls.service.PollsVoteLocalService.class)
695 protected com.liferay.portlet.polls.service.PollsVoteLocalService pollsVoteLocalService;
696 @BeanReference(type = com.liferay.portlet.polls.service.PollsVoteService.class)
697 protected com.liferay.portlet.polls.service.PollsVoteService pollsVoteService;
698 @BeanReference(type = PollsVotePersistence.class)
699 protected PollsVotePersistence pollsVotePersistence;
700 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
701 protected com.liferay.counter.service.CounterLocalService counterLocalService;
702 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
703 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
704 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
705 protected com.liferay.portal.service.UserLocalService userLocalService;
706 @BeanReference(type = com.liferay.portal.service.UserService.class)
707 protected com.liferay.portal.service.UserService userService;
708 @BeanReference(type = UserPersistence.class)
709 protected UserPersistence userPersistence;
710 @BeanReference(type = UserFinder.class)
711 protected UserFinder userFinder;
712 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
713 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
714 private String _beanIdentifier;
715 }