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.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.documentlibrary.service.DLFileEntryTypeLocalService;
040 import com.liferay.portlet.documentlibrary.service.DLFileEntryTypeService;
041 import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypeFinder;
042 import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypePersistence;
043 import com.liferay.portlet.dynamicdatamapping.model.DDMStructure;
044 import com.liferay.portlet.dynamicdatamapping.service.DDMContentLocalService;
045 import com.liferay.portlet.dynamicdatamapping.service.DDMStorageLinkLocalService;
046 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService;
047 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService;
048 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureService;
049 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalService;
050 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateService;
051 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMContentPersistence;
052 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStorageLinkPersistence;
053 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureFinder;
054 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureLinkPersistence;
055 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistence;
056 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplateFinder;
057 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplatePersistence;
058
059 import java.io.Serializable;
060
061 import java.util.List;
062
063 import javax.sql.DataSource;
064
065
077 public abstract class DDMStructureLocalServiceBaseImpl
078 extends BaseLocalServiceImpl implements DDMStructureLocalService,
079 IdentifiableBean {
080
085
086
093 @Indexable(type = IndexableType.REINDEX)
094 public DDMStructure addDDMStructure(DDMStructure ddmStructure)
095 throws SystemException {
096 ddmStructure.setNew(true);
097
098 return ddmStructurePersistence.update(ddmStructure);
099 }
100
101
107 public DDMStructure createDDMStructure(long structureId) {
108 return ddmStructurePersistence.create(structureId);
109 }
110
111
119 @Indexable(type = IndexableType.DELETE)
120 public DDMStructure deleteDDMStructure(long structureId)
121 throws PortalException, SystemException {
122 return ddmStructurePersistence.remove(structureId);
123 }
124
125
132 @Indexable(type = IndexableType.DELETE)
133 public DDMStructure deleteDDMStructure(DDMStructure ddmStructure)
134 throws SystemException {
135 return ddmStructurePersistence.remove(ddmStructure);
136 }
137
138 public DynamicQuery dynamicQuery() {
139 Class<?> clazz = getClass();
140
141 return DynamicQueryFactoryUtil.forClass(DDMStructure.class,
142 clazz.getClassLoader());
143 }
144
145
152 @SuppressWarnings("rawtypes")
153 public List dynamicQuery(DynamicQuery dynamicQuery)
154 throws SystemException {
155 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery);
156 }
157
158
171 @SuppressWarnings("rawtypes")
172 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
173 throws SystemException {
174 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery,
175 start, end);
176 }
177
178
192 @SuppressWarnings("rawtypes")
193 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
194 OrderByComparator orderByComparator) throws SystemException {
195 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery,
196 start, end, orderByComparator);
197 }
198
199
206 public long dynamicQueryCount(DynamicQuery dynamicQuery)
207 throws SystemException {
208 return ddmStructurePersistence.countWithDynamicQuery(dynamicQuery);
209 }
210
211 public DDMStructure fetchDDMStructure(long structureId)
212 throws SystemException {
213 return ddmStructurePersistence.fetchByPrimaryKey(structureId);
214 }
215
216
224 public DDMStructure getDDMStructure(long structureId)
225 throws PortalException, SystemException {
226 return ddmStructurePersistence.findByPrimaryKey(structureId);
227 }
228
229 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
230 throws PortalException, SystemException {
231 return ddmStructurePersistence.findByPrimaryKey(primaryKeyObj);
232 }
233
234
243 public DDMStructure getDDMStructureByUuidAndGroupId(String uuid,
244 long groupId) throws PortalException, SystemException {
245 return ddmStructurePersistence.findByUUID_G(uuid, groupId);
246 }
247
248
260 public List<DDMStructure> getDDMStructures(int start, int end)
261 throws SystemException {
262 return ddmStructurePersistence.findAll(start, end);
263 }
264
265
271 public int getDDMStructuresCount() throws SystemException {
272 return ddmStructurePersistence.countAll();
273 }
274
275
282 @Indexable(type = IndexableType.REINDEX)
283 public DDMStructure updateDDMStructure(DDMStructure ddmStructure)
284 throws SystemException {
285 return ddmStructurePersistence.update(ddmStructure);
286 }
287
288
293 public DDMContentLocalService getDDMContentLocalService() {
294 return ddmContentLocalService;
295 }
296
297
302 public void setDDMContentLocalService(
303 DDMContentLocalService ddmContentLocalService) {
304 this.ddmContentLocalService = ddmContentLocalService;
305 }
306
307
312 public DDMContentPersistence getDDMContentPersistence() {
313 return ddmContentPersistence;
314 }
315
316
321 public void setDDMContentPersistence(
322 DDMContentPersistence ddmContentPersistence) {
323 this.ddmContentPersistence = ddmContentPersistence;
324 }
325
326
331 public DDMStorageLinkLocalService getDDMStorageLinkLocalService() {
332 return ddmStorageLinkLocalService;
333 }
334
335
340 public void setDDMStorageLinkLocalService(
341 DDMStorageLinkLocalService ddmStorageLinkLocalService) {
342 this.ddmStorageLinkLocalService = ddmStorageLinkLocalService;
343 }
344
345
350 public DDMStorageLinkPersistence getDDMStorageLinkPersistence() {
351 return ddmStorageLinkPersistence;
352 }
353
354
359 public void setDDMStorageLinkPersistence(
360 DDMStorageLinkPersistence ddmStorageLinkPersistence) {
361 this.ddmStorageLinkPersistence = ddmStorageLinkPersistence;
362 }
363
364
369 public DDMStructureLocalService getDDMStructureLocalService() {
370 return ddmStructureLocalService;
371 }
372
373
378 public void setDDMStructureLocalService(
379 DDMStructureLocalService ddmStructureLocalService) {
380 this.ddmStructureLocalService = ddmStructureLocalService;
381 }
382
383
388 public DDMStructureService getDDMStructureService() {
389 return ddmStructureService;
390 }
391
392
397 public void setDDMStructureService(DDMStructureService ddmStructureService) {
398 this.ddmStructureService = ddmStructureService;
399 }
400
401
406 public DDMStructurePersistence getDDMStructurePersistence() {
407 return ddmStructurePersistence;
408 }
409
410
415 public void setDDMStructurePersistence(
416 DDMStructurePersistence ddmStructurePersistence) {
417 this.ddmStructurePersistence = ddmStructurePersistence;
418 }
419
420
425 public DDMStructureFinder getDDMStructureFinder() {
426 return ddmStructureFinder;
427 }
428
429
434 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
435 this.ddmStructureFinder = ddmStructureFinder;
436 }
437
438
443 public DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
444 return ddmStructureLinkLocalService;
445 }
446
447
452 public void setDDMStructureLinkLocalService(
453 DDMStructureLinkLocalService ddmStructureLinkLocalService) {
454 this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
455 }
456
457
462 public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
463 return ddmStructureLinkPersistence;
464 }
465
466
471 public void setDDMStructureLinkPersistence(
472 DDMStructureLinkPersistence ddmStructureLinkPersistence) {
473 this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
474 }
475
476
481 public DDMTemplateLocalService getDDMTemplateLocalService() {
482 return ddmTemplateLocalService;
483 }
484
485
490 public void setDDMTemplateLocalService(
491 DDMTemplateLocalService ddmTemplateLocalService) {
492 this.ddmTemplateLocalService = ddmTemplateLocalService;
493 }
494
495
500 public DDMTemplateService getDDMTemplateService() {
501 return ddmTemplateService;
502 }
503
504
509 public void setDDMTemplateService(DDMTemplateService ddmTemplateService) {
510 this.ddmTemplateService = ddmTemplateService;
511 }
512
513
518 public DDMTemplatePersistence getDDMTemplatePersistence() {
519 return ddmTemplatePersistence;
520 }
521
522
527 public void setDDMTemplatePersistence(
528 DDMTemplatePersistence ddmTemplatePersistence) {
529 this.ddmTemplatePersistence = ddmTemplatePersistence;
530 }
531
532
537 public DDMTemplateFinder getDDMTemplateFinder() {
538 return ddmTemplateFinder;
539 }
540
541
546 public void setDDMTemplateFinder(DDMTemplateFinder ddmTemplateFinder) {
547 this.ddmTemplateFinder = ddmTemplateFinder;
548 }
549
550
555 public CounterLocalService getCounterLocalService() {
556 return counterLocalService;
557 }
558
559
564 public void setCounterLocalService(CounterLocalService counterLocalService) {
565 this.counterLocalService = counterLocalService;
566 }
567
568
573 public ResourceLocalService getResourceLocalService() {
574 return resourceLocalService;
575 }
576
577
582 public void setResourceLocalService(
583 ResourceLocalService resourceLocalService) {
584 this.resourceLocalService = resourceLocalService;
585 }
586
587
592 public UserLocalService getUserLocalService() {
593 return userLocalService;
594 }
595
596
601 public void setUserLocalService(UserLocalService userLocalService) {
602 this.userLocalService = userLocalService;
603 }
604
605
610 public UserService getUserService() {
611 return userService;
612 }
613
614
619 public void setUserService(UserService userService) {
620 this.userService = userService;
621 }
622
623
628 public UserPersistence getUserPersistence() {
629 return userPersistence;
630 }
631
632
637 public void setUserPersistence(UserPersistence userPersistence) {
638 this.userPersistence = userPersistence;
639 }
640
641
646 public UserFinder getUserFinder() {
647 return userFinder;
648 }
649
650
655 public void setUserFinder(UserFinder userFinder) {
656 this.userFinder = userFinder;
657 }
658
659
664 public DLFileEntryTypeLocalService getDLFileEntryTypeLocalService() {
665 return dlFileEntryTypeLocalService;
666 }
667
668
673 public void setDLFileEntryTypeLocalService(
674 DLFileEntryTypeLocalService dlFileEntryTypeLocalService) {
675 this.dlFileEntryTypeLocalService = dlFileEntryTypeLocalService;
676 }
677
678
683 public DLFileEntryTypeService getDLFileEntryTypeService() {
684 return dlFileEntryTypeService;
685 }
686
687
692 public void setDLFileEntryTypeService(
693 DLFileEntryTypeService dlFileEntryTypeService) {
694 this.dlFileEntryTypeService = dlFileEntryTypeService;
695 }
696
697
702 public DLFileEntryTypePersistence getDLFileEntryTypePersistence() {
703 return dlFileEntryTypePersistence;
704 }
705
706
711 public void setDLFileEntryTypePersistence(
712 DLFileEntryTypePersistence dlFileEntryTypePersistence) {
713 this.dlFileEntryTypePersistence = dlFileEntryTypePersistence;
714 }
715
716
721 public DLFileEntryTypeFinder getDLFileEntryTypeFinder() {
722 return dlFileEntryTypeFinder;
723 }
724
725
730 public void setDLFileEntryTypeFinder(
731 DLFileEntryTypeFinder dlFileEntryTypeFinder) {
732 this.dlFileEntryTypeFinder = dlFileEntryTypeFinder;
733 }
734
735 public void afterPropertiesSet() {
736 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatamapping.model.DDMStructure",
737 ddmStructureLocalService);
738 }
739
740 public void destroy() {
741 persistedModelLocalServiceRegistry.unregister(
742 "com.liferay.portlet.dynamicdatamapping.model.DDMStructure");
743 }
744
745
750 public String getBeanIdentifier() {
751 return _beanIdentifier;
752 }
753
754
759 public void setBeanIdentifier(String beanIdentifier) {
760 _beanIdentifier = beanIdentifier;
761 }
762
763 protected Class<?> getModelClass() {
764 return DDMStructure.class;
765 }
766
767 protected String getModelClassName() {
768 return DDMStructure.class.getName();
769 }
770
771
776 protected void runSQL(String sql) throws SystemException {
777 try {
778 DataSource dataSource = ddmStructurePersistence.getDataSource();
779
780 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
781 sql, new int[0]);
782
783 sqlUpdate.update();
784 }
785 catch (Exception e) {
786 throw new SystemException(e);
787 }
788 }
789
790 @BeanReference(type = DDMContentLocalService.class)
791 protected DDMContentLocalService ddmContentLocalService;
792 @BeanReference(type = DDMContentPersistence.class)
793 protected DDMContentPersistence ddmContentPersistence;
794 @BeanReference(type = DDMStorageLinkLocalService.class)
795 protected DDMStorageLinkLocalService ddmStorageLinkLocalService;
796 @BeanReference(type = DDMStorageLinkPersistence.class)
797 protected DDMStorageLinkPersistence ddmStorageLinkPersistence;
798 @BeanReference(type = DDMStructureLocalService.class)
799 protected DDMStructureLocalService ddmStructureLocalService;
800 @BeanReference(type = DDMStructureService.class)
801 protected DDMStructureService ddmStructureService;
802 @BeanReference(type = DDMStructurePersistence.class)
803 protected DDMStructurePersistence ddmStructurePersistence;
804 @BeanReference(type = DDMStructureFinder.class)
805 protected DDMStructureFinder ddmStructureFinder;
806 @BeanReference(type = DDMStructureLinkLocalService.class)
807 protected DDMStructureLinkLocalService ddmStructureLinkLocalService;
808 @BeanReference(type = DDMStructureLinkPersistence.class)
809 protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
810 @BeanReference(type = DDMTemplateLocalService.class)
811 protected DDMTemplateLocalService ddmTemplateLocalService;
812 @BeanReference(type = DDMTemplateService.class)
813 protected DDMTemplateService ddmTemplateService;
814 @BeanReference(type = DDMTemplatePersistence.class)
815 protected DDMTemplatePersistence ddmTemplatePersistence;
816 @BeanReference(type = DDMTemplateFinder.class)
817 protected DDMTemplateFinder ddmTemplateFinder;
818 @BeanReference(type = CounterLocalService.class)
819 protected CounterLocalService counterLocalService;
820 @BeanReference(type = ResourceLocalService.class)
821 protected ResourceLocalService resourceLocalService;
822 @BeanReference(type = UserLocalService.class)
823 protected UserLocalService userLocalService;
824 @BeanReference(type = UserService.class)
825 protected UserService userService;
826 @BeanReference(type = UserPersistence.class)
827 protected UserPersistence userPersistence;
828 @BeanReference(type = UserFinder.class)
829 protected UserFinder userFinder;
830 @BeanReference(type = DLFileEntryTypeLocalService.class)
831 protected DLFileEntryTypeLocalService dlFileEntryTypeLocalService;
832 @BeanReference(type = DLFileEntryTypeService.class)
833 protected DLFileEntryTypeService dlFileEntryTypeService;
834 @BeanReference(type = DLFileEntryTypePersistence.class)
835 protected DLFileEntryTypePersistence dlFileEntryTypePersistence;
836 @BeanReference(type = DLFileEntryTypeFinder.class)
837 protected DLFileEntryTypeFinder dlFileEntryTypeFinder;
838 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
839 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
840 private String _beanIdentifier;
841 }