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.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.mobiledevicerules.model.MDRRule;
043 import com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService;
044 import com.liferay.portlet.mobiledevicerules.service.MDRActionService;
045 import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService;
046 import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService;
047 import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService;
048 import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService;
049 import com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService;
050 import com.liferay.portlet.mobiledevicerules.service.MDRRuleService;
051 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRActionPersistence;
052 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupFinder;
053 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupInstancePersistence;
054 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupPersistence;
055 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRulePersistence;
056
057 import java.io.Serializable;
058
059 import java.util.List;
060
061 import javax.sql.DataSource;
062
063
075 public abstract class MDRRuleLocalServiceBaseImpl extends BaseLocalServiceImpl
076 implements MDRRuleLocalService, IdentifiableBean {
077
082
083
090 @Indexable(type = IndexableType.REINDEX)
091 public MDRRule addMDRRule(MDRRule mdrRule) throws SystemException {
092 mdrRule.setNew(true);
093
094 return mdrRulePersistence.update(mdrRule, false);
095 }
096
097
103 public MDRRule createMDRRule(long ruleId) {
104 return mdrRulePersistence.create(ruleId);
105 }
106
107
115 @Indexable(type = IndexableType.DELETE)
116 public MDRRule deleteMDRRule(long ruleId)
117 throws PortalException, SystemException {
118 return mdrRulePersistence.remove(ruleId);
119 }
120
121
128 @Indexable(type = IndexableType.DELETE)
129 public MDRRule deleteMDRRule(MDRRule mdrRule) throws SystemException {
130 return mdrRulePersistence.remove(mdrRule);
131 }
132
133 public DynamicQuery dynamicQuery() {
134 Class<?> clazz = getClass();
135
136 return DynamicQueryFactoryUtil.forClass(MDRRule.class,
137 clazz.getClassLoader());
138 }
139
140
147 @SuppressWarnings("rawtypes")
148 public List dynamicQuery(DynamicQuery dynamicQuery)
149 throws SystemException {
150 return mdrRulePersistence.findWithDynamicQuery(dynamicQuery);
151 }
152
153
166 @SuppressWarnings("rawtypes")
167 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
168 throws SystemException {
169 return mdrRulePersistence.findWithDynamicQuery(dynamicQuery, start, end);
170 }
171
172
186 @SuppressWarnings("rawtypes")
187 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
188 OrderByComparator orderByComparator) throws SystemException {
189 return mdrRulePersistence.findWithDynamicQuery(dynamicQuery, start,
190 end, orderByComparator);
191 }
192
193
200 public long dynamicQueryCount(DynamicQuery dynamicQuery)
201 throws SystemException {
202 return mdrRulePersistence.countWithDynamicQuery(dynamicQuery);
203 }
204
205 public MDRRule fetchMDRRule(long ruleId) throws SystemException {
206 return mdrRulePersistence.fetchByPrimaryKey(ruleId);
207 }
208
209
217 public MDRRule getMDRRule(long ruleId)
218 throws PortalException, SystemException {
219 return mdrRulePersistence.findByPrimaryKey(ruleId);
220 }
221
222 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
223 throws PortalException, SystemException {
224 return mdrRulePersistence.findByPrimaryKey(primaryKeyObj);
225 }
226
227
236 public MDRRule getMDRRuleByUuidAndGroupId(String uuid, long groupId)
237 throws PortalException, SystemException {
238 return mdrRulePersistence.findByUUID_G(uuid, groupId);
239 }
240
241
253 public List<MDRRule> getMDRRules(int start, int end)
254 throws SystemException {
255 return mdrRulePersistence.findAll(start, end);
256 }
257
258
264 public int getMDRRulesCount() throws SystemException {
265 return mdrRulePersistence.countAll();
266 }
267
268
275 @Indexable(type = IndexableType.REINDEX)
276 public MDRRule updateMDRRule(MDRRule mdrRule) throws SystemException {
277 return updateMDRRule(mdrRule, true);
278 }
279
280
288 @Indexable(type = IndexableType.REINDEX)
289 public MDRRule updateMDRRule(MDRRule mdrRule, boolean merge)
290 throws SystemException {
291 mdrRule.setNew(false);
292
293 return mdrRulePersistence.update(mdrRule, merge);
294 }
295
296
301 public MDRActionLocalService getMDRActionLocalService() {
302 return mdrActionLocalService;
303 }
304
305
310 public void setMDRActionLocalService(
311 MDRActionLocalService mdrActionLocalService) {
312 this.mdrActionLocalService = mdrActionLocalService;
313 }
314
315
320 public MDRActionService getMDRActionService() {
321 return mdrActionService;
322 }
323
324
329 public void setMDRActionService(MDRActionService mdrActionService) {
330 this.mdrActionService = mdrActionService;
331 }
332
333
338 public MDRActionPersistence getMDRActionPersistence() {
339 return mdrActionPersistence;
340 }
341
342
347 public void setMDRActionPersistence(
348 MDRActionPersistence mdrActionPersistence) {
349 this.mdrActionPersistence = mdrActionPersistence;
350 }
351
352
357 public MDRRuleLocalService getMDRRuleLocalService() {
358 return mdrRuleLocalService;
359 }
360
361
366 public void setMDRRuleLocalService(MDRRuleLocalService mdrRuleLocalService) {
367 this.mdrRuleLocalService = mdrRuleLocalService;
368 }
369
370
375 public MDRRuleService getMDRRuleService() {
376 return mdrRuleService;
377 }
378
379
384 public void setMDRRuleService(MDRRuleService mdrRuleService) {
385 this.mdrRuleService = mdrRuleService;
386 }
387
388
393 public MDRRulePersistence getMDRRulePersistence() {
394 return mdrRulePersistence;
395 }
396
397
402 public void setMDRRulePersistence(MDRRulePersistence mdrRulePersistence) {
403 this.mdrRulePersistence = mdrRulePersistence;
404 }
405
406
411 public MDRRuleGroupLocalService getMDRRuleGroupLocalService() {
412 return mdrRuleGroupLocalService;
413 }
414
415
420 public void setMDRRuleGroupLocalService(
421 MDRRuleGroupLocalService mdrRuleGroupLocalService) {
422 this.mdrRuleGroupLocalService = mdrRuleGroupLocalService;
423 }
424
425
430 public MDRRuleGroupService getMDRRuleGroupService() {
431 return mdrRuleGroupService;
432 }
433
434
439 public void setMDRRuleGroupService(MDRRuleGroupService mdrRuleGroupService) {
440 this.mdrRuleGroupService = mdrRuleGroupService;
441 }
442
443
448 public MDRRuleGroupPersistence getMDRRuleGroupPersistence() {
449 return mdrRuleGroupPersistence;
450 }
451
452
457 public void setMDRRuleGroupPersistence(
458 MDRRuleGroupPersistence mdrRuleGroupPersistence) {
459 this.mdrRuleGroupPersistence = mdrRuleGroupPersistence;
460 }
461
462
467 public MDRRuleGroupFinder getMDRRuleGroupFinder() {
468 return mdrRuleGroupFinder;
469 }
470
471
476 public void setMDRRuleGroupFinder(MDRRuleGroupFinder mdrRuleGroupFinder) {
477 this.mdrRuleGroupFinder = mdrRuleGroupFinder;
478 }
479
480
485 public MDRRuleGroupInstanceLocalService getMDRRuleGroupInstanceLocalService() {
486 return mdrRuleGroupInstanceLocalService;
487 }
488
489
494 public void setMDRRuleGroupInstanceLocalService(
495 MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService) {
496 this.mdrRuleGroupInstanceLocalService = mdrRuleGroupInstanceLocalService;
497 }
498
499
504 public MDRRuleGroupInstanceService getMDRRuleGroupInstanceService() {
505 return mdrRuleGroupInstanceService;
506 }
507
508
513 public void setMDRRuleGroupInstanceService(
514 MDRRuleGroupInstanceService mdrRuleGroupInstanceService) {
515 this.mdrRuleGroupInstanceService = mdrRuleGroupInstanceService;
516 }
517
518
523 public MDRRuleGroupInstancePersistence getMDRRuleGroupInstancePersistence() {
524 return mdrRuleGroupInstancePersistence;
525 }
526
527
532 public void setMDRRuleGroupInstancePersistence(
533 MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence) {
534 this.mdrRuleGroupInstancePersistence = mdrRuleGroupInstancePersistence;
535 }
536
537
542 public CounterLocalService getCounterLocalService() {
543 return counterLocalService;
544 }
545
546
551 public void setCounterLocalService(CounterLocalService counterLocalService) {
552 this.counterLocalService = counterLocalService;
553 }
554
555
560 public ResourceLocalService getResourceLocalService() {
561 return resourceLocalService;
562 }
563
564
569 public void setResourceLocalService(
570 ResourceLocalService resourceLocalService) {
571 this.resourceLocalService = resourceLocalService;
572 }
573
574
579 public ResourceService getResourceService() {
580 return resourceService;
581 }
582
583
588 public void setResourceService(ResourceService resourceService) {
589 this.resourceService = resourceService;
590 }
591
592
597 public ResourcePersistence getResourcePersistence() {
598 return resourcePersistence;
599 }
600
601
606 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
607 this.resourcePersistence = resourcePersistence;
608 }
609
610
615 public ResourceFinder getResourceFinder() {
616 return resourceFinder;
617 }
618
619
624 public void setResourceFinder(ResourceFinder resourceFinder) {
625 this.resourceFinder = resourceFinder;
626 }
627
628
633 public UserLocalService getUserLocalService() {
634 return userLocalService;
635 }
636
637
642 public void setUserLocalService(UserLocalService userLocalService) {
643 this.userLocalService = userLocalService;
644 }
645
646
651 public UserService getUserService() {
652 return userService;
653 }
654
655
660 public void setUserService(UserService userService) {
661 this.userService = userService;
662 }
663
664
669 public UserPersistence getUserPersistence() {
670 return userPersistence;
671 }
672
673
678 public void setUserPersistence(UserPersistence userPersistence) {
679 this.userPersistence = userPersistence;
680 }
681
682
687 public UserFinder getUserFinder() {
688 return userFinder;
689 }
690
691
696 public void setUserFinder(UserFinder userFinder) {
697 this.userFinder = userFinder;
698 }
699
700 public void afterPropertiesSet() {
701 persistedModelLocalServiceRegistry.register("com.liferay.portlet.mobiledevicerules.model.MDRRule",
702 mdrRuleLocalService);
703 }
704
705 public void destroy() {
706 persistedModelLocalServiceRegistry.unregister(
707 "com.liferay.portlet.mobiledevicerules.model.MDRRule");
708 }
709
710
715 public String getBeanIdentifier() {
716 return _beanIdentifier;
717 }
718
719
724 public void setBeanIdentifier(String beanIdentifier) {
725 _beanIdentifier = beanIdentifier;
726 }
727
728 protected Class<?> getModelClass() {
729 return MDRRule.class;
730 }
731
732 protected String getModelClassName() {
733 return MDRRule.class.getName();
734 }
735
736
741 protected void runSQL(String sql) throws SystemException {
742 try {
743 DataSource dataSource = mdrRulePersistence.getDataSource();
744
745 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
746 sql, new int[0]);
747
748 sqlUpdate.update();
749 }
750 catch (Exception e) {
751 throw new SystemException(e);
752 }
753 }
754
755 @BeanReference(type = MDRActionLocalService.class)
756 protected MDRActionLocalService mdrActionLocalService;
757 @BeanReference(type = MDRActionService.class)
758 protected MDRActionService mdrActionService;
759 @BeanReference(type = MDRActionPersistence.class)
760 protected MDRActionPersistence mdrActionPersistence;
761 @BeanReference(type = MDRRuleLocalService.class)
762 protected MDRRuleLocalService mdrRuleLocalService;
763 @BeanReference(type = MDRRuleService.class)
764 protected MDRRuleService mdrRuleService;
765 @BeanReference(type = MDRRulePersistence.class)
766 protected MDRRulePersistence mdrRulePersistence;
767 @BeanReference(type = MDRRuleGroupLocalService.class)
768 protected MDRRuleGroupLocalService mdrRuleGroupLocalService;
769 @BeanReference(type = MDRRuleGroupService.class)
770 protected MDRRuleGroupService mdrRuleGroupService;
771 @BeanReference(type = MDRRuleGroupPersistence.class)
772 protected MDRRuleGroupPersistence mdrRuleGroupPersistence;
773 @BeanReference(type = MDRRuleGroupFinder.class)
774 protected MDRRuleGroupFinder mdrRuleGroupFinder;
775 @BeanReference(type = MDRRuleGroupInstanceLocalService.class)
776 protected MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService;
777 @BeanReference(type = MDRRuleGroupInstanceService.class)
778 protected MDRRuleGroupInstanceService mdrRuleGroupInstanceService;
779 @BeanReference(type = MDRRuleGroupInstancePersistence.class)
780 protected MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence;
781 @BeanReference(type = CounterLocalService.class)
782 protected CounterLocalService counterLocalService;
783 @BeanReference(type = ResourceLocalService.class)
784 protected ResourceLocalService resourceLocalService;
785 @BeanReference(type = ResourceService.class)
786 protected ResourceService resourceService;
787 @BeanReference(type = ResourcePersistence.class)
788 protected ResourcePersistence resourcePersistence;
789 @BeanReference(type = ResourceFinder.class)
790 protected ResourceFinder resourceFinder;
791 @BeanReference(type = UserLocalService.class)
792 protected UserLocalService userLocalService;
793 @BeanReference(type = UserService.class)
794 protected UserService userService;
795 @BeanReference(type = UserPersistence.class)
796 protected UserPersistence userPersistence;
797 @BeanReference(type = UserFinder.class)
798 protected UserFinder userFinder;
799 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
800 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
801 private String _beanIdentifier;
802 }