001
014
015 package com.liferay.portlet.dynamicdatalists.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.dynamicdatalists.model.DDLRecordSet;
040 import com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService;
041 import com.liferay.portlet.dynamicdatalists.service.DDLRecordService;
042 import com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalService;
043 import com.liferay.portlet.dynamicdatalists.service.DDLRecordSetService;
044 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordFinder;
045 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordPersistence;
046 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordSetFinder;
047 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordSetPersistence;
048 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordVersionPersistence;
049 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService;
050 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService;
051 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureService;
052 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureFinder;
053 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureLinkPersistence;
054 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistence;
055
056 import java.io.Serializable;
057
058 import java.util.List;
059
060 import javax.sql.DataSource;
061
062
074 public abstract class DDLRecordSetLocalServiceBaseImpl
075 extends BaseLocalServiceImpl implements DDLRecordSetLocalService,
076 IdentifiableBean {
077
082
083
090 @Indexable(type = IndexableType.REINDEX)
091 public DDLRecordSet addDDLRecordSet(DDLRecordSet ddlRecordSet)
092 throws SystemException {
093 ddlRecordSet.setNew(true);
094
095 return ddlRecordSetPersistence.update(ddlRecordSet);
096 }
097
098
104 public DDLRecordSet createDDLRecordSet(long recordSetId) {
105 return ddlRecordSetPersistence.create(recordSetId);
106 }
107
108
116 @Indexable(type = IndexableType.DELETE)
117 public DDLRecordSet deleteDDLRecordSet(long recordSetId)
118 throws PortalException, SystemException {
119 return ddlRecordSetPersistence.remove(recordSetId);
120 }
121
122
129 @Indexable(type = IndexableType.DELETE)
130 public DDLRecordSet deleteDDLRecordSet(DDLRecordSet ddlRecordSet)
131 throws SystemException {
132 return ddlRecordSetPersistence.remove(ddlRecordSet);
133 }
134
135 public DynamicQuery dynamicQuery() {
136 Class<?> clazz = getClass();
137
138 return DynamicQueryFactoryUtil.forClass(DDLRecordSet.class,
139 clazz.getClassLoader());
140 }
141
142
149 @SuppressWarnings("rawtypes")
150 public List dynamicQuery(DynamicQuery dynamicQuery)
151 throws SystemException {
152 return ddlRecordSetPersistence.findWithDynamicQuery(dynamicQuery);
153 }
154
155
168 @SuppressWarnings("rawtypes")
169 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
170 throws SystemException {
171 return ddlRecordSetPersistence.findWithDynamicQuery(dynamicQuery,
172 start, end);
173 }
174
175
189 @SuppressWarnings("rawtypes")
190 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
191 OrderByComparator orderByComparator) throws SystemException {
192 return ddlRecordSetPersistence.findWithDynamicQuery(dynamicQuery,
193 start, end, orderByComparator);
194 }
195
196
203 public long dynamicQueryCount(DynamicQuery dynamicQuery)
204 throws SystemException {
205 return ddlRecordSetPersistence.countWithDynamicQuery(dynamicQuery);
206 }
207
208 public DDLRecordSet fetchDDLRecordSet(long recordSetId)
209 throws SystemException {
210 return ddlRecordSetPersistence.fetchByPrimaryKey(recordSetId);
211 }
212
213
221 public DDLRecordSet getDDLRecordSet(long recordSetId)
222 throws PortalException, SystemException {
223 return ddlRecordSetPersistence.findByPrimaryKey(recordSetId);
224 }
225
226 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
227 throws PortalException, SystemException {
228 return ddlRecordSetPersistence.findByPrimaryKey(primaryKeyObj);
229 }
230
231
240 public DDLRecordSet getDDLRecordSetByUuidAndGroupId(String uuid,
241 long groupId) throws PortalException, SystemException {
242 return ddlRecordSetPersistence.findByUUID_G(uuid, groupId);
243 }
244
245
257 public List<DDLRecordSet> getDDLRecordSets(int start, int end)
258 throws SystemException {
259 return ddlRecordSetPersistence.findAll(start, end);
260 }
261
262
268 public int getDDLRecordSetsCount() throws SystemException {
269 return ddlRecordSetPersistence.countAll();
270 }
271
272
279 @Indexable(type = IndexableType.REINDEX)
280 public DDLRecordSet updateDDLRecordSet(DDLRecordSet ddlRecordSet)
281 throws SystemException {
282 return ddlRecordSetPersistence.update(ddlRecordSet);
283 }
284
285
290 public DDLRecordLocalService getDDLRecordLocalService() {
291 return ddlRecordLocalService;
292 }
293
294
299 public void setDDLRecordLocalService(
300 DDLRecordLocalService ddlRecordLocalService) {
301 this.ddlRecordLocalService = ddlRecordLocalService;
302 }
303
304
309 public DDLRecordService getDDLRecordService() {
310 return ddlRecordService;
311 }
312
313
318 public void setDDLRecordService(DDLRecordService ddlRecordService) {
319 this.ddlRecordService = ddlRecordService;
320 }
321
322
327 public DDLRecordPersistence getDDLRecordPersistence() {
328 return ddlRecordPersistence;
329 }
330
331
336 public void setDDLRecordPersistence(
337 DDLRecordPersistence ddlRecordPersistence) {
338 this.ddlRecordPersistence = ddlRecordPersistence;
339 }
340
341
346 public DDLRecordFinder getDDLRecordFinder() {
347 return ddlRecordFinder;
348 }
349
350
355 public void setDDLRecordFinder(DDLRecordFinder ddlRecordFinder) {
356 this.ddlRecordFinder = ddlRecordFinder;
357 }
358
359
364 public DDLRecordSetLocalService getDDLRecordSetLocalService() {
365 return ddlRecordSetLocalService;
366 }
367
368
373 public void setDDLRecordSetLocalService(
374 DDLRecordSetLocalService ddlRecordSetLocalService) {
375 this.ddlRecordSetLocalService = ddlRecordSetLocalService;
376 }
377
378
383 public DDLRecordSetService getDDLRecordSetService() {
384 return ddlRecordSetService;
385 }
386
387
392 public void setDDLRecordSetService(DDLRecordSetService ddlRecordSetService) {
393 this.ddlRecordSetService = ddlRecordSetService;
394 }
395
396
401 public DDLRecordSetPersistence getDDLRecordSetPersistence() {
402 return ddlRecordSetPersistence;
403 }
404
405
410 public void setDDLRecordSetPersistence(
411 DDLRecordSetPersistence ddlRecordSetPersistence) {
412 this.ddlRecordSetPersistence = ddlRecordSetPersistence;
413 }
414
415
420 public DDLRecordSetFinder getDDLRecordSetFinder() {
421 return ddlRecordSetFinder;
422 }
423
424
429 public void setDDLRecordSetFinder(DDLRecordSetFinder ddlRecordSetFinder) {
430 this.ddlRecordSetFinder = ddlRecordSetFinder;
431 }
432
433
438 public DDLRecordVersionPersistence getDDLRecordVersionPersistence() {
439 return ddlRecordVersionPersistence;
440 }
441
442
447 public void setDDLRecordVersionPersistence(
448 DDLRecordVersionPersistence ddlRecordVersionPersistence) {
449 this.ddlRecordVersionPersistence = ddlRecordVersionPersistence;
450 }
451
452
457 public CounterLocalService getCounterLocalService() {
458 return counterLocalService;
459 }
460
461
466 public void setCounterLocalService(CounterLocalService counterLocalService) {
467 this.counterLocalService = counterLocalService;
468 }
469
470
475 public ResourceLocalService getResourceLocalService() {
476 return resourceLocalService;
477 }
478
479
484 public void setResourceLocalService(
485 ResourceLocalService resourceLocalService) {
486 this.resourceLocalService = resourceLocalService;
487 }
488
489
494 public UserLocalService getUserLocalService() {
495 return userLocalService;
496 }
497
498
503 public void setUserLocalService(UserLocalService userLocalService) {
504 this.userLocalService = userLocalService;
505 }
506
507
512 public UserService getUserService() {
513 return userService;
514 }
515
516
521 public void setUserService(UserService userService) {
522 this.userService = userService;
523 }
524
525
530 public UserPersistence getUserPersistence() {
531 return userPersistence;
532 }
533
534
539 public void setUserPersistence(UserPersistence userPersistence) {
540 this.userPersistence = userPersistence;
541 }
542
543
548 public UserFinder getUserFinder() {
549 return userFinder;
550 }
551
552
557 public void setUserFinder(UserFinder userFinder) {
558 this.userFinder = userFinder;
559 }
560
561
566 public DDMStructureLocalService getDDMStructureLocalService() {
567 return ddmStructureLocalService;
568 }
569
570
575 public void setDDMStructureLocalService(
576 DDMStructureLocalService ddmStructureLocalService) {
577 this.ddmStructureLocalService = ddmStructureLocalService;
578 }
579
580
585 public DDMStructureService getDDMStructureService() {
586 return ddmStructureService;
587 }
588
589
594 public void setDDMStructureService(DDMStructureService ddmStructureService) {
595 this.ddmStructureService = ddmStructureService;
596 }
597
598
603 public DDMStructurePersistence getDDMStructurePersistence() {
604 return ddmStructurePersistence;
605 }
606
607
612 public void setDDMStructurePersistence(
613 DDMStructurePersistence ddmStructurePersistence) {
614 this.ddmStructurePersistence = ddmStructurePersistence;
615 }
616
617
622 public DDMStructureFinder getDDMStructureFinder() {
623 return ddmStructureFinder;
624 }
625
626
631 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
632 this.ddmStructureFinder = ddmStructureFinder;
633 }
634
635
640 public DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
641 return ddmStructureLinkLocalService;
642 }
643
644
649 public void setDDMStructureLinkLocalService(
650 DDMStructureLinkLocalService ddmStructureLinkLocalService) {
651 this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
652 }
653
654
659 public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
660 return ddmStructureLinkPersistence;
661 }
662
663
668 public void setDDMStructureLinkPersistence(
669 DDMStructureLinkPersistence ddmStructureLinkPersistence) {
670 this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
671 }
672
673 public void afterPropertiesSet() {
674 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatalists.model.DDLRecordSet",
675 ddlRecordSetLocalService);
676 }
677
678 public void destroy() {
679 persistedModelLocalServiceRegistry.unregister(
680 "com.liferay.portlet.dynamicdatalists.model.DDLRecordSet");
681 }
682
683
688 public String getBeanIdentifier() {
689 return _beanIdentifier;
690 }
691
692
697 public void setBeanIdentifier(String beanIdentifier) {
698 _beanIdentifier = beanIdentifier;
699 }
700
701 protected Class<?> getModelClass() {
702 return DDLRecordSet.class;
703 }
704
705 protected String getModelClassName() {
706 return DDLRecordSet.class.getName();
707 }
708
709
714 protected void runSQL(String sql) throws SystemException {
715 try {
716 DataSource dataSource = ddlRecordSetPersistence.getDataSource();
717
718 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
719 sql, new int[0]);
720
721 sqlUpdate.update();
722 }
723 catch (Exception e) {
724 throw new SystemException(e);
725 }
726 }
727
728 @BeanReference(type = DDLRecordLocalService.class)
729 protected DDLRecordLocalService ddlRecordLocalService;
730 @BeanReference(type = DDLRecordService.class)
731 protected DDLRecordService ddlRecordService;
732 @BeanReference(type = DDLRecordPersistence.class)
733 protected DDLRecordPersistence ddlRecordPersistence;
734 @BeanReference(type = DDLRecordFinder.class)
735 protected DDLRecordFinder ddlRecordFinder;
736 @BeanReference(type = DDLRecordSetLocalService.class)
737 protected DDLRecordSetLocalService ddlRecordSetLocalService;
738 @BeanReference(type = DDLRecordSetService.class)
739 protected DDLRecordSetService ddlRecordSetService;
740 @BeanReference(type = DDLRecordSetPersistence.class)
741 protected DDLRecordSetPersistence ddlRecordSetPersistence;
742 @BeanReference(type = DDLRecordSetFinder.class)
743 protected DDLRecordSetFinder ddlRecordSetFinder;
744 @BeanReference(type = DDLRecordVersionPersistence.class)
745 protected DDLRecordVersionPersistence ddlRecordVersionPersistence;
746 @BeanReference(type = CounterLocalService.class)
747 protected CounterLocalService counterLocalService;
748 @BeanReference(type = ResourceLocalService.class)
749 protected ResourceLocalService resourceLocalService;
750 @BeanReference(type = UserLocalService.class)
751 protected UserLocalService userLocalService;
752 @BeanReference(type = UserService.class)
753 protected UserService userService;
754 @BeanReference(type = UserPersistence.class)
755 protected UserPersistence userPersistence;
756 @BeanReference(type = UserFinder.class)
757 protected UserFinder userFinder;
758 @BeanReference(type = DDMStructureLocalService.class)
759 protected DDMStructureLocalService ddmStructureLocalService;
760 @BeanReference(type = DDMStructureService.class)
761 protected DDMStructureService ddmStructureService;
762 @BeanReference(type = DDMStructurePersistence.class)
763 protected DDMStructurePersistence ddmStructurePersistence;
764 @BeanReference(type = DDMStructureFinder.class)
765 protected DDMStructureFinder ddmStructureFinder;
766 @BeanReference(type = DDMStructureLinkLocalService.class)
767 protected DDMStructureLinkLocalService ddmStructureLinkLocalService;
768 @BeanReference(type = DDMStructureLinkPersistence.class)
769 protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
770 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
771 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
772 private String _beanIdentifier;
773 }