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.UserLocalService;
035 import com.liferay.portal.service.UserService;
036 import com.liferay.portal.service.persistence.UserFinder;
037 import com.liferay.portal.service.persistence.UserPersistence;
038
039 import com.liferay.portlet.mobiledevicerules.model.MDRRule;
040 import com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService;
041 import com.liferay.portlet.mobiledevicerules.service.MDRActionService;
042 import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService;
043 import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService;
044 import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService;
045 import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService;
046 import com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService;
047 import com.liferay.portlet.mobiledevicerules.service.MDRRuleService;
048 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRActionPersistence;
049 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupFinder;
050 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupInstancePersistence;
051 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupPersistence;
052 import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRulePersistence;
053
054 import java.io.Serializable;
055
056 import java.util.List;
057
058 import javax.sql.DataSource;
059
060
072 public abstract class MDRRuleLocalServiceBaseImpl extends BaseLocalServiceImpl
073 implements MDRRuleLocalService, IdentifiableBean {
074
079
080
087 @Indexable(type = IndexableType.REINDEX)
088 public MDRRule addMDRRule(MDRRule mdrRule) throws SystemException {
089 mdrRule.setNew(true);
090
091 return mdrRulePersistence.update(mdrRule);
092 }
093
094
100 public MDRRule createMDRRule(long ruleId) {
101 return mdrRulePersistence.create(ruleId);
102 }
103
104
112 @Indexable(type = IndexableType.DELETE)
113 public MDRRule deleteMDRRule(long ruleId)
114 throws PortalException, SystemException {
115 return mdrRulePersistence.remove(ruleId);
116 }
117
118
125 @Indexable(type = IndexableType.DELETE)
126 public MDRRule deleteMDRRule(MDRRule mdrRule) throws SystemException {
127 return mdrRulePersistence.remove(mdrRule);
128 }
129
130 public DynamicQuery dynamicQuery() {
131 Class<?> clazz = getClass();
132
133 return DynamicQueryFactoryUtil.forClass(MDRRule.class,
134 clazz.getClassLoader());
135 }
136
137
144 @SuppressWarnings("rawtypes")
145 public List dynamicQuery(DynamicQuery dynamicQuery)
146 throws SystemException {
147 return mdrRulePersistence.findWithDynamicQuery(dynamicQuery);
148 }
149
150
163 @SuppressWarnings("rawtypes")
164 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
165 throws SystemException {
166 return mdrRulePersistence.findWithDynamicQuery(dynamicQuery, start, end);
167 }
168
169
183 @SuppressWarnings("rawtypes")
184 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
185 OrderByComparator orderByComparator) throws SystemException {
186 return mdrRulePersistence.findWithDynamicQuery(dynamicQuery, start,
187 end, orderByComparator);
188 }
189
190
197 public long dynamicQueryCount(DynamicQuery dynamicQuery)
198 throws SystemException {
199 return mdrRulePersistence.countWithDynamicQuery(dynamicQuery);
200 }
201
202 public MDRRule fetchMDRRule(long ruleId) throws SystemException {
203 return mdrRulePersistence.fetchByPrimaryKey(ruleId);
204 }
205
206
214 public MDRRule getMDRRule(long ruleId)
215 throws PortalException, SystemException {
216 return mdrRulePersistence.findByPrimaryKey(ruleId);
217 }
218
219 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
220 throws PortalException, SystemException {
221 return mdrRulePersistence.findByPrimaryKey(primaryKeyObj);
222 }
223
224
233 public MDRRule getMDRRuleByUuidAndGroupId(String uuid, long groupId)
234 throws PortalException, SystemException {
235 return mdrRulePersistence.findByUUID_G(uuid, groupId);
236 }
237
238
250 public List<MDRRule> getMDRRules(int start, int end)
251 throws SystemException {
252 return mdrRulePersistence.findAll(start, end);
253 }
254
255
261 public int getMDRRulesCount() throws SystemException {
262 return mdrRulePersistence.countAll();
263 }
264
265
272 @Indexable(type = IndexableType.REINDEX)
273 public MDRRule updateMDRRule(MDRRule mdrRule) throws SystemException {
274 return mdrRulePersistence.update(mdrRule);
275 }
276
277
282 public MDRActionLocalService getMDRActionLocalService() {
283 return mdrActionLocalService;
284 }
285
286
291 public void setMDRActionLocalService(
292 MDRActionLocalService mdrActionLocalService) {
293 this.mdrActionLocalService = mdrActionLocalService;
294 }
295
296
301 public MDRActionService getMDRActionService() {
302 return mdrActionService;
303 }
304
305
310 public void setMDRActionService(MDRActionService mdrActionService) {
311 this.mdrActionService = mdrActionService;
312 }
313
314
319 public MDRActionPersistence getMDRActionPersistence() {
320 return mdrActionPersistence;
321 }
322
323
328 public void setMDRActionPersistence(
329 MDRActionPersistence mdrActionPersistence) {
330 this.mdrActionPersistence = mdrActionPersistence;
331 }
332
333
338 public MDRRuleLocalService getMDRRuleLocalService() {
339 return mdrRuleLocalService;
340 }
341
342
347 public void setMDRRuleLocalService(MDRRuleLocalService mdrRuleLocalService) {
348 this.mdrRuleLocalService = mdrRuleLocalService;
349 }
350
351
356 public MDRRuleService getMDRRuleService() {
357 return mdrRuleService;
358 }
359
360
365 public void setMDRRuleService(MDRRuleService mdrRuleService) {
366 this.mdrRuleService = mdrRuleService;
367 }
368
369
374 public MDRRulePersistence getMDRRulePersistence() {
375 return mdrRulePersistence;
376 }
377
378
383 public void setMDRRulePersistence(MDRRulePersistence mdrRulePersistence) {
384 this.mdrRulePersistence = mdrRulePersistence;
385 }
386
387
392 public MDRRuleGroupLocalService getMDRRuleGroupLocalService() {
393 return mdrRuleGroupLocalService;
394 }
395
396
401 public void setMDRRuleGroupLocalService(
402 MDRRuleGroupLocalService mdrRuleGroupLocalService) {
403 this.mdrRuleGroupLocalService = mdrRuleGroupLocalService;
404 }
405
406
411 public MDRRuleGroupService getMDRRuleGroupService() {
412 return mdrRuleGroupService;
413 }
414
415
420 public void setMDRRuleGroupService(MDRRuleGroupService mdrRuleGroupService) {
421 this.mdrRuleGroupService = mdrRuleGroupService;
422 }
423
424
429 public MDRRuleGroupPersistence getMDRRuleGroupPersistence() {
430 return mdrRuleGroupPersistence;
431 }
432
433
438 public void setMDRRuleGroupPersistence(
439 MDRRuleGroupPersistence mdrRuleGroupPersistence) {
440 this.mdrRuleGroupPersistence = mdrRuleGroupPersistence;
441 }
442
443
448 public MDRRuleGroupFinder getMDRRuleGroupFinder() {
449 return mdrRuleGroupFinder;
450 }
451
452
457 public void setMDRRuleGroupFinder(MDRRuleGroupFinder mdrRuleGroupFinder) {
458 this.mdrRuleGroupFinder = mdrRuleGroupFinder;
459 }
460
461
466 public MDRRuleGroupInstanceLocalService getMDRRuleGroupInstanceLocalService() {
467 return mdrRuleGroupInstanceLocalService;
468 }
469
470
475 public void setMDRRuleGroupInstanceLocalService(
476 MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService) {
477 this.mdrRuleGroupInstanceLocalService = mdrRuleGroupInstanceLocalService;
478 }
479
480
485 public MDRRuleGroupInstanceService getMDRRuleGroupInstanceService() {
486 return mdrRuleGroupInstanceService;
487 }
488
489
494 public void setMDRRuleGroupInstanceService(
495 MDRRuleGroupInstanceService mdrRuleGroupInstanceService) {
496 this.mdrRuleGroupInstanceService = mdrRuleGroupInstanceService;
497 }
498
499
504 public MDRRuleGroupInstancePersistence getMDRRuleGroupInstancePersistence() {
505 return mdrRuleGroupInstancePersistence;
506 }
507
508
513 public void setMDRRuleGroupInstancePersistence(
514 MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence) {
515 this.mdrRuleGroupInstancePersistence = mdrRuleGroupInstancePersistence;
516 }
517
518
523 public CounterLocalService getCounterLocalService() {
524 return counterLocalService;
525 }
526
527
532 public void setCounterLocalService(CounterLocalService counterLocalService) {
533 this.counterLocalService = counterLocalService;
534 }
535
536
541 public ResourceLocalService getResourceLocalService() {
542 return resourceLocalService;
543 }
544
545
550 public void setResourceLocalService(
551 ResourceLocalService resourceLocalService) {
552 this.resourceLocalService = resourceLocalService;
553 }
554
555
560 public UserLocalService getUserLocalService() {
561 return userLocalService;
562 }
563
564
569 public void setUserLocalService(UserLocalService userLocalService) {
570 this.userLocalService = userLocalService;
571 }
572
573
578 public UserService getUserService() {
579 return userService;
580 }
581
582
587 public void setUserService(UserService userService) {
588 this.userService = userService;
589 }
590
591
596 public UserPersistence getUserPersistence() {
597 return userPersistence;
598 }
599
600
605 public void setUserPersistence(UserPersistence userPersistence) {
606 this.userPersistence = userPersistence;
607 }
608
609
614 public UserFinder getUserFinder() {
615 return userFinder;
616 }
617
618
623 public void setUserFinder(UserFinder userFinder) {
624 this.userFinder = userFinder;
625 }
626
627 public void afterPropertiesSet() {
628 persistedModelLocalServiceRegistry.register("com.liferay.portlet.mobiledevicerules.model.MDRRule",
629 mdrRuleLocalService);
630 }
631
632 public void destroy() {
633 persistedModelLocalServiceRegistry.unregister(
634 "com.liferay.portlet.mobiledevicerules.model.MDRRule");
635 }
636
637
642 public String getBeanIdentifier() {
643 return _beanIdentifier;
644 }
645
646
651 public void setBeanIdentifier(String beanIdentifier) {
652 _beanIdentifier = beanIdentifier;
653 }
654
655 protected Class<?> getModelClass() {
656 return MDRRule.class;
657 }
658
659 protected String getModelClassName() {
660 return MDRRule.class.getName();
661 }
662
663
668 protected void runSQL(String sql) throws SystemException {
669 try {
670 DataSource dataSource = mdrRulePersistence.getDataSource();
671
672 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
673 sql, new int[0]);
674
675 sqlUpdate.update();
676 }
677 catch (Exception e) {
678 throw new SystemException(e);
679 }
680 }
681
682 @BeanReference(type = MDRActionLocalService.class)
683 protected MDRActionLocalService mdrActionLocalService;
684 @BeanReference(type = MDRActionService.class)
685 protected MDRActionService mdrActionService;
686 @BeanReference(type = MDRActionPersistence.class)
687 protected MDRActionPersistence mdrActionPersistence;
688 @BeanReference(type = MDRRuleLocalService.class)
689 protected MDRRuleLocalService mdrRuleLocalService;
690 @BeanReference(type = MDRRuleService.class)
691 protected MDRRuleService mdrRuleService;
692 @BeanReference(type = MDRRulePersistence.class)
693 protected MDRRulePersistence mdrRulePersistence;
694 @BeanReference(type = MDRRuleGroupLocalService.class)
695 protected MDRRuleGroupLocalService mdrRuleGroupLocalService;
696 @BeanReference(type = MDRRuleGroupService.class)
697 protected MDRRuleGroupService mdrRuleGroupService;
698 @BeanReference(type = MDRRuleGroupPersistence.class)
699 protected MDRRuleGroupPersistence mdrRuleGroupPersistence;
700 @BeanReference(type = MDRRuleGroupFinder.class)
701 protected MDRRuleGroupFinder mdrRuleGroupFinder;
702 @BeanReference(type = MDRRuleGroupInstanceLocalService.class)
703 protected MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService;
704 @BeanReference(type = MDRRuleGroupInstanceService.class)
705 protected MDRRuleGroupInstanceService mdrRuleGroupInstanceService;
706 @BeanReference(type = MDRRuleGroupInstancePersistence.class)
707 protected MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence;
708 @BeanReference(type = CounterLocalService.class)
709 protected CounterLocalService counterLocalService;
710 @BeanReference(type = ResourceLocalService.class)
711 protected ResourceLocalService resourceLocalService;
712 @BeanReference(type = UserLocalService.class)
713 protected UserLocalService userLocalService;
714 @BeanReference(type = UserService.class)
715 protected UserService userService;
716 @BeanReference(type = UserPersistence.class)
717 protected UserPersistence userPersistence;
718 @BeanReference(type = UserFinder.class)
719 protected UserFinder userFinder;
720 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
721 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
722 private String _beanIdentifier;
723 }