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.ResourceService;
035 import com.liferay.portal.service.UserLocalService;
036 import com.liferay.portal.service.UserService;
037 import com.liferay.portal.service.WorkflowInstanceLinkLocalService;
038 import com.liferay.portal.service.persistence.ResourceFinder;
039 import com.liferay.portal.service.persistence.ResourcePersistence;
040 import com.liferay.portal.service.persistence.UserFinder;
041 import com.liferay.portal.service.persistence.UserPersistence;
042 import com.liferay.portal.service.persistence.WorkflowInstanceLinkPersistence;
043
044 import com.liferay.portlet.asset.service.AssetEntryLocalService;
045 import com.liferay.portlet.asset.service.AssetEntryService;
046 import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
047 import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
048 import com.liferay.portlet.dynamicdatalists.model.DDLRecord;
049 import com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService;
050 import com.liferay.portlet.dynamicdatalists.service.DDLRecordService;
051 import com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalService;
052 import com.liferay.portlet.dynamicdatalists.service.DDLRecordSetService;
053 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordFinder;
054 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordPersistence;
055 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordSetFinder;
056 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordSetPersistence;
057 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordVersionPersistence;
058 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService;
059 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureService;
060 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureFinder;
061 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistence;
062
063 import java.io.Serializable;
064
065 import java.util.List;
066
067 import javax.sql.DataSource;
068
069
081 public abstract class DDLRecordLocalServiceBaseImpl extends BaseLocalServiceImpl
082 implements DDLRecordLocalService, IdentifiableBean {
083
088
089
096 @Indexable(type = IndexableType.REINDEX)
097 public DDLRecord addDDLRecord(DDLRecord ddlRecord)
098 throws SystemException {
099 ddlRecord.setNew(true);
100
101 return ddlRecordPersistence.update(ddlRecord, false);
102 }
103
104
110 public DDLRecord createDDLRecord(long recordId) {
111 return ddlRecordPersistence.create(recordId);
112 }
113
114
122 @Indexable(type = IndexableType.DELETE)
123 public DDLRecord deleteDDLRecord(long recordId)
124 throws PortalException, SystemException {
125 return ddlRecordPersistence.remove(recordId);
126 }
127
128
135 @Indexable(type = IndexableType.DELETE)
136 public DDLRecord deleteDDLRecord(DDLRecord ddlRecord)
137 throws SystemException {
138 return ddlRecordPersistence.remove(ddlRecord);
139 }
140
141 public DynamicQuery dynamicQuery() {
142 Class<?> clazz = getClass();
143
144 return DynamicQueryFactoryUtil.forClass(DDLRecord.class,
145 clazz.getClassLoader());
146 }
147
148
155 @SuppressWarnings("rawtypes")
156 public List dynamicQuery(DynamicQuery dynamicQuery)
157 throws SystemException {
158 return ddlRecordPersistence.findWithDynamicQuery(dynamicQuery);
159 }
160
161
174 @SuppressWarnings("rawtypes")
175 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
176 throws SystemException {
177 return ddlRecordPersistence.findWithDynamicQuery(dynamicQuery, start,
178 end);
179 }
180
181
195 @SuppressWarnings("rawtypes")
196 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
197 OrderByComparator orderByComparator) throws SystemException {
198 return ddlRecordPersistence.findWithDynamicQuery(dynamicQuery, start,
199 end, orderByComparator);
200 }
201
202
209 public long dynamicQueryCount(DynamicQuery dynamicQuery)
210 throws SystemException {
211 return ddlRecordPersistence.countWithDynamicQuery(dynamicQuery);
212 }
213
214 public DDLRecord fetchDDLRecord(long recordId) throws SystemException {
215 return ddlRecordPersistence.fetchByPrimaryKey(recordId);
216 }
217
218
226 public DDLRecord getDDLRecord(long recordId)
227 throws PortalException, SystemException {
228 return ddlRecordPersistence.findByPrimaryKey(recordId);
229 }
230
231 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
232 throws PortalException, SystemException {
233 return ddlRecordPersistence.findByPrimaryKey(primaryKeyObj);
234 }
235
236
245 public DDLRecord getDDLRecordByUuidAndGroupId(String uuid, long groupId)
246 throws PortalException, SystemException {
247 return ddlRecordPersistence.findByUUID_G(uuid, groupId);
248 }
249
250
262 public List<DDLRecord> getDDLRecords(int start, int end)
263 throws SystemException {
264 return ddlRecordPersistence.findAll(start, end);
265 }
266
267
273 public int getDDLRecordsCount() throws SystemException {
274 return ddlRecordPersistence.countAll();
275 }
276
277
284 @Indexable(type = IndexableType.REINDEX)
285 public DDLRecord updateDDLRecord(DDLRecord ddlRecord)
286 throws SystemException {
287 return updateDDLRecord(ddlRecord, true);
288 }
289
290
298 @Indexable(type = IndexableType.REINDEX)
299 public DDLRecord updateDDLRecord(DDLRecord ddlRecord, boolean merge)
300 throws SystemException {
301 ddlRecord.setNew(false);
302
303 return ddlRecordPersistence.update(ddlRecord, merge);
304 }
305
306
311 public DDLRecordLocalService getDDLRecordLocalService() {
312 return ddlRecordLocalService;
313 }
314
315
320 public void setDDLRecordLocalService(
321 DDLRecordLocalService ddlRecordLocalService) {
322 this.ddlRecordLocalService = ddlRecordLocalService;
323 }
324
325
330 public DDLRecordService getDDLRecordService() {
331 return ddlRecordService;
332 }
333
334
339 public void setDDLRecordService(DDLRecordService ddlRecordService) {
340 this.ddlRecordService = ddlRecordService;
341 }
342
343
348 public DDLRecordPersistence getDDLRecordPersistence() {
349 return ddlRecordPersistence;
350 }
351
352
357 public void setDDLRecordPersistence(
358 DDLRecordPersistence ddlRecordPersistence) {
359 this.ddlRecordPersistence = ddlRecordPersistence;
360 }
361
362
367 public DDLRecordFinder getDDLRecordFinder() {
368 return ddlRecordFinder;
369 }
370
371
376 public void setDDLRecordFinder(DDLRecordFinder ddlRecordFinder) {
377 this.ddlRecordFinder = ddlRecordFinder;
378 }
379
380
385 public DDLRecordSetLocalService getDDLRecordSetLocalService() {
386 return ddlRecordSetLocalService;
387 }
388
389
394 public void setDDLRecordSetLocalService(
395 DDLRecordSetLocalService ddlRecordSetLocalService) {
396 this.ddlRecordSetLocalService = ddlRecordSetLocalService;
397 }
398
399
404 public DDLRecordSetService getDDLRecordSetService() {
405 return ddlRecordSetService;
406 }
407
408
413 public void setDDLRecordSetService(DDLRecordSetService ddlRecordSetService) {
414 this.ddlRecordSetService = ddlRecordSetService;
415 }
416
417
422 public DDLRecordSetPersistence getDDLRecordSetPersistence() {
423 return ddlRecordSetPersistence;
424 }
425
426
431 public void setDDLRecordSetPersistence(
432 DDLRecordSetPersistence ddlRecordSetPersistence) {
433 this.ddlRecordSetPersistence = ddlRecordSetPersistence;
434 }
435
436
441 public DDLRecordSetFinder getDDLRecordSetFinder() {
442 return ddlRecordSetFinder;
443 }
444
445
450 public void setDDLRecordSetFinder(DDLRecordSetFinder ddlRecordSetFinder) {
451 this.ddlRecordSetFinder = ddlRecordSetFinder;
452 }
453
454
459 public DDLRecordVersionPersistence getDDLRecordVersionPersistence() {
460 return ddlRecordVersionPersistence;
461 }
462
463
468 public void setDDLRecordVersionPersistence(
469 DDLRecordVersionPersistence ddlRecordVersionPersistence) {
470 this.ddlRecordVersionPersistence = ddlRecordVersionPersistence;
471 }
472
473
478 public CounterLocalService getCounterLocalService() {
479 return counterLocalService;
480 }
481
482
487 public void setCounterLocalService(CounterLocalService counterLocalService) {
488 this.counterLocalService = counterLocalService;
489 }
490
491
496 public ResourceLocalService getResourceLocalService() {
497 return resourceLocalService;
498 }
499
500
505 public void setResourceLocalService(
506 ResourceLocalService resourceLocalService) {
507 this.resourceLocalService = resourceLocalService;
508 }
509
510
515 public ResourceService getResourceService() {
516 return resourceService;
517 }
518
519
524 public void setResourceService(ResourceService resourceService) {
525 this.resourceService = resourceService;
526 }
527
528
533 public ResourcePersistence getResourcePersistence() {
534 return resourcePersistence;
535 }
536
537
542 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
543 this.resourcePersistence = resourcePersistence;
544 }
545
546
551 public ResourceFinder getResourceFinder() {
552 return resourceFinder;
553 }
554
555
560 public void setResourceFinder(ResourceFinder resourceFinder) {
561 this.resourceFinder = resourceFinder;
562 }
563
564
569 public UserLocalService getUserLocalService() {
570 return userLocalService;
571 }
572
573
578 public void setUserLocalService(UserLocalService userLocalService) {
579 this.userLocalService = userLocalService;
580 }
581
582
587 public UserService getUserService() {
588 return userService;
589 }
590
591
596 public void setUserService(UserService userService) {
597 this.userService = userService;
598 }
599
600
605 public UserPersistence getUserPersistence() {
606 return userPersistence;
607 }
608
609
614 public void setUserPersistence(UserPersistence userPersistence) {
615 this.userPersistence = userPersistence;
616 }
617
618
623 public UserFinder getUserFinder() {
624 return userFinder;
625 }
626
627
632 public void setUserFinder(UserFinder userFinder) {
633 this.userFinder = userFinder;
634 }
635
636
641 public WorkflowInstanceLinkLocalService getWorkflowInstanceLinkLocalService() {
642 return workflowInstanceLinkLocalService;
643 }
644
645
650 public void setWorkflowInstanceLinkLocalService(
651 WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService) {
652 this.workflowInstanceLinkLocalService = workflowInstanceLinkLocalService;
653 }
654
655
660 public WorkflowInstanceLinkPersistence getWorkflowInstanceLinkPersistence() {
661 return workflowInstanceLinkPersistence;
662 }
663
664
669 public void setWorkflowInstanceLinkPersistence(
670 WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence) {
671 this.workflowInstanceLinkPersistence = workflowInstanceLinkPersistence;
672 }
673
674
679 public AssetEntryLocalService getAssetEntryLocalService() {
680 return assetEntryLocalService;
681 }
682
683
688 public void setAssetEntryLocalService(
689 AssetEntryLocalService assetEntryLocalService) {
690 this.assetEntryLocalService = assetEntryLocalService;
691 }
692
693
698 public AssetEntryService getAssetEntryService() {
699 return assetEntryService;
700 }
701
702
707 public void setAssetEntryService(AssetEntryService assetEntryService) {
708 this.assetEntryService = assetEntryService;
709 }
710
711
716 public AssetEntryPersistence getAssetEntryPersistence() {
717 return assetEntryPersistence;
718 }
719
720
725 public void setAssetEntryPersistence(
726 AssetEntryPersistence assetEntryPersistence) {
727 this.assetEntryPersistence = assetEntryPersistence;
728 }
729
730
735 public AssetEntryFinder getAssetEntryFinder() {
736 return assetEntryFinder;
737 }
738
739
744 public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
745 this.assetEntryFinder = assetEntryFinder;
746 }
747
748
753 public DDMStructureLocalService getDDMStructureLocalService() {
754 return ddmStructureLocalService;
755 }
756
757
762 public void setDDMStructureLocalService(
763 DDMStructureLocalService ddmStructureLocalService) {
764 this.ddmStructureLocalService = ddmStructureLocalService;
765 }
766
767
772 public DDMStructureService getDDMStructureService() {
773 return ddmStructureService;
774 }
775
776
781 public void setDDMStructureService(DDMStructureService ddmStructureService) {
782 this.ddmStructureService = ddmStructureService;
783 }
784
785
790 public DDMStructurePersistence getDDMStructurePersistence() {
791 return ddmStructurePersistence;
792 }
793
794
799 public void setDDMStructurePersistence(
800 DDMStructurePersistence ddmStructurePersistence) {
801 this.ddmStructurePersistence = ddmStructurePersistence;
802 }
803
804
809 public DDMStructureFinder getDDMStructureFinder() {
810 return ddmStructureFinder;
811 }
812
813
818 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
819 this.ddmStructureFinder = ddmStructureFinder;
820 }
821
822 public void afterPropertiesSet() {
823 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatalists.model.DDLRecord",
824 ddlRecordLocalService);
825 }
826
827 public void destroy() {
828 persistedModelLocalServiceRegistry.unregister(
829 "com.liferay.portlet.dynamicdatalists.model.DDLRecord");
830 }
831
832
837 public String getBeanIdentifier() {
838 return _beanIdentifier;
839 }
840
841
846 public void setBeanIdentifier(String beanIdentifier) {
847 _beanIdentifier = beanIdentifier;
848 }
849
850 protected Class<?> getModelClass() {
851 return DDLRecord.class;
852 }
853
854 protected String getModelClassName() {
855 return DDLRecord.class.getName();
856 }
857
858
863 protected void runSQL(String sql) throws SystemException {
864 try {
865 DataSource dataSource = ddlRecordPersistence.getDataSource();
866
867 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
868 sql, new int[0]);
869
870 sqlUpdate.update();
871 }
872 catch (Exception e) {
873 throw new SystemException(e);
874 }
875 }
876
877 @BeanReference(type = DDLRecordLocalService.class)
878 protected DDLRecordLocalService ddlRecordLocalService;
879 @BeanReference(type = DDLRecordService.class)
880 protected DDLRecordService ddlRecordService;
881 @BeanReference(type = DDLRecordPersistence.class)
882 protected DDLRecordPersistence ddlRecordPersistence;
883 @BeanReference(type = DDLRecordFinder.class)
884 protected DDLRecordFinder ddlRecordFinder;
885 @BeanReference(type = DDLRecordSetLocalService.class)
886 protected DDLRecordSetLocalService ddlRecordSetLocalService;
887 @BeanReference(type = DDLRecordSetService.class)
888 protected DDLRecordSetService ddlRecordSetService;
889 @BeanReference(type = DDLRecordSetPersistence.class)
890 protected DDLRecordSetPersistence ddlRecordSetPersistence;
891 @BeanReference(type = DDLRecordSetFinder.class)
892 protected DDLRecordSetFinder ddlRecordSetFinder;
893 @BeanReference(type = DDLRecordVersionPersistence.class)
894 protected DDLRecordVersionPersistence ddlRecordVersionPersistence;
895 @BeanReference(type = CounterLocalService.class)
896 protected CounterLocalService counterLocalService;
897 @BeanReference(type = ResourceLocalService.class)
898 protected ResourceLocalService resourceLocalService;
899 @BeanReference(type = ResourceService.class)
900 protected ResourceService resourceService;
901 @BeanReference(type = ResourcePersistence.class)
902 protected ResourcePersistence resourcePersistence;
903 @BeanReference(type = ResourceFinder.class)
904 protected ResourceFinder resourceFinder;
905 @BeanReference(type = UserLocalService.class)
906 protected UserLocalService userLocalService;
907 @BeanReference(type = UserService.class)
908 protected UserService userService;
909 @BeanReference(type = UserPersistence.class)
910 protected UserPersistence userPersistence;
911 @BeanReference(type = UserFinder.class)
912 protected UserFinder userFinder;
913 @BeanReference(type = WorkflowInstanceLinkLocalService.class)
914 protected WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService;
915 @BeanReference(type = WorkflowInstanceLinkPersistence.class)
916 protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
917 @BeanReference(type = AssetEntryLocalService.class)
918 protected AssetEntryLocalService assetEntryLocalService;
919 @BeanReference(type = AssetEntryService.class)
920 protected AssetEntryService assetEntryService;
921 @BeanReference(type = AssetEntryPersistence.class)
922 protected AssetEntryPersistence assetEntryPersistence;
923 @BeanReference(type = AssetEntryFinder.class)
924 protected AssetEntryFinder assetEntryFinder;
925 @BeanReference(type = DDMStructureLocalService.class)
926 protected DDMStructureLocalService ddmStructureLocalService;
927 @BeanReference(type = DDMStructureService.class)
928 protected DDMStructureService ddmStructureService;
929 @BeanReference(type = DDMStructurePersistence.class)
930 protected DDMStructurePersistence ddmStructurePersistence;
931 @BeanReference(type = DDMStructureFinder.class)
932 protected DDMStructureFinder ddmStructureFinder;
933 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
934 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
935 private String _beanIdentifier;
936 }