001
014
015 package com.liferay.portlet.announcements.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.ResourceService;
035 import com.liferay.portal.service.UserLocalService;
036 import com.liferay.portal.service.UserService;
037 import com.liferay.portal.service.persistence.ResourceFinder;
038 import com.liferay.portal.service.persistence.ResourcePersistence;
039 import com.liferay.portal.service.persistence.UserFinder;
040 import com.liferay.portal.service.persistence.UserPersistence;
041
042 import com.liferay.portlet.announcements.model.AnnouncementsFlag;
043 import com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService;
044 import com.liferay.portlet.announcements.service.AnnouncementsDeliveryService;
045 import com.liferay.portlet.announcements.service.AnnouncementsEntryLocalService;
046 import com.liferay.portlet.announcements.service.AnnouncementsEntryService;
047 import com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService;
048 import com.liferay.portlet.announcements.service.AnnouncementsFlagService;
049 import com.liferay.portlet.announcements.service.persistence.AnnouncementsDeliveryPersistence;
050 import com.liferay.portlet.announcements.service.persistence.AnnouncementsEntryFinder;
051 import com.liferay.portlet.announcements.service.persistence.AnnouncementsEntryPersistence;
052 import com.liferay.portlet.announcements.service.persistence.AnnouncementsFlagPersistence;
053
054 import java.io.Serializable;
055
056 import java.util.List;
057
058 import javax.sql.DataSource;
059
060
072 public abstract class AnnouncementsFlagLocalServiceBaseImpl
073 extends BaseLocalServiceImpl implements AnnouncementsFlagLocalService,
074 IdentifiableBean {
075
080
081
088 @Indexable(type = IndexableType.REINDEX)
089 public AnnouncementsFlag addAnnouncementsFlag(
090 AnnouncementsFlag announcementsFlag) throws SystemException {
091 announcementsFlag.setNew(true);
092
093 return announcementsFlagPersistence.update(announcementsFlag, false);
094 }
095
096
102 public AnnouncementsFlag createAnnouncementsFlag(long flagId) {
103 return announcementsFlagPersistence.create(flagId);
104 }
105
106
114 @Indexable(type = IndexableType.DELETE)
115 public AnnouncementsFlag deleteAnnouncementsFlag(long flagId)
116 throws PortalException, SystemException {
117 return announcementsFlagPersistence.remove(flagId);
118 }
119
120
127 @Indexable(type = IndexableType.DELETE)
128 public AnnouncementsFlag deleteAnnouncementsFlag(
129 AnnouncementsFlag announcementsFlag) throws SystemException {
130 return announcementsFlagPersistence.remove(announcementsFlag);
131 }
132
133 public DynamicQuery dynamicQuery() {
134 Class<?> clazz = getClass();
135
136 return DynamicQueryFactoryUtil.forClass(AnnouncementsFlag.class,
137 clazz.getClassLoader());
138 }
139
140
147 @SuppressWarnings("rawtypes")
148 public List dynamicQuery(DynamicQuery dynamicQuery)
149 throws SystemException {
150 return announcementsFlagPersistence.findWithDynamicQuery(dynamicQuery);
151 }
152
153
166 @SuppressWarnings("rawtypes")
167 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
168 throws SystemException {
169 return announcementsFlagPersistence.findWithDynamicQuery(dynamicQuery,
170 start, end);
171 }
172
173
187 @SuppressWarnings("rawtypes")
188 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
189 OrderByComparator orderByComparator) throws SystemException {
190 return announcementsFlagPersistence.findWithDynamicQuery(dynamicQuery,
191 start, end, orderByComparator);
192 }
193
194
201 public long dynamicQueryCount(DynamicQuery dynamicQuery)
202 throws SystemException {
203 return announcementsFlagPersistence.countWithDynamicQuery(dynamicQuery);
204 }
205
206 public AnnouncementsFlag fetchAnnouncementsFlag(long flagId)
207 throws SystemException {
208 return announcementsFlagPersistence.fetchByPrimaryKey(flagId);
209 }
210
211
219 public AnnouncementsFlag getAnnouncementsFlag(long flagId)
220 throws PortalException, SystemException {
221 return announcementsFlagPersistence.findByPrimaryKey(flagId);
222 }
223
224 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
225 throws PortalException, SystemException {
226 return announcementsFlagPersistence.findByPrimaryKey(primaryKeyObj);
227 }
228
229
241 public List<AnnouncementsFlag> getAnnouncementsFlags(int start, int end)
242 throws SystemException {
243 return announcementsFlagPersistence.findAll(start, end);
244 }
245
246
252 public int getAnnouncementsFlagsCount() throws SystemException {
253 return announcementsFlagPersistence.countAll();
254 }
255
256
263 @Indexable(type = IndexableType.REINDEX)
264 public AnnouncementsFlag updateAnnouncementsFlag(
265 AnnouncementsFlag announcementsFlag) throws SystemException {
266 return updateAnnouncementsFlag(announcementsFlag, true);
267 }
268
269
277 @Indexable(type = IndexableType.REINDEX)
278 public AnnouncementsFlag updateAnnouncementsFlag(
279 AnnouncementsFlag announcementsFlag, boolean merge)
280 throws SystemException {
281 announcementsFlag.setNew(false);
282
283 return announcementsFlagPersistence.update(announcementsFlag, merge);
284 }
285
286
291 public AnnouncementsDeliveryLocalService getAnnouncementsDeliveryLocalService() {
292 return announcementsDeliveryLocalService;
293 }
294
295
300 public void setAnnouncementsDeliveryLocalService(
301 AnnouncementsDeliveryLocalService announcementsDeliveryLocalService) {
302 this.announcementsDeliveryLocalService = announcementsDeliveryLocalService;
303 }
304
305
310 public AnnouncementsDeliveryService getAnnouncementsDeliveryService() {
311 return announcementsDeliveryService;
312 }
313
314
319 public void setAnnouncementsDeliveryService(
320 AnnouncementsDeliveryService announcementsDeliveryService) {
321 this.announcementsDeliveryService = announcementsDeliveryService;
322 }
323
324
329 public AnnouncementsDeliveryPersistence getAnnouncementsDeliveryPersistence() {
330 return announcementsDeliveryPersistence;
331 }
332
333
338 public void setAnnouncementsDeliveryPersistence(
339 AnnouncementsDeliveryPersistence announcementsDeliveryPersistence) {
340 this.announcementsDeliveryPersistence = announcementsDeliveryPersistence;
341 }
342
343
348 public AnnouncementsEntryLocalService getAnnouncementsEntryLocalService() {
349 return announcementsEntryLocalService;
350 }
351
352
357 public void setAnnouncementsEntryLocalService(
358 AnnouncementsEntryLocalService announcementsEntryLocalService) {
359 this.announcementsEntryLocalService = announcementsEntryLocalService;
360 }
361
362
367 public AnnouncementsEntryService getAnnouncementsEntryService() {
368 return announcementsEntryService;
369 }
370
371
376 public void setAnnouncementsEntryService(
377 AnnouncementsEntryService announcementsEntryService) {
378 this.announcementsEntryService = announcementsEntryService;
379 }
380
381
386 public AnnouncementsEntryPersistence getAnnouncementsEntryPersistence() {
387 return announcementsEntryPersistence;
388 }
389
390
395 public void setAnnouncementsEntryPersistence(
396 AnnouncementsEntryPersistence announcementsEntryPersistence) {
397 this.announcementsEntryPersistence = announcementsEntryPersistence;
398 }
399
400
405 public AnnouncementsEntryFinder getAnnouncementsEntryFinder() {
406 return announcementsEntryFinder;
407 }
408
409
414 public void setAnnouncementsEntryFinder(
415 AnnouncementsEntryFinder announcementsEntryFinder) {
416 this.announcementsEntryFinder = announcementsEntryFinder;
417 }
418
419
424 public AnnouncementsFlagLocalService getAnnouncementsFlagLocalService() {
425 return announcementsFlagLocalService;
426 }
427
428
433 public void setAnnouncementsFlagLocalService(
434 AnnouncementsFlagLocalService announcementsFlagLocalService) {
435 this.announcementsFlagLocalService = announcementsFlagLocalService;
436 }
437
438
443 public AnnouncementsFlagService getAnnouncementsFlagService() {
444 return announcementsFlagService;
445 }
446
447
452 public void setAnnouncementsFlagService(
453 AnnouncementsFlagService announcementsFlagService) {
454 this.announcementsFlagService = announcementsFlagService;
455 }
456
457
462 public AnnouncementsFlagPersistence getAnnouncementsFlagPersistence() {
463 return announcementsFlagPersistence;
464 }
465
466
471 public void setAnnouncementsFlagPersistence(
472 AnnouncementsFlagPersistence announcementsFlagPersistence) {
473 this.announcementsFlagPersistence = announcementsFlagPersistence;
474 }
475
476
481 public CounterLocalService getCounterLocalService() {
482 return counterLocalService;
483 }
484
485
490 public void setCounterLocalService(CounterLocalService counterLocalService) {
491 this.counterLocalService = counterLocalService;
492 }
493
494
499 public ResourceLocalService getResourceLocalService() {
500 return resourceLocalService;
501 }
502
503
508 public void setResourceLocalService(
509 ResourceLocalService resourceLocalService) {
510 this.resourceLocalService = resourceLocalService;
511 }
512
513
518 public ResourceService getResourceService() {
519 return resourceService;
520 }
521
522
527 public void setResourceService(ResourceService resourceService) {
528 this.resourceService = resourceService;
529 }
530
531
536 public ResourcePersistence getResourcePersistence() {
537 return resourcePersistence;
538 }
539
540
545 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
546 this.resourcePersistence = resourcePersistence;
547 }
548
549
554 public ResourceFinder getResourceFinder() {
555 return resourceFinder;
556 }
557
558
563 public void setResourceFinder(ResourceFinder resourceFinder) {
564 this.resourceFinder = resourceFinder;
565 }
566
567
572 public UserLocalService getUserLocalService() {
573 return userLocalService;
574 }
575
576
581 public void setUserLocalService(UserLocalService userLocalService) {
582 this.userLocalService = userLocalService;
583 }
584
585
590 public UserService getUserService() {
591 return userService;
592 }
593
594
599 public void setUserService(UserService userService) {
600 this.userService = userService;
601 }
602
603
608 public UserPersistence getUserPersistence() {
609 return userPersistence;
610 }
611
612
617 public void setUserPersistence(UserPersistence userPersistence) {
618 this.userPersistence = userPersistence;
619 }
620
621
626 public UserFinder getUserFinder() {
627 return userFinder;
628 }
629
630
635 public void setUserFinder(UserFinder userFinder) {
636 this.userFinder = userFinder;
637 }
638
639 public void afterPropertiesSet() {
640 persistedModelLocalServiceRegistry.register("com.liferay.portlet.announcements.model.AnnouncementsFlag",
641 announcementsFlagLocalService);
642 }
643
644 public void destroy() {
645 persistedModelLocalServiceRegistry.unregister(
646 "com.liferay.portlet.announcements.model.AnnouncementsFlag");
647 }
648
649
654 public String getBeanIdentifier() {
655 return _beanIdentifier;
656 }
657
658
663 public void setBeanIdentifier(String beanIdentifier) {
664 _beanIdentifier = beanIdentifier;
665 }
666
667 protected Class<?> getModelClass() {
668 return AnnouncementsFlag.class;
669 }
670
671 protected String getModelClassName() {
672 return AnnouncementsFlag.class.getName();
673 }
674
675
680 protected void runSQL(String sql) throws SystemException {
681 try {
682 DataSource dataSource = announcementsFlagPersistence.getDataSource();
683
684 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
685 sql, new int[0]);
686
687 sqlUpdate.update();
688 }
689 catch (Exception e) {
690 throw new SystemException(e);
691 }
692 }
693
694 @BeanReference(type = AnnouncementsDeliveryLocalService.class)
695 protected AnnouncementsDeliveryLocalService announcementsDeliveryLocalService;
696 @BeanReference(type = AnnouncementsDeliveryService.class)
697 protected AnnouncementsDeliveryService announcementsDeliveryService;
698 @BeanReference(type = AnnouncementsDeliveryPersistence.class)
699 protected AnnouncementsDeliveryPersistence announcementsDeliveryPersistence;
700 @BeanReference(type = AnnouncementsEntryLocalService.class)
701 protected AnnouncementsEntryLocalService announcementsEntryLocalService;
702 @BeanReference(type = AnnouncementsEntryService.class)
703 protected AnnouncementsEntryService announcementsEntryService;
704 @BeanReference(type = AnnouncementsEntryPersistence.class)
705 protected AnnouncementsEntryPersistence announcementsEntryPersistence;
706 @BeanReference(type = AnnouncementsEntryFinder.class)
707 protected AnnouncementsEntryFinder announcementsEntryFinder;
708 @BeanReference(type = AnnouncementsFlagLocalService.class)
709 protected AnnouncementsFlagLocalService announcementsFlagLocalService;
710 @BeanReference(type = AnnouncementsFlagService.class)
711 protected AnnouncementsFlagService announcementsFlagService;
712 @BeanReference(type = AnnouncementsFlagPersistence.class)
713 protected AnnouncementsFlagPersistence announcementsFlagPersistence;
714 @BeanReference(type = CounterLocalService.class)
715 protected CounterLocalService counterLocalService;
716 @BeanReference(type = ResourceLocalService.class)
717 protected ResourceLocalService resourceLocalService;
718 @BeanReference(type = ResourceService.class)
719 protected ResourceService resourceService;
720 @BeanReference(type = ResourcePersistence.class)
721 protected ResourcePersistence resourcePersistence;
722 @BeanReference(type = ResourceFinder.class)
723 protected ResourceFinder resourceFinder;
724 @BeanReference(type = UserLocalService.class)
725 protected UserLocalService userLocalService;
726 @BeanReference(type = UserService.class)
727 protected UserService userService;
728 @BeanReference(type = UserPersistence.class)
729 protected UserPersistence userPersistence;
730 @BeanReference(type = UserFinder.class)
731 protected UserFinder userFinder;
732 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
733 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
734 private String _beanIdentifier;
735 }