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.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.documentlibrary.service.DLFileEntryTypeLocalService;
043 import com.liferay.portlet.documentlibrary.service.DLFileEntryTypeService;
044 import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypeFinder;
045 import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypePersistence;
046 import com.liferay.portlet.dynamicdatamapping.model.DDMStructure;
047 import com.liferay.portlet.dynamicdatamapping.service.DDMContentLocalService;
048 import com.liferay.portlet.dynamicdatamapping.service.DDMStorageLinkLocalService;
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.DDMTemplateLocalService;
053 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateService;
054 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMContentPersistence;
055 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStorageLinkPersistence;
056 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureFinder;
057 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureLinkPersistence;
058 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistence;
059 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplateFinder;
060 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplatePersistence;
061
062 import java.io.Serializable;
063
064 import java.util.List;
065
066 import javax.sql.DataSource;
067
068
080 public abstract class DDMStructureLocalServiceBaseImpl
081 extends BaseLocalServiceImpl implements DDMStructureLocalService,
082 IdentifiableBean {
083
088
089
096 @Indexable(type = IndexableType.REINDEX)
097 public DDMStructure addDDMStructure(DDMStructure ddmStructure)
098 throws SystemException {
099 ddmStructure.setNew(true);
100
101 return ddmStructurePersistence.update(ddmStructure, false);
102 }
103
104
110 public DDMStructure createDDMStructure(long structureId) {
111 return ddmStructurePersistence.create(structureId);
112 }
113
114
122 @Indexable(type = IndexableType.DELETE)
123 public DDMStructure deleteDDMStructure(long structureId)
124 throws PortalException, SystemException {
125 return ddmStructurePersistence.remove(structureId);
126 }
127
128
135 @Indexable(type = IndexableType.DELETE)
136 public DDMStructure deleteDDMStructure(DDMStructure ddmStructure)
137 throws SystemException {
138 return ddmStructurePersistence.remove(ddmStructure);
139 }
140
141 public DynamicQuery dynamicQuery() {
142 Class<?> clazz = getClass();
143
144 return DynamicQueryFactoryUtil.forClass(DDMStructure.class,
145 clazz.getClassLoader());
146 }
147
148
155 @SuppressWarnings("rawtypes")
156 public List dynamicQuery(DynamicQuery dynamicQuery)
157 throws SystemException {
158 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery);
159 }
160
161
174 @SuppressWarnings("rawtypes")
175 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
176 throws SystemException {
177 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery,
178 start, end);
179 }
180
181
195 @SuppressWarnings("rawtypes")
196 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
197 OrderByComparator orderByComparator) throws SystemException {
198 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery,
199 start, end, orderByComparator);
200 }
201
202
209 public long dynamicQueryCount(DynamicQuery dynamicQuery)
210 throws SystemException {
211 return ddmStructurePersistence.countWithDynamicQuery(dynamicQuery);
212 }
213
214 public DDMStructure fetchDDMStructure(long structureId)
215 throws SystemException {
216 return ddmStructurePersistence.fetchByPrimaryKey(structureId);
217 }
218
219
227 public DDMStructure getDDMStructure(long structureId)
228 throws PortalException, SystemException {
229 return ddmStructurePersistence.findByPrimaryKey(structureId);
230 }
231
232 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
233 throws PortalException, SystemException {
234 return ddmStructurePersistence.findByPrimaryKey(primaryKeyObj);
235 }
236
237
246 public DDMStructure getDDMStructureByUuidAndGroupId(String uuid,
247 long groupId) throws PortalException, SystemException {
248 return ddmStructurePersistence.findByUUID_G(uuid, groupId);
249 }
250
251
263 public List<DDMStructure> getDDMStructures(int start, int end)
264 throws SystemException {
265 return ddmStructurePersistence.findAll(start, end);
266 }
267
268
274 public int getDDMStructuresCount() throws SystemException {
275 return ddmStructurePersistence.countAll();
276 }
277
278
285 @Indexable(type = IndexableType.REINDEX)
286 public DDMStructure updateDDMStructure(DDMStructure ddmStructure)
287 throws SystemException {
288 return updateDDMStructure(ddmStructure, true);
289 }
290
291
299 @Indexable(type = IndexableType.REINDEX)
300 public DDMStructure updateDDMStructure(DDMStructure ddmStructure,
301 boolean merge) throws SystemException {
302 ddmStructure.setNew(false);
303
304 return ddmStructurePersistence.update(ddmStructure, merge);
305 }
306
307
312 public DDMContentLocalService getDDMContentLocalService() {
313 return ddmContentLocalService;
314 }
315
316
321 public void setDDMContentLocalService(
322 DDMContentLocalService ddmContentLocalService) {
323 this.ddmContentLocalService = ddmContentLocalService;
324 }
325
326
331 public DDMContentPersistence getDDMContentPersistence() {
332 return ddmContentPersistence;
333 }
334
335
340 public void setDDMContentPersistence(
341 DDMContentPersistence ddmContentPersistence) {
342 this.ddmContentPersistence = ddmContentPersistence;
343 }
344
345
350 public DDMStorageLinkLocalService getDDMStorageLinkLocalService() {
351 return ddmStorageLinkLocalService;
352 }
353
354
359 public void setDDMStorageLinkLocalService(
360 DDMStorageLinkLocalService ddmStorageLinkLocalService) {
361 this.ddmStorageLinkLocalService = ddmStorageLinkLocalService;
362 }
363
364
369 public DDMStorageLinkPersistence getDDMStorageLinkPersistence() {
370 return ddmStorageLinkPersistence;
371 }
372
373
378 public void setDDMStorageLinkPersistence(
379 DDMStorageLinkPersistence ddmStorageLinkPersistence) {
380 this.ddmStorageLinkPersistence = ddmStorageLinkPersistence;
381 }
382
383
388 public DDMStructureLocalService getDDMStructureLocalService() {
389 return ddmStructureLocalService;
390 }
391
392
397 public void setDDMStructureLocalService(
398 DDMStructureLocalService ddmStructureLocalService) {
399 this.ddmStructureLocalService = ddmStructureLocalService;
400 }
401
402
407 public DDMStructureService getDDMStructureService() {
408 return ddmStructureService;
409 }
410
411
416 public void setDDMStructureService(DDMStructureService ddmStructureService) {
417 this.ddmStructureService = ddmStructureService;
418 }
419
420
425 public DDMStructurePersistence getDDMStructurePersistence() {
426 return ddmStructurePersistence;
427 }
428
429
434 public void setDDMStructurePersistence(
435 DDMStructurePersistence ddmStructurePersistence) {
436 this.ddmStructurePersistence = ddmStructurePersistence;
437 }
438
439
444 public DDMStructureFinder getDDMStructureFinder() {
445 return ddmStructureFinder;
446 }
447
448
453 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
454 this.ddmStructureFinder = ddmStructureFinder;
455 }
456
457
462 public DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
463 return ddmStructureLinkLocalService;
464 }
465
466
471 public void setDDMStructureLinkLocalService(
472 DDMStructureLinkLocalService ddmStructureLinkLocalService) {
473 this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
474 }
475
476
481 public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
482 return ddmStructureLinkPersistence;
483 }
484
485
490 public void setDDMStructureLinkPersistence(
491 DDMStructureLinkPersistence ddmStructureLinkPersistence) {
492 this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
493 }
494
495
500 public DDMTemplateLocalService getDDMTemplateLocalService() {
501 return ddmTemplateLocalService;
502 }
503
504
509 public void setDDMTemplateLocalService(
510 DDMTemplateLocalService ddmTemplateLocalService) {
511 this.ddmTemplateLocalService = ddmTemplateLocalService;
512 }
513
514
519 public DDMTemplateService getDDMTemplateService() {
520 return ddmTemplateService;
521 }
522
523
528 public void setDDMTemplateService(DDMTemplateService ddmTemplateService) {
529 this.ddmTemplateService = ddmTemplateService;
530 }
531
532
537 public DDMTemplatePersistence getDDMTemplatePersistence() {
538 return ddmTemplatePersistence;
539 }
540
541
546 public void setDDMTemplatePersistence(
547 DDMTemplatePersistence ddmTemplatePersistence) {
548 this.ddmTemplatePersistence = ddmTemplatePersistence;
549 }
550
551
556 public DDMTemplateFinder getDDMTemplateFinder() {
557 return ddmTemplateFinder;
558 }
559
560
565 public void setDDMTemplateFinder(DDMTemplateFinder ddmTemplateFinder) {
566 this.ddmTemplateFinder = ddmTemplateFinder;
567 }
568
569
574 public CounterLocalService getCounterLocalService() {
575 return counterLocalService;
576 }
577
578
583 public void setCounterLocalService(CounterLocalService counterLocalService) {
584 this.counterLocalService = counterLocalService;
585 }
586
587
592 public ResourceLocalService getResourceLocalService() {
593 return resourceLocalService;
594 }
595
596
601 public void setResourceLocalService(
602 ResourceLocalService resourceLocalService) {
603 this.resourceLocalService = resourceLocalService;
604 }
605
606
611 public ResourceService getResourceService() {
612 return resourceService;
613 }
614
615
620 public void setResourceService(ResourceService resourceService) {
621 this.resourceService = resourceService;
622 }
623
624
629 public ResourcePersistence getResourcePersistence() {
630 return resourcePersistence;
631 }
632
633
638 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
639 this.resourcePersistence = resourcePersistence;
640 }
641
642
647 public ResourceFinder getResourceFinder() {
648 return resourceFinder;
649 }
650
651
656 public void setResourceFinder(ResourceFinder resourceFinder) {
657 this.resourceFinder = resourceFinder;
658 }
659
660
665 public UserLocalService getUserLocalService() {
666 return userLocalService;
667 }
668
669
674 public void setUserLocalService(UserLocalService userLocalService) {
675 this.userLocalService = userLocalService;
676 }
677
678
683 public UserService getUserService() {
684 return userService;
685 }
686
687
692 public void setUserService(UserService userService) {
693 this.userService = userService;
694 }
695
696
701 public UserPersistence getUserPersistence() {
702 return userPersistence;
703 }
704
705
710 public void setUserPersistence(UserPersistence userPersistence) {
711 this.userPersistence = userPersistence;
712 }
713
714
719 public UserFinder getUserFinder() {
720 return userFinder;
721 }
722
723
728 public void setUserFinder(UserFinder userFinder) {
729 this.userFinder = userFinder;
730 }
731
732
737 public DLFileEntryTypeLocalService getDLFileEntryTypeLocalService() {
738 return dlFileEntryTypeLocalService;
739 }
740
741
746 public void setDLFileEntryTypeLocalService(
747 DLFileEntryTypeLocalService dlFileEntryTypeLocalService) {
748 this.dlFileEntryTypeLocalService = dlFileEntryTypeLocalService;
749 }
750
751
756 public DLFileEntryTypeService getDLFileEntryTypeService() {
757 return dlFileEntryTypeService;
758 }
759
760
765 public void setDLFileEntryTypeService(
766 DLFileEntryTypeService dlFileEntryTypeService) {
767 this.dlFileEntryTypeService = dlFileEntryTypeService;
768 }
769
770
775 public DLFileEntryTypePersistence getDLFileEntryTypePersistence() {
776 return dlFileEntryTypePersistence;
777 }
778
779
784 public void setDLFileEntryTypePersistence(
785 DLFileEntryTypePersistence dlFileEntryTypePersistence) {
786 this.dlFileEntryTypePersistence = dlFileEntryTypePersistence;
787 }
788
789
794 public DLFileEntryTypeFinder getDLFileEntryTypeFinder() {
795 return dlFileEntryTypeFinder;
796 }
797
798
803 public void setDLFileEntryTypeFinder(
804 DLFileEntryTypeFinder dlFileEntryTypeFinder) {
805 this.dlFileEntryTypeFinder = dlFileEntryTypeFinder;
806 }
807
808 public void afterPropertiesSet() {
809 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatamapping.model.DDMStructure",
810 ddmStructureLocalService);
811 }
812
813 public void destroy() {
814 persistedModelLocalServiceRegistry.unregister(
815 "com.liferay.portlet.dynamicdatamapping.model.DDMStructure");
816 }
817
818
823 public String getBeanIdentifier() {
824 return _beanIdentifier;
825 }
826
827
832 public void setBeanIdentifier(String beanIdentifier) {
833 _beanIdentifier = beanIdentifier;
834 }
835
836 protected Class<?> getModelClass() {
837 return DDMStructure.class;
838 }
839
840 protected String getModelClassName() {
841 return DDMStructure.class.getName();
842 }
843
844
849 protected void runSQL(String sql) throws SystemException {
850 try {
851 DataSource dataSource = ddmStructurePersistence.getDataSource();
852
853 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
854 sql, new int[0]);
855
856 sqlUpdate.update();
857 }
858 catch (Exception e) {
859 throw new SystemException(e);
860 }
861 }
862
863 @BeanReference(type = DDMContentLocalService.class)
864 protected DDMContentLocalService ddmContentLocalService;
865 @BeanReference(type = DDMContentPersistence.class)
866 protected DDMContentPersistence ddmContentPersistence;
867 @BeanReference(type = DDMStorageLinkLocalService.class)
868 protected DDMStorageLinkLocalService ddmStorageLinkLocalService;
869 @BeanReference(type = DDMStorageLinkPersistence.class)
870 protected DDMStorageLinkPersistence ddmStorageLinkPersistence;
871 @BeanReference(type = DDMStructureLocalService.class)
872 protected DDMStructureLocalService ddmStructureLocalService;
873 @BeanReference(type = DDMStructureService.class)
874 protected DDMStructureService ddmStructureService;
875 @BeanReference(type = DDMStructurePersistence.class)
876 protected DDMStructurePersistence ddmStructurePersistence;
877 @BeanReference(type = DDMStructureFinder.class)
878 protected DDMStructureFinder ddmStructureFinder;
879 @BeanReference(type = DDMStructureLinkLocalService.class)
880 protected DDMStructureLinkLocalService ddmStructureLinkLocalService;
881 @BeanReference(type = DDMStructureLinkPersistence.class)
882 protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
883 @BeanReference(type = DDMTemplateLocalService.class)
884 protected DDMTemplateLocalService ddmTemplateLocalService;
885 @BeanReference(type = DDMTemplateService.class)
886 protected DDMTemplateService ddmTemplateService;
887 @BeanReference(type = DDMTemplatePersistence.class)
888 protected DDMTemplatePersistence ddmTemplatePersistence;
889 @BeanReference(type = DDMTemplateFinder.class)
890 protected DDMTemplateFinder ddmTemplateFinder;
891 @BeanReference(type = CounterLocalService.class)
892 protected CounterLocalService counterLocalService;
893 @BeanReference(type = ResourceLocalService.class)
894 protected ResourceLocalService resourceLocalService;
895 @BeanReference(type = ResourceService.class)
896 protected ResourceService resourceService;
897 @BeanReference(type = ResourcePersistence.class)
898 protected ResourcePersistence resourcePersistence;
899 @BeanReference(type = ResourceFinder.class)
900 protected ResourceFinder resourceFinder;
901 @BeanReference(type = UserLocalService.class)
902 protected UserLocalService userLocalService;
903 @BeanReference(type = UserService.class)
904 protected UserService userService;
905 @BeanReference(type = UserPersistence.class)
906 protected UserPersistence userPersistence;
907 @BeanReference(type = UserFinder.class)
908 protected UserFinder userFinder;
909 @BeanReference(type = DLFileEntryTypeLocalService.class)
910 protected DLFileEntryTypeLocalService dlFileEntryTypeLocalService;
911 @BeanReference(type = DLFileEntryTypeService.class)
912 protected DLFileEntryTypeService dlFileEntryTypeService;
913 @BeanReference(type = DLFileEntryTypePersistence.class)
914 protected DLFileEntryTypePersistence dlFileEntryTypePersistence;
915 @BeanReference(type = DLFileEntryTypeFinder.class)
916 protected DLFileEntryTypeFinder dlFileEntryTypeFinder;
917 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
918 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
919 private String _beanIdentifier;
920 }