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
236 public List<PollsVote> getPollsVotes(int start, int end)
237 throws SystemException {
238 return pollsVotePersistence.findAll(start, end);
239 }
240
241
247 public int getPollsVotesCount() throws SystemException {
248 return pollsVotePersistence.countAll();
249 }
250
251
258 @Indexable(type = IndexableType.REINDEX)
259 public PollsVote updatePollsVote(PollsVote pollsVote)
260 throws SystemException {
261 return pollsVotePersistence.update(pollsVote);
262 }
263
264
269 public PollsChoiceLocalService getPollsChoiceLocalService() {
270 return pollsChoiceLocalService;
271 }
272
273
278 public void setPollsChoiceLocalService(
279 PollsChoiceLocalService pollsChoiceLocalService) {
280 this.pollsChoiceLocalService = pollsChoiceLocalService;
281 }
282
283
288 public PollsChoiceService getPollsChoiceService() {
289 return pollsChoiceService;
290 }
291
292
297 public void setPollsChoiceService(PollsChoiceService pollsChoiceService) {
298 this.pollsChoiceService = pollsChoiceService;
299 }
300
301
306 public PollsChoicePersistence getPollsChoicePersistence() {
307 return pollsChoicePersistence;
308 }
309
310
315 public void setPollsChoicePersistence(
316 PollsChoicePersistence pollsChoicePersistence) {
317 this.pollsChoicePersistence = pollsChoicePersistence;
318 }
319
320
325 public PollsChoiceFinder getPollsChoiceFinder() {
326 return pollsChoiceFinder;
327 }
328
329
334 public void setPollsChoiceFinder(PollsChoiceFinder pollsChoiceFinder) {
335 this.pollsChoiceFinder = pollsChoiceFinder;
336 }
337
338
343 public PollsQuestionLocalService getPollsQuestionLocalService() {
344 return pollsQuestionLocalService;
345 }
346
347
352 public void setPollsQuestionLocalService(
353 PollsQuestionLocalService pollsQuestionLocalService) {
354 this.pollsQuestionLocalService = pollsQuestionLocalService;
355 }
356
357
362 public PollsQuestionService getPollsQuestionService() {
363 return pollsQuestionService;
364 }
365
366
371 public void setPollsQuestionService(
372 PollsQuestionService pollsQuestionService) {
373 this.pollsQuestionService = pollsQuestionService;
374 }
375
376
381 public PollsQuestionPersistence getPollsQuestionPersistence() {
382 return pollsQuestionPersistence;
383 }
384
385
390 public void setPollsQuestionPersistence(
391 PollsQuestionPersistence pollsQuestionPersistence) {
392 this.pollsQuestionPersistence = pollsQuestionPersistence;
393 }
394
395
400 public PollsVoteLocalService getPollsVoteLocalService() {
401 return pollsVoteLocalService;
402 }
403
404
409 public void setPollsVoteLocalService(
410 PollsVoteLocalService pollsVoteLocalService) {
411 this.pollsVoteLocalService = pollsVoteLocalService;
412 }
413
414
419 public PollsVoteService getPollsVoteService() {
420 return pollsVoteService;
421 }
422
423
428 public void setPollsVoteService(PollsVoteService pollsVoteService) {
429 this.pollsVoteService = pollsVoteService;
430 }
431
432
437 public PollsVotePersistence getPollsVotePersistence() {
438 return pollsVotePersistence;
439 }
440
441
446 public void setPollsVotePersistence(
447 PollsVotePersistence pollsVotePersistence) {
448 this.pollsVotePersistence = pollsVotePersistence;
449 }
450
451
456 public CounterLocalService getCounterLocalService() {
457 return counterLocalService;
458 }
459
460
465 public void setCounterLocalService(CounterLocalService counterLocalService) {
466 this.counterLocalService = counterLocalService;
467 }
468
469
474 public ResourceLocalService getResourceLocalService() {
475 return resourceLocalService;
476 }
477
478
483 public void setResourceLocalService(
484 ResourceLocalService resourceLocalService) {
485 this.resourceLocalService = resourceLocalService;
486 }
487
488
493 public UserLocalService getUserLocalService() {
494 return userLocalService;
495 }
496
497
502 public void setUserLocalService(UserLocalService userLocalService) {
503 this.userLocalService = userLocalService;
504 }
505
506
511 public UserService getUserService() {
512 return userService;
513 }
514
515
520 public void setUserService(UserService userService) {
521 this.userService = userService;
522 }
523
524
529 public UserPersistence getUserPersistence() {
530 return userPersistence;
531 }
532
533
538 public void setUserPersistence(UserPersistence userPersistence) {
539 this.userPersistence = userPersistence;
540 }
541
542
547 public UserFinder getUserFinder() {
548 return userFinder;
549 }
550
551
556 public void setUserFinder(UserFinder userFinder) {
557 this.userFinder = userFinder;
558 }
559
560 public void afterPropertiesSet() {
561 persistedModelLocalServiceRegistry.register("com.liferay.portlet.polls.model.PollsVote",
562 pollsVoteLocalService);
563 }
564
565 public void destroy() {
566 persistedModelLocalServiceRegistry.unregister(
567 "com.liferay.portlet.polls.model.PollsVote");
568 }
569
570
575 public String getBeanIdentifier() {
576 return _beanIdentifier;
577 }
578
579
584 public void setBeanIdentifier(String beanIdentifier) {
585 _beanIdentifier = beanIdentifier;
586 }
587
588 protected Class<?> getModelClass() {
589 return PollsVote.class;
590 }
591
592 protected String getModelClassName() {
593 return PollsVote.class.getName();
594 }
595
596
601 protected void runSQL(String sql) throws SystemException {
602 try {
603 DataSource dataSource = pollsVotePersistence.getDataSource();
604
605 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
606 sql, new int[0]);
607
608 sqlUpdate.update();
609 }
610 catch (Exception e) {
611 throw new SystemException(e);
612 }
613 }
614
615 @BeanReference(type = PollsChoiceLocalService.class)
616 protected PollsChoiceLocalService pollsChoiceLocalService;
617 @BeanReference(type = PollsChoiceService.class)
618 protected PollsChoiceService pollsChoiceService;
619 @BeanReference(type = PollsChoicePersistence.class)
620 protected PollsChoicePersistence pollsChoicePersistence;
621 @BeanReference(type = PollsChoiceFinder.class)
622 protected PollsChoiceFinder pollsChoiceFinder;
623 @BeanReference(type = PollsQuestionLocalService.class)
624 protected PollsQuestionLocalService pollsQuestionLocalService;
625 @BeanReference(type = PollsQuestionService.class)
626 protected PollsQuestionService pollsQuestionService;
627 @BeanReference(type = PollsQuestionPersistence.class)
628 protected PollsQuestionPersistence pollsQuestionPersistence;
629 @BeanReference(type = PollsVoteLocalService.class)
630 protected PollsVoteLocalService pollsVoteLocalService;
631 @BeanReference(type = PollsVoteService.class)
632 protected PollsVoteService pollsVoteService;
633 @BeanReference(type = PollsVotePersistence.class)
634 protected PollsVotePersistence pollsVotePersistence;
635 @BeanReference(type = CounterLocalService.class)
636 protected CounterLocalService counterLocalService;
637 @BeanReference(type = ResourceLocalService.class)
638 protected ResourceLocalService resourceLocalService;
639 @BeanReference(type = UserLocalService.class)
640 protected UserLocalService userLocalService;
641 @BeanReference(type = UserService.class)
642 protected UserService userService;
643 @BeanReference(type = UserPersistence.class)
644 protected UserPersistence userPersistence;
645 @BeanReference(type = UserFinder.class)
646 protected UserFinder userFinder;
647 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
648 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
649 private String _beanIdentifier;
650 }