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.PollsVote;
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 PollsVoteLocalServiceBaseImpl extends BaseLocalServiceImpl
070 implements PollsVoteLocalService, IdentifiableBean {
071
076
077
084 @Indexable(type = IndexableType.REINDEX)
085 public PollsVote addPollsVote(PollsVote pollsVote)
086 throws SystemException {
087 pollsVote.setNew(true);
088
089 return pollsVotePersistence.update(pollsVote);
090 }
091
092
098 public PollsVote createPollsVote(long voteId) {
099 return pollsVotePersistence.create(voteId);
100 }
101
102
110 @Indexable(type = IndexableType.DELETE)
111 public PollsVote deletePollsVote(long voteId)
112 throws PortalException, SystemException {
113 return pollsVotePersistence.remove(voteId);
114 }
115
116
123 @Indexable(type = IndexableType.DELETE)
124 public PollsVote deletePollsVote(PollsVote pollsVote)
125 throws SystemException {
126 return pollsVotePersistence.remove(pollsVote);
127 }
128
129 public DynamicQuery dynamicQuery() {
130 Class<?> clazz = getClass();
131
132 return DynamicQueryFactoryUtil.forClass(PollsVote.class,
133 clazz.getClassLoader());
134 }
135
136
143 @SuppressWarnings("rawtypes")
144 public List dynamicQuery(DynamicQuery dynamicQuery)
145 throws SystemException {
146 return pollsVotePersistence.findWithDynamicQuery(dynamicQuery);
147 }
148
149
162 @SuppressWarnings("rawtypes")
163 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
164 throws SystemException {
165 return pollsVotePersistence.findWithDynamicQuery(dynamicQuery, start,
166 end);
167 }
168
169
183 @SuppressWarnings("rawtypes")
184 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
185 OrderByComparator orderByComparator) throws SystemException {
186 return pollsVotePersistence.findWithDynamicQuery(dynamicQuery, start,
187 end, orderByComparator);
188 }
189
190
197 public long dynamicQueryCount(DynamicQuery dynamicQuery)
198 throws SystemException {
199 return pollsVotePersistence.countWithDynamicQuery(dynamicQuery);
200 }
201
202 public PollsVote fetchPollsVote(long voteId) throws SystemException {
203 return pollsVotePersistence.fetchByPrimaryKey(voteId);
204 }
205
206
214 public PollsVote getPollsVote(long voteId)
215 throws PortalException, SystemException {
216 return pollsVotePersistence.findByPrimaryKey(voteId);
217 }
218
219 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
220 throws PortalException, SystemException {
221 return pollsVotePersistence.findByPrimaryKey(primaryKeyObj);
222 }
223
224
233 public PollsVote getPollsVoteByUuidAndGroupId(String uuid, long groupId)
234 throws PortalException, SystemException {
235 return pollsVotePersistence.findByUUID_G(uuid, groupId);
236 }
237
238
250 public List<PollsVote> getPollsVotes(int start, int end)
251 throws SystemException {
252 return pollsVotePersistence.findAll(start, end);
253 }
254
255
261 public int getPollsVotesCount() throws SystemException {
262 return pollsVotePersistence.countAll();
263 }
264
265
272 @Indexable(type = IndexableType.REINDEX)
273 public PollsVote updatePollsVote(PollsVote pollsVote)
274 throws SystemException {
275 return pollsVotePersistence.update(pollsVote);
276 }
277
278
283 public PollsChoiceLocalService getPollsChoiceLocalService() {
284 return pollsChoiceLocalService;
285 }
286
287
292 public void setPollsChoiceLocalService(
293 PollsChoiceLocalService pollsChoiceLocalService) {
294 this.pollsChoiceLocalService = pollsChoiceLocalService;
295 }
296
297
302 public PollsChoiceService getPollsChoiceService() {
303 return pollsChoiceService;
304 }
305
306
311 public void setPollsChoiceService(PollsChoiceService pollsChoiceService) {
312 this.pollsChoiceService = pollsChoiceService;
313 }
314
315
320 public PollsChoicePersistence getPollsChoicePersistence() {
321 return pollsChoicePersistence;
322 }
323
324
329 public void setPollsChoicePersistence(
330 PollsChoicePersistence pollsChoicePersistence) {
331 this.pollsChoicePersistence = pollsChoicePersistence;
332 }
333
334
339 public PollsChoiceFinder getPollsChoiceFinder() {
340 return pollsChoiceFinder;
341 }
342
343
348 public void setPollsChoiceFinder(PollsChoiceFinder pollsChoiceFinder) {
349 this.pollsChoiceFinder = pollsChoiceFinder;
350 }
351
352
357 public PollsQuestionLocalService getPollsQuestionLocalService() {
358 return pollsQuestionLocalService;
359 }
360
361
366 public void setPollsQuestionLocalService(
367 PollsQuestionLocalService pollsQuestionLocalService) {
368 this.pollsQuestionLocalService = pollsQuestionLocalService;
369 }
370
371
376 public PollsQuestionService getPollsQuestionService() {
377 return pollsQuestionService;
378 }
379
380
385 public void setPollsQuestionService(
386 PollsQuestionService pollsQuestionService) {
387 this.pollsQuestionService = pollsQuestionService;
388 }
389
390
395 public PollsQuestionPersistence getPollsQuestionPersistence() {
396 return pollsQuestionPersistence;
397 }
398
399
404 public void setPollsQuestionPersistence(
405 PollsQuestionPersistence pollsQuestionPersistence) {
406 this.pollsQuestionPersistence = pollsQuestionPersistence;
407 }
408
409
414 public PollsVoteLocalService getPollsVoteLocalService() {
415 return pollsVoteLocalService;
416 }
417
418
423 public void setPollsVoteLocalService(
424 PollsVoteLocalService pollsVoteLocalService) {
425 this.pollsVoteLocalService = pollsVoteLocalService;
426 }
427
428
433 public PollsVoteService getPollsVoteService() {
434 return pollsVoteService;
435 }
436
437
442 public void setPollsVoteService(PollsVoteService pollsVoteService) {
443 this.pollsVoteService = pollsVoteService;
444 }
445
446
451 public PollsVotePersistence getPollsVotePersistence() {
452 return pollsVotePersistence;
453 }
454
455
460 public void setPollsVotePersistence(
461 PollsVotePersistence pollsVotePersistence) {
462 this.pollsVotePersistence = pollsVotePersistence;
463 }
464
465
470 public CounterLocalService getCounterLocalService() {
471 return counterLocalService;
472 }
473
474
479 public void setCounterLocalService(CounterLocalService counterLocalService) {
480 this.counterLocalService = counterLocalService;
481 }
482
483
488 public ResourceLocalService getResourceLocalService() {
489 return resourceLocalService;
490 }
491
492
497 public void setResourceLocalService(
498 ResourceLocalService resourceLocalService) {
499 this.resourceLocalService = resourceLocalService;
500 }
501
502
507 public UserLocalService getUserLocalService() {
508 return userLocalService;
509 }
510
511
516 public void setUserLocalService(UserLocalService userLocalService) {
517 this.userLocalService = userLocalService;
518 }
519
520
525 public UserService getUserService() {
526 return userService;
527 }
528
529
534 public void setUserService(UserService userService) {
535 this.userService = userService;
536 }
537
538
543 public UserPersistence getUserPersistence() {
544 return userPersistence;
545 }
546
547
552 public void setUserPersistence(UserPersistence userPersistence) {
553 this.userPersistence = userPersistence;
554 }
555
556
561 public UserFinder getUserFinder() {
562 return userFinder;
563 }
564
565
570 public void setUserFinder(UserFinder userFinder) {
571 this.userFinder = userFinder;
572 }
573
574 public void afterPropertiesSet() {
575 persistedModelLocalServiceRegistry.register("com.liferay.portlet.polls.model.PollsVote",
576 pollsVoteLocalService);
577 }
578
579 public void destroy() {
580 persistedModelLocalServiceRegistry.unregister(
581 "com.liferay.portlet.polls.model.PollsVote");
582 }
583
584
589 public String getBeanIdentifier() {
590 return _beanIdentifier;
591 }
592
593
598 public void setBeanIdentifier(String beanIdentifier) {
599 _beanIdentifier = beanIdentifier;
600 }
601
602 protected Class<?> getModelClass() {
603 return PollsVote.class;
604 }
605
606 protected String getModelClassName() {
607 return PollsVote.class.getName();
608 }
609
610
615 protected void runSQL(String sql) throws SystemException {
616 try {
617 DataSource dataSource = pollsVotePersistence.getDataSource();
618
619 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
620 sql, new int[0]);
621
622 sqlUpdate.update();
623 }
624 catch (Exception e) {
625 throw new SystemException(e);
626 }
627 }
628
629 @BeanReference(type = PollsChoiceLocalService.class)
630 protected PollsChoiceLocalService pollsChoiceLocalService;
631 @BeanReference(type = PollsChoiceService.class)
632 protected PollsChoiceService pollsChoiceService;
633 @BeanReference(type = PollsChoicePersistence.class)
634 protected PollsChoicePersistence pollsChoicePersistence;
635 @BeanReference(type = PollsChoiceFinder.class)
636 protected PollsChoiceFinder pollsChoiceFinder;
637 @BeanReference(type = PollsQuestionLocalService.class)
638 protected PollsQuestionLocalService pollsQuestionLocalService;
639 @BeanReference(type = PollsQuestionService.class)
640 protected PollsQuestionService pollsQuestionService;
641 @BeanReference(type = PollsQuestionPersistence.class)
642 protected PollsQuestionPersistence pollsQuestionPersistence;
643 @BeanReference(type = PollsVoteLocalService.class)
644 protected PollsVoteLocalService pollsVoteLocalService;
645 @BeanReference(type = PollsVoteService.class)
646 protected PollsVoteService pollsVoteService;
647 @BeanReference(type = PollsVotePersistence.class)
648 protected PollsVotePersistence pollsVotePersistence;
649 @BeanReference(type = CounterLocalService.class)
650 protected CounterLocalService counterLocalService;
651 @BeanReference(type = ResourceLocalService.class)
652 protected ResourceLocalService resourceLocalService;
653 @BeanReference(type = UserLocalService.class)
654 protected UserLocalService userLocalService;
655 @BeanReference(type = UserService.class)
656 protected UserService userService;
657 @BeanReference(type = UserPersistence.class)
658 protected UserPersistence userPersistence;
659 @BeanReference(type = UserFinder.class)
660 protected UserFinder userFinder;
661 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
662 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
663 private String _beanIdentifier;
664 }