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.PollsQuestion;
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 PollsQuestionLocalServiceBaseImpl
067 implements PollsQuestionLocalService {
068
075 public PollsQuestion addPollsQuestion(PollsQuestion pollsQuestion)
076 throws SystemException {
077 pollsQuestion.setNew(true);
078
079 return pollsQuestionPersistence.update(pollsQuestion, false);
080 }
081
082
088 public PollsQuestion createPollsQuestion(long questionId) {
089 return pollsQuestionPersistence.create(questionId);
090 }
091
092
099 public void deletePollsQuestion(long questionId)
100 throws PortalException, SystemException {
101 pollsQuestionPersistence.remove(questionId);
102 }
103
104
110 public void deletePollsQuestion(PollsQuestion pollsQuestion)
111 throws SystemException {
112 pollsQuestionPersistence.remove(pollsQuestion);
113 }
114
115
122 @SuppressWarnings("rawtypes")
123 public List dynamicQuery(DynamicQuery dynamicQuery)
124 throws SystemException {
125 return pollsQuestionPersistence.findWithDynamicQuery(dynamicQuery);
126 }
127
128
141 @SuppressWarnings("rawtypes")
142 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
143 throws SystemException {
144 return pollsQuestionPersistence.findWithDynamicQuery(dynamicQuery,
145 start, end);
146 }
147
148
162 @SuppressWarnings("rawtypes")
163 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
164 OrderByComparator orderByComparator) throws SystemException {
165 return pollsQuestionPersistence.findWithDynamicQuery(dynamicQuery,
166 start, end, orderByComparator);
167 }
168
169
176 public long dynamicQueryCount(DynamicQuery dynamicQuery)
177 throws SystemException {
178 return pollsQuestionPersistence.countWithDynamicQuery(dynamicQuery);
179 }
180
181
189 public PollsQuestion getPollsQuestion(long questionId)
190 throws PortalException, SystemException {
191 return pollsQuestionPersistence.findByPrimaryKey(questionId);
192 }
193
194
203 public PollsQuestion getPollsQuestionByUuidAndGroupId(String uuid,
204 long groupId) throws PortalException, SystemException {
205 return pollsQuestionPersistence.findByUUID_G(uuid, groupId);
206 }
207
208
220 public List<PollsQuestion> getPollsQuestions(int start, int end)
221 throws SystemException {
222 return pollsQuestionPersistence.findAll(start, end);
223 }
224
225
231 public int getPollsQuestionsCount() throws SystemException {
232 return pollsQuestionPersistence.countAll();
233 }
234
235
242 public PollsQuestion updatePollsQuestion(PollsQuestion pollsQuestion)
243 throws SystemException {
244 pollsQuestion.setNew(false);
245
246 return pollsQuestionPersistence.update(pollsQuestion, true);
247 }
248
249
257 public PollsQuestion updatePollsQuestion(PollsQuestion pollsQuestion,
258 boolean merge) throws SystemException {
259 pollsQuestion.setNew(false);
260
261 return pollsQuestionPersistence.update(pollsQuestion, merge);
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 PollsChoicePersistence getPollsChoicePersistence() {
289 return pollsChoicePersistence;
290 }
291
292
297 public void setPollsChoicePersistence(
298 PollsChoicePersistence pollsChoicePersistence) {
299 this.pollsChoicePersistence = pollsChoicePersistence;
300 }
301
302
307 public PollsChoiceFinder getPollsChoiceFinder() {
308 return pollsChoiceFinder;
309 }
310
311
316 public void setPollsChoiceFinder(PollsChoiceFinder pollsChoiceFinder) {
317 this.pollsChoiceFinder = pollsChoiceFinder;
318 }
319
320
325 public PollsQuestionLocalService getPollsQuestionLocalService() {
326 return pollsQuestionLocalService;
327 }
328
329
334 public void setPollsQuestionLocalService(
335 PollsQuestionLocalService pollsQuestionLocalService) {
336 this.pollsQuestionLocalService = pollsQuestionLocalService;
337 }
338
339
344 public PollsQuestionService getPollsQuestionService() {
345 return pollsQuestionService;
346 }
347
348
353 public void setPollsQuestionService(
354 PollsQuestionService pollsQuestionService) {
355 this.pollsQuestionService = pollsQuestionService;
356 }
357
358
363 public PollsQuestionPersistence getPollsQuestionPersistence() {
364 return pollsQuestionPersistence;
365 }
366
367
372 public void setPollsQuestionPersistence(
373 PollsQuestionPersistence pollsQuestionPersistence) {
374 this.pollsQuestionPersistence = pollsQuestionPersistence;
375 }
376
377
382 public PollsVoteLocalService getPollsVoteLocalService() {
383 return pollsVoteLocalService;
384 }
385
386
391 public void setPollsVoteLocalService(
392 PollsVoteLocalService pollsVoteLocalService) {
393 this.pollsVoteLocalService = pollsVoteLocalService;
394 }
395
396
401 public PollsVoteService getPollsVoteService() {
402 return pollsVoteService;
403 }
404
405
410 public void setPollsVoteService(PollsVoteService pollsVoteService) {
411 this.pollsVoteService = pollsVoteService;
412 }
413
414
419 public PollsVotePersistence getPollsVotePersistence() {
420 return pollsVotePersistence;
421 }
422
423
428 public void setPollsVotePersistence(
429 PollsVotePersistence pollsVotePersistence) {
430 this.pollsVotePersistence = pollsVotePersistence;
431 }
432
433
438 public CounterLocalService getCounterLocalService() {
439 return counterLocalService;
440 }
441
442
447 public void setCounterLocalService(CounterLocalService counterLocalService) {
448 this.counterLocalService = counterLocalService;
449 }
450
451
456 public ResourceLocalService getResourceLocalService() {
457 return resourceLocalService;
458 }
459
460
465 public void setResourceLocalService(
466 ResourceLocalService resourceLocalService) {
467 this.resourceLocalService = resourceLocalService;
468 }
469
470
475 public ResourceService getResourceService() {
476 return resourceService;
477 }
478
479
484 public void setResourceService(ResourceService resourceService) {
485 this.resourceService = resourceService;
486 }
487
488
493 public ResourcePersistence getResourcePersistence() {
494 return resourcePersistence;
495 }
496
497
502 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
503 this.resourcePersistence = resourcePersistence;
504 }
505
506
511 public ResourceFinder getResourceFinder() {
512 return resourceFinder;
513 }
514
515
520 public void setResourceFinder(ResourceFinder resourceFinder) {
521 this.resourceFinder = resourceFinder;
522 }
523
524
529 public UserLocalService getUserLocalService() {
530 return userLocalService;
531 }
532
533
538 public void setUserLocalService(UserLocalService userLocalService) {
539 this.userLocalService = userLocalService;
540 }
541
542
547 public UserService getUserService() {
548 return userService;
549 }
550
551
556 public void setUserService(UserService userService) {
557 this.userService = userService;
558 }
559
560
565 public UserPersistence getUserPersistence() {
566 return userPersistence;
567 }
568
569
574 public void setUserPersistence(UserPersistence userPersistence) {
575 this.userPersistence = userPersistence;
576 }
577
578
583 public UserFinder getUserFinder() {
584 return userFinder;
585 }
586
587
592 public void setUserFinder(UserFinder userFinder) {
593 this.userFinder = userFinder;
594 }
595
596
601 protected void runSQL(String sql) throws SystemException {
602 try {
603 DataSource dataSource = pollsQuestionPersistence.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 = PollsChoicePersistence.class)
618 protected PollsChoicePersistence pollsChoicePersistence;
619 @BeanReference(type = PollsChoiceFinder.class)
620 protected PollsChoiceFinder pollsChoiceFinder;
621 @BeanReference(type = PollsQuestionLocalService.class)
622 protected PollsQuestionLocalService pollsQuestionLocalService;
623 @BeanReference(type = PollsQuestionService.class)
624 protected PollsQuestionService pollsQuestionService;
625 @BeanReference(type = PollsQuestionPersistence.class)
626 protected PollsQuestionPersistence pollsQuestionPersistence;
627 @BeanReference(type = PollsVoteLocalService.class)
628 protected PollsVoteLocalService pollsVoteLocalService;
629 @BeanReference(type = PollsVoteService.class)
630 protected PollsVoteService pollsVoteService;
631 @BeanReference(type = PollsVotePersistence.class)
632 protected PollsVotePersistence pollsVotePersistence;
633 @BeanReference(type = CounterLocalService.class)
634 protected CounterLocalService counterLocalService;
635 @BeanReference(type = ResourceLocalService.class)
636 protected ResourceLocalService resourceLocalService;
637 @BeanReference(type = ResourceService.class)
638 protected ResourceService resourceService;
639 @BeanReference(type = ResourcePersistence.class)
640 protected ResourcePersistence resourcePersistence;
641 @BeanReference(type = ResourceFinder.class)
642 protected ResourceFinder resourceFinder;
643 @BeanReference(type = UserLocalService.class)
644 protected UserLocalService userLocalService;
645 @BeanReference(type = UserService.class)
646 protected UserService userService;
647 @BeanReference(type = UserPersistence.class)
648 protected UserPersistence userPersistence;
649 @BeanReference(type = UserFinder.class)
650 protected UserFinder userFinder;
651 }