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.annotation.BeanReference;
020 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
023 import com.liferay.portal.kernel.exception.PortalException;
024 import com.liferay.portal.kernel.exception.SystemException;
025 import com.liferay.portal.kernel.util.OrderByComparator;
026 import com.liferay.portal.service.ResourceLocalService;
027 import com.liferay.portal.service.ResourceService;
028 import com.liferay.portal.service.UserLocalService;
029 import com.liferay.portal.service.UserService;
030 import com.liferay.portal.service.persistence.ResourceFinder;
031 import com.liferay.portal.service.persistence.ResourcePersistence;
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.PollsChoiceLocalService;
037 import com.liferay.portlet.polls.service.PollsQuestionLocalService;
038 import com.liferay.portlet.polls.service.PollsQuestionService;
039 import com.liferay.portlet.polls.service.PollsVoteLocalService;
040 import com.liferay.portlet.polls.service.PollsVoteService;
041 import com.liferay.portlet.polls.service.persistence.PollsChoiceFinder;
042 import com.liferay.portlet.polls.service.persistence.PollsChoicePersistence;
043 import com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence;
044 import com.liferay.portlet.polls.service.persistence.PollsVotePersistence;
045
046 import java.util.List;
047
048 import javax.sql.DataSource;
049
050
066 public abstract class PollsVoteLocalServiceBaseImpl
067 implements PollsVoteLocalService {
068
075 public PollsVote addPollsVote(PollsVote pollsVote)
076 throws SystemException {
077 pollsVote.setNew(true);
078
079 return pollsVotePersistence.update(pollsVote, false);
080 }
081
082
088 public PollsVote createPollsVote(long voteId) {
089 return pollsVotePersistence.create(voteId);
090 }
091
092
099 public void deletePollsVote(long voteId)
100 throws PortalException, SystemException {
101 pollsVotePersistence.remove(voteId);
102 }
103
104
110 public void deletePollsVote(PollsVote pollsVote) throws SystemException {
111 pollsVotePersistence.remove(pollsVote);
112 }
113
114
121 @SuppressWarnings("rawtypes")
122 public List dynamicQuery(DynamicQuery dynamicQuery)
123 throws SystemException {
124 return pollsVotePersistence.findWithDynamicQuery(dynamicQuery);
125 }
126
127
140 @SuppressWarnings("rawtypes")
141 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
142 throws SystemException {
143 return pollsVotePersistence.findWithDynamicQuery(dynamicQuery, start,
144 end);
145 }
146
147
161 @SuppressWarnings("rawtypes")
162 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
163 OrderByComparator orderByComparator) throws SystemException {
164 return pollsVotePersistence.findWithDynamicQuery(dynamicQuery, start,
165 end, orderByComparator);
166 }
167
168
175 public long dynamicQueryCount(DynamicQuery dynamicQuery)
176 throws SystemException {
177 return pollsVotePersistence.countWithDynamicQuery(dynamicQuery);
178 }
179
180
188 public PollsVote getPollsVote(long voteId)
189 throws PortalException, SystemException {
190 return pollsVotePersistence.findByPrimaryKey(voteId);
191 }
192
193
205 public List<PollsVote> getPollsVotes(int start, int end)
206 throws SystemException {
207 return pollsVotePersistence.findAll(start, end);
208 }
209
210
216 public int getPollsVotesCount() throws SystemException {
217 return pollsVotePersistence.countAll();
218 }
219
220
227 public PollsVote updatePollsVote(PollsVote pollsVote)
228 throws SystemException {
229 pollsVote.setNew(false);
230
231 return pollsVotePersistence.update(pollsVote, true);
232 }
233
234
242 public PollsVote updatePollsVote(PollsVote pollsVote, boolean merge)
243 throws SystemException {
244 pollsVote.setNew(false);
245
246 return pollsVotePersistence.update(pollsVote, merge);
247 }
248
249
254 public PollsChoiceLocalService getPollsChoiceLocalService() {
255 return pollsChoiceLocalService;
256 }
257
258
263 public void setPollsChoiceLocalService(
264 PollsChoiceLocalService pollsChoiceLocalService) {
265 this.pollsChoiceLocalService = pollsChoiceLocalService;
266 }
267
268
273 public PollsChoicePersistence getPollsChoicePersistence() {
274 return pollsChoicePersistence;
275 }
276
277
282 public void setPollsChoicePersistence(
283 PollsChoicePersistence pollsChoicePersistence) {
284 this.pollsChoicePersistence = pollsChoicePersistence;
285 }
286
287
292 public PollsChoiceFinder getPollsChoiceFinder() {
293 return pollsChoiceFinder;
294 }
295
296
301 public void setPollsChoiceFinder(PollsChoiceFinder pollsChoiceFinder) {
302 this.pollsChoiceFinder = pollsChoiceFinder;
303 }
304
305
310 public PollsQuestionLocalService getPollsQuestionLocalService() {
311 return pollsQuestionLocalService;
312 }
313
314
319 public void setPollsQuestionLocalService(
320 PollsQuestionLocalService pollsQuestionLocalService) {
321 this.pollsQuestionLocalService = pollsQuestionLocalService;
322 }
323
324
329 public PollsQuestionService getPollsQuestionService() {
330 return pollsQuestionService;
331 }
332
333
338 public void setPollsQuestionService(
339 PollsQuestionService pollsQuestionService) {
340 this.pollsQuestionService = pollsQuestionService;
341 }
342
343
348 public PollsQuestionPersistence getPollsQuestionPersistence() {
349 return pollsQuestionPersistence;
350 }
351
352
357 public void setPollsQuestionPersistence(
358 PollsQuestionPersistence pollsQuestionPersistence) {
359 this.pollsQuestionPersistence = pollsQuestionPersistence;
360 }
361
362
367 public PollsVoteLocalService getPollsVoteLocalService() {
368 return pollsVoteLocalService;
369 }
370
371
376 public void setPollsVoteLocalService(
377 PollsVoteLocalService pollsVoteLocalService) {
378 this.pollsVoteLocalService = pollsVoteLocalService;
379 }
380
381
386 public PollsVoteService getPollsVoteService() {
387 return pollsVoteService;
388 }
389
390
395 public void setPollsVoteService(PollsVoteService pollsVoteService) {
396 this.pollsVoteService = pollsVoteService;
397 }
398
399
404 public PollsVotePersistence getPollsVotePersistence() {
405 return pollsVotePersistence;
406 }
407
408
413 public void setPollsVotePersistence(
414 PollsVotePersistence pollsVotePersistence) {
415 this.pollsVotePersistence = pollsVotePersistence;
416 }
417
418
423 public CounterLocalService getCounterLocalService() {
424 return counterLocalService;
425 }
426
427
432 public void setCounterLocalService(CounterLocalService counterLocalService) {
433 this.counterLocalService = counterLocalService;
434 }
435
436
441 public ResourceLocalService getResourceLocalService() {
442 return resourceLocalService;
443 }
444
445
450 public void setResourceLocalService(
451 ResourceLocalService resourceLocalService) {
452 this.resourceLocalService = resourceLocalService;
453 }
454
455
460 public ResourceService getResourceService() {
461 return resourceService;
462 }
463
464
469 public void setResourceService(ResourceService resourceService) {
470 this.resourceService = resourceService;
471 }
472
473
478 public ResourcePersistence getResourcePersistence() {
479 return resourcePersistence;
480 }
481
482
487 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
488 this.resourcePersistence = resourcePersistence;
489 }
490
491
496 public ResourceFinder getResourceFinder() {
497 return resourceFinder;
498 }
499
500
505 public void setResourceFinder(ResourceFinder resourceFinder) {
506 this.resourceFinder = resourceFinder;
507 }
508
509
514 public UserLocalService getUserLocalService() {
515 return userLocalService;
516 }
517
518
523 public void setUserLocalService(UserLocalService userLocalService) {
524 this.userLocalService = userLocalService;
525 }
526
527
532 public UserService getUserService() {
533 return userService;
534 }
535
536
541 public void setUserService(UserService userService) {
542 this.userService = userService;
543 }
544
545
550 public UserPersistence getUserPersistence() {
551 return userPersistence;
552 }
553
554
559 public void setUserPersistence(UserPersistence userPersistence) {
560 this.userPersistence = userPersistence;
561 }
562
563
568 public UserFinder getUserFinder() {
569 return userFinder;
570 }
571
572
577 public void setUserFinder(UserFinder userFinder) {
578 this.userFinder = userFinder;
579 }
580
581
586 protected void runSQL(String sql) throws SystemException {
587 try {
588 DataSource dataSource = pollsVotePersistence.getDataSource();
589
590 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
591 sql, new int[0]);
592
593 sqlUpdate.update();
594 }
595 catch (Exception e) {
596 throw new SystemException(e);
597 }
598 }
599
600 @BeanReference(type = PollsChoiceLocalService.class)
601 protected PollsChoiceLocalService pollsChoiceLocalService;
602 @BeanReference(type = PollsChoicePersistence.class)
603 protected PollsChoicePersistence pollsChoicePersistence;
604 @BeanReference(type = PollsChoiceFinder.class)
605 protected PollsChoiceFinder pollsChoiceFinder;
606 @BeanReference(type = PollsQuestionLocalService.class)
607 protected PollsQuestionLocalService pollsQuestionLocalService;
608 @BeanReference(type = PollsQuestionService.class)
609 protected PollsQuestionService pollsQuestionService;
610 @BeanReference(type = PollsQuestionPersistence.class)
611 protected PollsQuestionPersistence pollsQuestionPersistence;
612 @BeanReference(type = PollsVoteLocalService.class)
613 protected PollsVoteLocalService pollsVoteLocalService;
614 @BeanReference(type = PollsVoteService.class)
615 protected PollsVoteService pollsVoteService;
616 @BeanReference(type = PollsVotePersistence.class)
617 protected PollsVotePersistence pollsVotePersistence;
618 @BeanReference(type = CounterLocalService.class)
619 protected CounterLocalService counterLocalService;
620 @BeanReference(type = ResourceLocalService.class)
621 protected ResourceLocalService resourceLocalService;
622 @BeanReference(type = ResourceService.class)
623 protected ResourceService resourceService;
624 @BeanReference(type = ResourcePersistence.class)
625 protected ResourcePersistence resourcePersistence;
626 @BeanReference(type = ResourceFinder.class)
627 protected ResourceFinder resourceFinder;
628 @BeanReference(type = UserLocalService.class)
629 protected UserLocalService userLocalService;
630 @BeanReference(type = UserService.class)
631 protected UserService userService;
632 @BeanReference(type = UserPersistence.class)
633 protected UserPersistence userPersistence;
634 @BeanReference(type = UserFinder.class)
635 protected UserFinder userFinder;
636 }