001
014
015 package com.liferay.portlet.mobiledevicerules.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.GroupLocalService;
033 import com.liferay.portal.service.GroupService;
034 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
035 import com.liferay.portal.service.ResourceLocalService;
036 import com.liferay.portal.service.ResourceService;
037 import com.liferay.portal.service.UserLocalService;
038 import com.liferay.portal.service.UserService;
039 import com.liferay.portal.service.persistence.GroupFinder;
040 import com.liferay.portal.service.persistence.GroupPersistence;
041 import com.liferay.portal.service.persistence.ResourceFinder;
042 import com.liferay.portal.service.persistence.ResourcePersistence;
043 import com.liferay.portal.service.persistence.UserFinder;
044 import com.liferay.portal.service.persistence.UserPersistence;
045
046 import com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup;
047 import com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService;
048 import com.liferay.portlet.mobiledevicerules.service.MDRActionService;
049 import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService;
050 import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService;
051 import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService;
052 import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService;
053 import com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService;
054 import com.liferay.portlet.mobiledevicerules.service.MDRRuleService;
055 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRActionPersistence;
056 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupFinder;
057 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupInstancePersistence;
058 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupPersistence;
059 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRulePersistence;
060
061 import java.io.Serializable;
062
063 import java.util.List;
064
065 import javax.sql.DataSource;
066
067
079 public abstract class MDRRuleGroupLocalServiceBaseImpl
080 extends BaseLocalServiceImpl implements MDRRuleGroupLocalService,
081 IdentifiableBean {
082
087
088
095 @Indexable(type = IndexableType.REINDEX)
096 public MDRRuleGroup addMDRRuleGroup(MDRRuleGroup mdrRuleGroup)
097 throws SystemException {
098 mdrRuleGroup.setNew(true);
099
100 return mdrRuleGroupPersistence.update(mdrRuleGroup, false);
101 }
102
103
109 public MDRRuleGroup createMDRRuleGroup(long ruleGroupId) {
110 return mdrRuleGroupPersistence.create(ruleGroupId);
111 }
112
113
121 @Indexable(type = IndexableType.DELETE)
122 public MDRRuleGroup deleteMDRRuleGroup(long ruleGroupId)
123 throws PortalException, SystemException {
124 return mdrRuleGroupPersistence.remove(ruleGroupId);
125 }
126
127
134 @Indexable(type = IndexableType.DELETE)
135 public MDRRuleGroup deleteMDRRuleGroup(MDRRuleGroup mdrRuleGroup)
136 throws SystemException {
137 return mdrRuleGroupPersistence.remove(mdrRuleGroup);
138 }
139
140 public DynamicQuery dynamicQuery() {
141 Class<?> clazz = getClass();
142
143 return DynamicQueryFactoryUtil.forClass(MDRRuleGroup.class,
144 clazz.getClassLoader());
145 }
146
147
154 @SuppressWarnings("rawtypes")
155 public List dynamicQuery(DynamicQuery dynamicQuery)
156 throws SystemException {
157 return mdrRuleGroupPersistence.findWithDynamicQuery(dynamicQuery);
158 }
159
160
173 @SuppressWarnings("rawtypes")
174 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
175 throws SystemException {
176 return mdrRuleGroupPersistence.findWithDynamicQuery(dynamicQuery,
177 start, end);
178 }
179
180
194 @SuppressWarnings("rawtypes")
195 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
196 OrderByComparator orderByComparator) throws SystemException {
197 return mdrRuleGroupPersistence.findWithDynamicQuery(dynamicQuery,
198 start, end, orderByComparator);
199 }
200
201
208 public long dynamicQueryCount(DynamicQuery dynamicQuery)
209 throws SystemException {
210 return mdrRuleGroupPersistence.countWithDynamicQuery(dynamicQuery);
211 }
212
213 public MDRRuleGroup fetchMDRRuleGroup(long ruleGroupId)
214 throws SystemException {
215 return mdrRuleGroupPersistence.fetchByPrimaryKey(ruleGroupId);
216 }
217
218
226 public MDRRuleGroup getMDRRuleGroup(long ruleGroupId)
227 throws PortalException, SystemException {
228 return mdrRuleGroupPersistence.findByPrimaryKey(ruleGroupId);
229 }
230
231 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
232 throws PortalException, SystemException {
233 return mdrRuleGroupPersistence.findByPrimaryKey(primaryKeyObj);
234 }
235
236
245 public MDRRuleGroup getMDRRuleGroupByUuidAndGroupId(String uuid,
246 long groupId) throws PortalException, SystemException {
247 return mdrRuleGroupPersistence.findByUUID_G(uuid, groupId);
248 }
249
250
262 public List<MDRRuleGroup> getMDRRuleGroups(int start, int end)
263 throws SystemException {
264 return mdrRuleGroupPersistence.findAll(start, end);
265 }
266
267
273 public int getMDRRuleGroupsCount() throws SystemException {
274 return mdrRuleGroupPersistence.countAll();
275 }
276
277
284 @Indexable(type = IndexableType.REINDEX)
285 public MDRRuleGroup updateMDRRuleGroup(MDRRuleGroup mdrRuleGroup)
286 throws SystemException {
287 return updateMDRRuleGroup(mdrRuleGroup, true);
288 }
289
290
298 @Indexable(type = IndexableType.REINDEX)
299 public MDRRuleGroup updateMDRRuleGroup(MDRRuleGroup mdrRuleGroup,
300 boolean merge) throws SystemException {
301 mdrRuleGroup.setNew(false);
302
303 return mdrRuleGroupPersistence.update(mdrRuleGroup, merge);
304 }
305
306
311 public MDRActionLocalService getMDRActionLocalService() {
312 return mdrActionLocalService;
313 }
314
315
320 public void setMDRActionLocalService(
321 MDRActionLocalService mdrActionLocalService) {
322 this.mdrActionLocalService = mdrActionLocalService;
323 }
324
325
330 public MDRActionService getMDRActionService() {
331 return mdrActionService;
332 }
333
334
339 public void setMDRActionService(MDRActionService mdrActionService) {
340 this.mdrActionService = mdrActionService;
341 }
342
343
348 public MDRActionPersistence getMDRActionPersistence() {
349 return mdrActionPersistence;
350 }
351
352
357 public void setMDRActionPersistence(
358 MDRActionPersistence mdrActionPersistence) {
359 this.mdrActionPersistence = mdrActionPersistence;
360 }
361
362
367 public MDRRuleLocalService getMDRRuleLocalService() {
368 return mdrRuleLocalService;
369 }
370
371
376 public void setMDRRuleLocalService(MDRRuleLocalService mdrRuleLocalService) {
377 this.mdrRuleLocalService = mdrRuleLocalService;
378 }
379
380
385 public MDRRuleService getMDRRuleService() {
386 return mdrRuleService;
387 }
388
389
394 public void setMDRRuleService(MDRRuleService mdrRuleService) {
395 this.mdrRuleService = mdrRuleService;
396 }
397
398
403 public MDRRulePersistence getMDRRulePersistence() {
404 return mdrRulePersistence;
405 }
406
407
412 public void setMDRRulePersistence(MDRRulePersistence mdrRulePersistence) {
413 this.mdrRulePersistence = mdrRulePersistence;
414 }
415
416
421 public MDRRuleGroupLocalService getMDRRuleGroupLocalService() {
422 return mdrRuleGroupLocalService;
423 }
424
425
430 public void setMDRRuleGroupLocalService(
431 MDRRuleGroupLocalService mdrRuleGroupLocalService) {
432 this.mdrRuleGroupLocalService = mdrRuleGroupLocalService;
433 }
434
435
440 public MDRRuleGroupService getMDRRuleGroupService() {
441 return mdrRuleGroupService;
442 }
443
444
449 public void setMDRRuleGroupService(MDRRuleGroupService mdrRuleGroupService) {
450 this.mdrRuleGroupService = mdrRuleGroupService;
451 }
452
453
458 public MDRRuleGroupPersistence getMDRRuleGroupPersistence() {
459 return mdrRuleGroupPersistence;
460 }
461
462
467 public void setMDRRuleGroupPersistence(
468 MDRRuleGroupPersistence mdrRuleGroupPersistence) {
469 this.mdrRuleGroupPersistence = mdrRuleGroupPersistence;
470 }
471
472
477 public MDRRuleGroupFinder getMDRRuleGroupFinder() {
478 return mdrRuleGroupFinder;
479 }
480
481
486 public void setMDRRuleGroupFinder(MDRRuleGroupFinder mdrRuleGroupFinder) {
487 this.mdrRuleGroupFinder = mdrRuleGroupFinder;
488 }
489
490
495 public MDRRuleGroupInstanceLocalService getMDRRuleGroupInstanceLocalService() {
496 return mdrRuleGroupInstanceLocalService;
497 }
498
499
504 public void setMDRRuleGroupInstanceLocalService(
505 MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService) {
506 this.mdrRuleGroupInstanceLocalService = mdrRuleGroupInstanceLocalService;
507 }
508
509
514 public MDRRuleGroupInstanceService getMDRRuleGroupInstanceService() {
515 return mdrRuleGroupInstanceService;
516 }
517
518
523 public void setMDRRuleGroupInstanceService(
524 MDRRuleGroupInstanceService mdrRuleGroupInstanceService) {
525 this.mdrRuleGroupInstanceService = mdrRuleGroupInstanceService;
526 }
527
528
533 public MDRRuleGroupInstancePersistence getMDRRuleGroupInstancePersistence() {
534 return mdrRuleGroupInstancePersistence;
535 }
536
537
542 public void setMDRRuleGroupInstancePersistence(
543 MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence) {
544 this.mdrRuleGroupInstancePersistence = mdrRuleGroupInstancePersistence;
545 }
546
547
552 public CounterLocalService getCounterLocalService() {
553 return counterLocalService;
554 }
555
556
561 public void setCounterLocalService(CounterLocalService counterLocalService) {
562 this.counterLocalService = counterLocalService;
563 }
564
565
570 public GroupLocalService getGroupLocalService() {
571 return groupLocalService;
572 }
573
574
579 public void setGroupLocalService(GroupLocalService groupLocalService) {
580 this.groupLocalService = groupLocalService;
581 }
582
583
588 public GroupService getGroupService() {
589 return groupService;
590 }
591
592
597 public void setGroupService(GroupService groupService) {
598 this.groupService = groupService;
599 }
600
601
606 public GroupPersistence getGroupPersistence() {
607 return groupPersistence;
608 }
609
610
615 public void setGroupPersistence(GroupPersistence groupPersistence) {
616 this.groupPersistence = groupPersistence;
617 }
618
619
624 public GroupFinder getGroupFinder() {
625 return groupFinder;
626 }
627
628
633 public void setGroupFinder(GroupFinder groupFinder) {
634 this.groupFinder = groupFinder;
635 }
636
637
642 public ResourceLocalService getResourceLocalService() {
643 return resourceLocalService;
644 }
645
646
651 public void setResourceLocalService(
652 ResourceLocalService resourceLocalService) {
653 this.resourceLocalService = resourceLocalService;
654 }
655
656
661 public ResourceService getResourceService() {
662 return resourceService;
663 }
664
665
670 public void setResourceService(ResourceService resourceService) {
671 this.resourceService = resourceService;
672 }
673
674
679 public ResourcePersistence getResourcePersistence() {
680 return resourcePersistence;
681 }
682
683
688 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
689 this.resourcePersistence = resourcePersistence;
690 }
691
692
697 public ResourceFinder getResourceFinder() {
698 return resourceFinder;
699 }
700
701
706 public void setResourceFinder(ResourceFinder resourceFinder) {
707 this.resourceFinder = resourceFinder;
708 }
709
710
715 public UserLocalService getUserLocalService() {
716 return userLocalService;
717 }
718
719
724 public void setUserLocalService(UserLocalService userLocalService) {
725 this.userLocalService = userLocalService;
726 }
727
728
733 public UserService getUserService() {
734 return userService;
735 }
736
737
742 public void setUserService(UserService userService) {
743 this.userService = userService;
744 }
745
746
751 public UserPersistence getUserPersistence() {
752 return userPersistence;
753 }
754
755
760 public void setUserPersistence(UserPersistence userPersistence) {
761 this.userPersistence = userPersistence;
762 }
763
764
769 public UserFinder getUserFinder() {
770 return userFinder;
771 }
772
773
778 public void setUserFinder(UserFinder userFinder) {
779 this.userFinder = userFinder;
780 }
781
782 public void afterPropertiesSet() {
783 persistedModelLocalServiceRegistry.register("com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup",
784 mdrRuleGroupLocalService);
785 }
786
787 public void destroy() {
788 persistedModelLocalServiceRegistry.unregister(
789 "com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup");
790 }
791
792
797 public String getBeanIdentifier() {
798 return _beanIdentifier;
799 }
800
801
806 public void setBeanIdentifier(String beanIdentifier) {
807 _beanIdentifier = beanIdentifier;
808 }
809
810 protected Class<?> getModelClass() {
811 return MDRRuleGroup.class;
812 }
813
814 protected String getModelClassName() {
815 return MDRRuleGroup.class.getName();
816 }
817
818
823 protected void runSQL(String sql) throws SystemException {
824 try {
825 DataSource dataSource = mdrRuleGroupPersistence.getDataSource();
826
827 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
828 sql, new int[0]);
829
830 sqlUpdate.update();
831 }
832 catch (Exception e) {
833 throw new SystemException(e);
834 }
835 }
836
837 @BeanReference(type = MDRActionLocalService.class)
838 protected MDRActionLocalService mdrActionLocalService;
839 @BeanReference(type = MDRActionService.class)
840 protected MDRActionService mdrActionService;
841 @BeanReference(type = MDRActionPersistence.class)
842 protected MDRActionPersistence mdrActionPersistence;
843 @BeanReference(type = MDRRuleLocalService.class)
844 protected MDRRuleLocalService mdrRuleLocalService;
845 @BeanReference(type = MDRRuleService.class)
846 protected MDRRuleService mdrRuleService;
847 @BeanReference(type = MDRRulePersistence.class)
848 protected MDRRulePersistence mdrRulePersistence;
849 @BeanReference(type = MDRRuleGroupLocalService.class)
850 protected MDRRuleGroupLocalService mdrRuleGroupLocalService;
851 @BeanReference(type = MDRRuleGroupService.class)
852 protected MDRRuleGroupService mdrRuleGroupService;
853 @BeanReference(type = MDRRuleGroupPersistence.class)
854 protected MDRRuleGroupPersistence mdrRuleGroupPersistence;
855 @BeanReference(type = MDRRuleGroupFinder.class)
856 protected MDRRuleGroupFinder mdrRuleGroupFinder;
857 @BeanReference(type = MDRRuleGroupInstanceLocalService.class)
858 protected MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService;
859 @BeanReference(type = MDRRuleGroupInstanceService.class)
860 protected MDRRuleGroupInstanceService mdrRuleGroupInstanceService;
861 @BeanReference(type = MDRRuleGroupInstancePersistence.class)
862 protected MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence;
863 @BeanReference(type = CounterLocalService.class)
864 protected CounterLocalService counterLocalService;
865 @BeanReference(type = GroupLocalService.class)
866 protected GroupLocalService groupLocalService;
867 @BeanReference(type = GroupService.class)
868 protected GroupService groupService;
869 @BeanReference(type = GroupPersistence.class)
870 protected GroupPersistence groupPersistence;
871 @BeanReference(type = GroupFinder.class)
872 protected GroupFinder groupFinder;
873 @BeanReference(type = ResourceLocalService.class)
874 protected ResourceLocalService resourceLocalService;
875 @BeanReference(type = ResourceService.class)
876 protected ResourceService resourceService;
877 @BeanReference(type = ResourcePersistence.class)
878 protected ResourcePersistence resourcePersistence;
879 @BeanReference(type = ResourceFinder.class)
880 protected ResourceFinder resourceFinder;
881 @BeanReference(type = UserLocalService.class)
882 protected UserLocalService userLocalService;
883 @BeanReference(type = UserService.class)
884 protected UserService userService;
885 @BeanReference(type = UserPersistence.class)
886 protected UserPersistence userPersistence;
887 @BeanReference(type = UserFinder.class)
888 protected UserFinder userFinder;
889 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
890 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
891 private String _beanIdentifier;
892 }