001
014
015 package com.liferay.portlet.dynamicdatamapping.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.UserLocalService;
037 import com.liferay.portal.service.UserService;
038 import com.liferay.portal.service.persistence.GroupFinder;
039 import com.liferay.portal.service.persistence.GroupPersistence;
040 import com.liferay.portal.service.persistence.UserFinder;
041 import com.liferay.portal.service.persistence.UserPersistence;
042
043 import com.liferay.portlet.documentlibrary.service.DLFileEntryTypeLocalService;
044 import com.liferay.portlet.documentlibrary.service.DLFileEntryTypeService;
045 import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypeFinder;
046 import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypePersistence;
047 import com.liferay.portlet.dynamicdatamapping.model.DDMStructure;
048 import com.liferay.portlet.dynamicdatamapping.service.DDMContentLocalService;
049 import com.liferay.portlet.dynamicdatamapping.service.DDMStorageLinkLocalService;
050 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService;
051 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService;
052 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureService;
053 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalService;
054 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateService;
055 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMContentPersistence;
056 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStorageLinkPersistence;
057 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureFinder;
058 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureLinkPersistence;
059 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistence;
060 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplateFinder;
061 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplatePersistence;
062
063 import java.io.Serializable;
064
065 import java.util.List;
066
067 import javax.sql.DataSource;
068
069
081 public abstract class DDMStructureLocalServiceBaseImpl
082 extends BaseLocalServiceImpl implements DDMStructureLocalService,
083 IdentifiableBean {
084
089
090
097 @Indexable(type = IndexableType.REINDEX)
098 public DDMStructure addDDMStructure(DDMStructure ddmStructure)
099 throws SystemException {
100 ddmStructure.setNew(true);
101
102 return ddmStructurePersistence.update(ddmStructure);
103 }
104
105
111 public DDMStructure createDDMStructure(long structureId) {
112 return ddmStructurePersistence.create(structureId);
113 }
114
115
123 @Indexable(type = IndexableType.DELETE)
124 public DDMStructure deleteDDMStructure(long structureId)
125 throws PortalException, SystemException {
126 return ddmStructurePersistence.remove(structureId);
127 }
128
129
136 @Indexable(type = IndexableType.DELETE)
137 public DDMStructure deleteDDMStructure(DDMStructure ddmStructure)
138 throws SystemException {
139 return ddmStructurePersistence.remove(ddmStructure);
140 }
141
142 public DynamicQuery dynamicQuery() {
143 Class<?> clazz = getClass();
144
145 return DynamicQueryFactoryUtil.forClass(DDMStructure.class,
146 clazz.getClassLoader());
147 }
148
149
156 @SuppressWarnings("rawtypes")
157 public List dynamicQuery(DynamicQuery dynamicQuery)
158 throws SystemException {
159 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery);
160 }
161
162
175 @SuppressWarnings("rawtypes")
176 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
177 throws SystemException {
178 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery,
179 start, end);
180 }
181
182
196 @SuppressWarnings("rawtypes")
197 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
198 OrderByComparator orderByComparator) throws SystemException {
199 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery,
200 start, end, orderByComparator);
201 }
202
203
210 public long dynamicQueryCount(DynamicQuery dynamicQuery)
211 throws SystemException {
212 return ddmStructurePersistence.countWithDynamicQuery(dynamicQuery);
213 }
214
215 public DDMStructure fetchDDMStructure(long structureId)
216 throws SystemException {
217 return ddmStructurePersistence.fetchByPrimaryKey(structureId);
218 }
219
220
228 public DDMStructure getDDMStructure(long structureId)
229 throws PortalException, SystemException {
230 return ddmStructurePersistence.findByPrimaryKey(structureId);
231 }
232
233 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
234 throws PortalException, SystemException {
235 return ddmStructurePersistence.findByPrimaryKey(primaryKeyObj);
236 }
237
238
247 public DDMStructure getDDMStructureByUuidAndGroupId(String uuid,
248 long groupId) throws PortalException, SystemException {
249 return ddmStructurePersistence.findByUUID_G(uuid, groupId);
250 }
251
252
264 public List<DDMStructure> getDDMStructures(int start, int end)
265 throws SystemException {
266 return ddmStructurePersistence.findAll(start, end);
267 }
268
269
275 public int getDDMStructuresCount() throws SystemException {
276 return ddmStructurePersistence.countAll();
277 }
278
279
286 @Indexable(type = IndexableType.REINDEX)
287 public DDMStructure updateDDMStructure(DDMStructure ddmStructure)
288 throws SystemException {
289 return ddmStructurePersistence.update(ddmStructure);
290 }
291
292
297 public DDMContentLocalService getDDMContentLocalService() {
298 return ddmContentLocalService;
299 }
300
301
306 public void setDDMContentLocalService(
307 DDMContentLocalService ddmContentLocalService) {
308 this.ddmContentLocalService = ddmContentLocalService;
309 }
310
311
316 public DDMContentPersistence getDDMContentPersistence() {
317 return ddmContentPersistence;
318 }
319
320
325 public void setDDMContentPersistence(
326 DDMContentPersistence ddmContentPersistence) {
327 this.ddmContentPersistence = ddmContentPersistence;
328 }
329
330
335 public DDMStorageLinkLocalService getDDMStorageLinkLocalService() {
336 return ddmStorageLinkLocalService;
337 }
338
339
344 public void setDDMStorageLinkLocalService(
345 DDMStorageLinkLocalService ddmStorageLinkLocalService) {
346 this.ddmStorageLinkLocalService = ddmStorageLinkLocalService;
347 }
348
349
354 public DDMStorageLinkPersistence getDDMStorageLinkPersistence() {
355 return ddmStorageLinkPersistence;
356 }
357
358
363 public void setDDMStorageLinkPersistence(
364 DDMStorageLinkPersistence ddmStorageLinkPersistence) {
365 this.ddmStorageLinkPersistence = ddmStorageLinkPersistence;
366 }
367
368
373 public DDMStructureLocalService getDDMStructureLocalService() {
374 return ddmStructureLocalService;
375 }
376
377
382 public void setDDMStructureLocalService(
383 DDMStructureLocalService ddmStructureLocalService) {
384 this.ddmStructureLocalService = ddmStructureLocalService;
385 }
386
387
392 public DDMStructureService getDDMStructureService() {
393 return ddmStructureService;
394 }
395
396
401 public void setDDMStructureService(DDMStructureService ddmStructureService) {
402 this.ddmStructureService = ddmStructureService;
403 }
404
405
410 public DDMStructurePersistence getDDMStructurePersistence() {
411 return ddmStructurePersistence;
412 }
413
414
419 public void setDDMStructurePersistence(
420 DDMStructurePersistence ddmStructurePersistence) {
421 this.ddmStructurePersistence = ddmStructurePersistence;
422 }
423
424
429 public DDMStructureFinder getDDMStructureFinder() {
430 return ddmStructureFinder;
431 }
432
433
438 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
439 this.ddmStructureFinder = ddmStructureFinder;
440 }
441
442
447 public DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
448 return ddmStructureLinkLocalService;
449 }
450
451
456 public void setDDMStructureLinkLocalService(
457 DDMStructureLinkLocalService ddmStructureLinkLocalService) {
458 this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
459 }
460
461
466 public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
467 return ddmStructureLinkPersistence;
468 }
469
470
475 public void setDDMStructureLinkPersistence(
476 DDMStructureLinkPersistence ddmStructureLinkPersistence) {
477 this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
478 }
479
480
485 public DDMTemplateLocalService getDDMTemplateLocalService() {
486 return ddmTemplateLocalService;
487 }
488
489
494 public void setDDMTemplateLocalService(
495 DDMTemplateLocalService ddmTemplateLocalService) {
496 this.ddmTemplateLocalService = ddmTemplateLocalService;
497 }
498
499
504 public DDMTemplateService getDDMTemplateService() {
505 return ddmTemplateService;
506 }
507
508
513 public void setDDMTemplateService(DDMTemplateService ddmTemplateService) {
514 this.ddmTemplateService = ddmTemplateService;
515 }
516
517
522 public DDMTemplatePersistence getDDMTemplatePersistence() {
523 return ddmTemplatePersistence;
524 }
525
526
531 public void setDDMTemplatePersistence(
532 DDMTemplatePersistence ddmTemplatePersistence) {
533 this.ddmTemplatePersistence = ddmTemplatePersistence;
534 }
535
536
541 public DDMTemplateFinder getDDMTemplateFinder() {
542 return ddmTemplateFinder;
543 }
544
545
550 public void setDDMTemplateFinder(DDMTemplateFinder ddmTemplateFinder) {
551 this.ddmTemplateFinder = ddmTemplateFinder;
552 }
553
554
559 public CounterLocalService getCounterLocalService() {
560 return counterLocalService;
561 }
562
563
568 public void setCounterLocalService(CounterLocalService counterLocalService) {
569 this.counterLocalService = counterLocalService;
570 }
571
572
577 public GroupLocalService getGroupLocalService() {
578 return groupLocalService;
579 }
580
581
586 public void setGroupLocalService(GroupLocalService groupLocalService) {
587 this.groupLocalService = groupLocalService;
588 }
589
590
595 public GroupService getGroupService() {
596 return groupService;
597 }
598
599
604 public void setGroupService(GroupService groupService) {
605 this.groupService = groupService;
606 }
607
608
613 public GroupPersistence getGroupPersistence() {
614 return groupPersistence;
615 }
616
617
622 public void setGroupPersistence(GroupPersistence groupPersistence) {
623 this.groupPersistence = groupPersistence;
624 }
625
626
631 public GroupFinder getGroupFinder() {
632 return groupFinder;
633 }
634
635
640 public void setGroupFinder(GroupFinder groupFinder) {
641 this.groupFinder = groupFinder;
642 }
643
644
649 public ResourceLocalService getResourceLocalService() {
650 return resourceLocalService;
651 }
652
653
658 public void setResourceLocalService(
659 ResourceLocalService resourceLocalService) {
660 this.resourceLocalService = resourceLocalService;
661 }
662
663
668 public UserLocalService getUserLocalService() {
669 return userLocalService;
670 }
671
672
677 public void setUserLocalService(UserLocalService userLocalService) {
678 this.userLocalService = userLocalService;
679 }
680
681
686 public UserService getUserService() {
687 return userService;
688 }
689
690
695 public void setUserService(UserService userService) {
696 this.userService = userService;
697 }
698
699
704 public UserPersistence getUserPersistence() {
705 return userPersistence;
706 }
707
708
713 public void setUserPersistence(UserPersistence userPersistence) {
714 this.userPersistence = userPersistence;
715 }
716
717
722 public UserFinder getUserFinder() {
723 return userFinder;
724 }
725
726
731 public void setUserFinder(UserFinder userFinder) {
732 this.userFinder = userFinder;
733 }
734
735
740 public DLFileEntryTypeLocalService getDLFileEntryTypeLocalService() {
741 return dlFileEntryTypeLocalService;
742 }
743
744
749 public void setDLFileEntryTypeLocalService(
750 DLFileEntryTypeLocalService dlFileEntryTypeLocalService) {
751 this.dlFileEntryTypeLocalService = dlFileEntryTypeLocalService;
752 }
753
754
759 public DLFileEntryTypeService getDLFileEntryTypeService() {
760 return dlFileEntryTypeService;
761 }
762
763
768 public void setDLFileEntryTypeService(
769 DLFileEntryTypeService dlFileEntryTypeService) {
770 this.dlFileEntryTypeService = dlFileEntryTypeService;
771 }
772
773
778 public DLFileEntryTypePersistence getDLFileEntryTypePersistence() {
779 return dlFileEntryTypePersistence;
780 }
781
782
787 public void setDLFileEntryTypePersistence(
788 DLFileEntryTypePersistence dlFileEntryTypePersistence) {
789 this.dlFileEntryTypePersistence = dlFileEntryTypePersistence;
790 }
791
792
797 public DLFileEntryTypeFinder getDLFileEntryTypeFinder() {
798 return dlFileEntryTypeFinder;
799 }
800
801
806 public void setDLFileEntryTypeFinder(
807 DLFileEntryTypeFinder dlFileEntryTypeFinder) {
808 this.dlFileEntryTypeFinder = dlFileEntryTypeFinder;
809 }
810
811 public void afterPropertiesSet() {
812 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatamapping.model.DDMStructure",
813 ddmStructureLocalService);
814 }
815
816 public void destroy() {
817 persistedModelLocalServiceRegistry.unregister(
818 "com.liferay.portlet.dynamicdatamapping.model.DDMStructure");
819 }
820
821
826 public String getBeanIdentifier() {
827 return _beanIdentifier;
828 }
829
830
835 public void setBeanIdentifier(String beanIdentifier) {
836 _beanIdentifier = beanIdentifier;
837 }
838
839 protected Class<?> getModelClass() {
840 return DDMStructure.class;
841 }
842
843 protected String getModelClassName() {
844 return DDMStructure.class.getName();
845 }
846
847
852 protected void runSQL(String sql) throws SystemException {
853 try {
854 DataSource dataSource = ddmStructurePersistence.getDataSource();
855
856 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
857 sql, new int[0]);
858
859 sqlUpdate.update();
860 }
861 catch (Exception e) {
862 throw new SystemException(e);
863 }
864 }
865
866 @BeanReference(type = DDMContentLocalService.class)
867 protected DDMContentLocalService ddmContentLocalService;
868 @BeanReference(type = DDMContentPersistence.class)
869 protected DDMContentPersistence ddmContentPersistence;
870 @BeanReference(type = DDMStorageLinkLocalService.class)
871 protected DDMStorageLinkLocalService ddmStorageLinkLocalService;
872 @BeanReference(type = DDMStorageLinkPersistence.class)
873 protected DDMStorageLinkPersistence ddmStorageLinkPersistence;
874 @BeanReference(type = DDMStructureLocalService.class)
875 protected DDMStructureLocalService ddmStructureLocalService;
876 @BeanReference(type = DDMStructureService.class)
877 protected DDMStructureService ddmStructureService;
878 @BeanReference(type = DDMStructurePersistence.class)
879 protected DDMStructurePersistence ddmStructurePersistence;
880 @BeanReference(type = DDMStructureFinder.class)
881 protected DDMStructureFinder ddmStructureFinder;
882 @BeanReference(type = DDMStructureLinkLocalService.class)
883 protected DDMStructureLinkLocalService ddmStructureLinkLocalService;
884 @BeanReference(type = DDMStructureLinkPersistence.class)
885 protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
886 @BeanReference(type = DDMTemplateLocalService.class)
887 protected DDMTemplateLocalService ddmTemplateLocalService;
888 @BeanReference(type = DDMTemplateService.class)
889 protected DDMTemplateService ddmTemplateService;
890 @BeanReference(type = DDMTemplatePersistence.class)
891 protected DDMTemplatePersistence ddmTemplatePersistence;
892 @BeanReference(type = DDMTemplateFinder.class)
893 protected DDMTemplateFinder ddmTemplateFinder;
894 @BeanReference(type = CounterLocalService.class)
895 protected CounterLocalService counterLocalService;
896 @BeanReference(type = GroupLocalService.class)
897 protected GroupLocalService groupLocalService;
898 @BeanReference(type = GroupService.class)
899 protected GroupService groupService;
900 @BeanReference(type = GroupPersistence.class)
901 protected GroupPersistence groupPersistence;
902 @BeanReference(type = GroupFinder.class)
903 protected GroupFinder groupFinder;
904 @BeanReference(type = ResourceLocalService.class)
905 protected ResourceLocalService resourceLocalService;
906 @BeanReference(type = UserLocalService.class)
907 protected UserLocalService userLocalService;
908 @BeanReference(type = UserService.class)
909 protected UserService userService;
910 @BeanReference(type = UserPersistence.class)
911 protected UserPersistence userPersistence;
912 @BeanReference(type = UserFinder.class)
913 protected UserFinder userFinder;
914 @BeanReference(type = DLFileEntryTypeLocalService.class)
915 protected DLFileEntryTypeLocalService dlFileEntryTypeLocalService;
916 @BeanReference(type = DLFileEntryTypeService.class)
917 protected DLFileEntryTypeService dlFileEntryTypeService;
918 @BeanReference(type = DLFileEntryTypePersistence.class)
919 protected DLFileEntryTypePersistence dlFileEntryTypePersistence;
920 @BeanReference(type = DLFileEntryTypeFinder.class)
921 protected DLFileEntryTypeFinder dlFileEntryTypeFinder;
922 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
923 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
924 private String _beanIdentifier;
925 }