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.dynamicdatamapping.model.DDMContent;
043 import com.liferay.portlet.dynamicdatamapping.service.DDMContentLocalService;
044 import com.liferay.portlet.dynamicdatamapping.service.DDMStorageLinkLocalService;
045 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService;
046 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService;
047 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureService;
048 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalService;
049 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateService;
050 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMContentPersistence;
051 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStorageLinkPersistence;
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 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplateFinder;
056 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplatePersistence;
057
058 import java.io.Serializable;
059
060 import java.util.List;
061
062 import javax.sql.DataSource;
063
064
076 public abstract class DDMContentLocalServiceBaseImpl
077 extends BaseLocalServiceImpl implements DDMContentLocalService,
078 IdentifiableBean {
079
084
085
092 @Indexable(type = IndexableType.REINDEX)
093 public DDMContent addDDMContent(DDMContent ddmContent)
094 throws SystemException {
095 ddmContent.setNew(true);
096
097 return ddmContentPersistence.update(ddmContent, false);
098 }
099
100
106 public DDMContent createDDMContent(long contentId) {
107 return ddmContentPersistence.create(contentId);
108 }
109
110
118 @Indexable(type = IndexableType.DELETE)
119 public DDMContent deleteDDMContent(long contentId)
120 throws PortalException, SystemException {
121 return ddmContentPersistence.remove(contentId);
122 }
123
124
131 @Indexable(type = IndexableType.DELETE)
132 public DDMContent deleteDDMContent(DDMContent ddmContent)
133 throws SystemException {
134 return ddmContentPersistence.remove(ddmContent);
135 }
136
137 public DynamicQuery dynamicQuery() {
138 Class<?> clazz = getClass();
139
140 return DynamicQueryFactoryUtil.forClass(DDMContent.class,
141 clazz.getClassLoader());
142 }
143
144
151 @SuppressWarnings("rawtypes")
152 public List dynamicQuery(DynamicQuery dynamicQuery)
153 throws SystemException {
154 return ddmContentPersistence.findWithDynamicQuery(dynamicQuery);
155 }
156
157
170 @SuppressWarnings("rawtypes")
171 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
172 throws SystemException {
173 return ddmContentPersistence.findWithDynamicQuery(dynamicQuery, start,
174 end);
175 }
176
177
191 @SuppressWarnings("rawtypes")
192 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
193 OrderByComparator orderByComparator) throws SystemException {
194 return ddmContentPersistence.findWithDynamicQuery(dynamicQuery, start,
195 end, orderByComparator);
196 }
197
198
205 public long dynamicQueryCount(DynamicQuery dynamicQuery)
206 throws SystemException {
207 return ddmContentPersistence.countWithDynamicQuery(dynamicQuery);
208 }
209
210 public DDMContent fetchDDMContent(long contentId) throws SystemException {
211 return ddmContentPersistence.fetchByPrimaryKey(contentId);
212 }
213
214
222 public DDMContent getDDMContent(long contentId)
223 throws PortalException, SystemException {
224 return ddmContentPersistence.findByPrimaryKey(contentId);
225 }
226
227 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
228 throws PortalException, SystemException {
229 return ddmContentPersistence.findByPrimaryKey(primaryKeyObj);
230 }
231
232
241 public DDMContent getDDMContentByUuidAndGroupId(String uuid, long groupId)
242 throws PortalException, SystemException {
243 return ddmContentPersistence.findByUUID_G(uuid, groupId);
244 }
245
246
258 public List<DDMContent> getDDMContents(int start, int end)
259 throws SystemException {
260 return ddmContentPersistence.findAll(start, end);
261 }
262
263
269 public int getDDMContentsCount() throws SystemException {
270 return ddmContentPersistence.countAll();
271 }
272
273
280 @Indexable(type = IndexableType.REINDEX)
281 public DDMContent updateDDMContent(DDMContent ddmContent)
282 throws SystemException {
283 return updateDDMContent(ddmContent, true);
284 }
285
286
294 @Indexable(type = IndexableType.REINDEX)
295 public DDMContent updateDDMContent(DDMContent ddmContent, boolean merge)
296 throws SystemException {
297 ddmContent.setNew(false);
298
299 return ddmContentPersistence.update(ddmContent, merge);
300 }
301
302
307 public DDMContentLocalService getDDMContentLocalService() {
308 return ddmContentLocalService;
309 }
310
311
316 public void setDDMContentLocalService(
317 DDMContentLocalService ddmContentLocalService) {
318 this.ddmContentLocalService = ddmContentLocalService;
319 }
320
321
326 public DDMContentPersistence getDDMContentPersistence() {
327 return ddmContentPersistence;
328 }
329
330
335 public void setDDMContentPersistence(
336 DDMContentPersistence ddmContentPersistence) {
337 this.ddmContentPersistence = ddmContentPersistence;
338 }
339
340
345 public DDMStorageLinkLocalService getDDMStorageLinkLocalService() {
346 return ddmStorageLinkLocalService;
347 }
348
349
354 public void setDDMStorageLinkLocalService(
355 DDMStorageLinkLocalService ddmStorageLinkLocalService) {
356 this.ddmStorageLinkLocalService = ddmStorageLinkLocalService;
357 }
358
359
364 public DDMStorageLinkPersistence getDDMStorageLinkPersistence() {
365 return ddmStorageLinkPersistence;
366 }
367
368
373 public void setDDMStorageLinkPersistence(
374 DDMStorageLinkPersistence ddmStorageLinkPersistence) {
375 this.ddmStorageLinkPersistence = ddmStorageLinkPersistence;
376 }
377
378
383 public DDMStructureLocalService getDDMStructureLocalService() {
384 return ddmStructureLocalService;
385 }
386
387
392 public void setDDMStructureLocalService(
393 DDMStructureLocalService ddmStructureLocalService) {
394 this.ddmStructureLocalService = ddmStructureLocalService;
395 }
396
397
402 public DDMStructureService getDDMStructureService() {
403 return ddmStructureService;
404 }
405
406
411 public void setDDMStructureService(DDMStructureService ddmStructureService) {
412 this.ddmStructureService = ddmStructureService;
413 }
414
415
420 public DDMStructurePersistence getDDMStructurePersistence() {
421 return ddmStructurePersistence;
422 }
423
424
429 public void setDDMStructurePersistence(
430 DDMStructurePersistence ddmStructurePersistence) {
431 this.ddmStructurePersistence = ddmStructurePersistence;
432 }
433
434
439 public DDMStructureFinder getDDMStructureFinder() {
440 return ddmStructureFinder;
441 }
442
443
448 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
449 this.ddmStructureFinder = ddmStructureFinder;
450 }
451
452
457 public DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
458 return ddmStructureLinkLocalService;
459 }
460
461
466 public void setDDMStructureLinkLocalService(
467 DDMStructureLinkLocalService ddmStructureLinkLocalService) {
468 this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
469 }
470
471
476 public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
477 return ddmStructureLinkPersistence;
478 }
479
480
485 public void setDDMStructureLinkPersistence(
486 DDMStructureLinkPersistence ddmStructureLinkPersistence) {
487 this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
488 }
489
490
495 public DDMTemplateLocalService getDDMTemplateLocalService() {
496 return ddmTemplateLocalService;
497 }
498
499
504 public void setDDMTemplateLocalService(
505 DDMTemplateLocalService ddmTemplateLocalService) {
506 this.ddmTemplateLocalService = ddmTemplateLocalService;
507 }
508
509
514 public DDMTemplateService getDDMTemplateService() {
515 return ddmTemplateService;
516 }
517
518
523 public void setDDMTemplateService(DDMTemplateService ddmTemplateService) {
524 this.ddmTemplateService = ddmTemplateService;
525 }
526
527
532 public DDMTemplatePersistence getDDMTemplatePersistence() {
533 return ddmTemplatePersistence;
534 }
535
536
541 public void setDDMTemplatePersistence(
542 DDMTemplatePersistence ddmTemplatePersistence) {
543 this.ddmTemplatePersistence = ddmTemplatePersistence;
544 }
545
546
551 public DDMTemplateFinder getDDMTemplateFinder() {
552 return ddmTemplateFinder;
553 }
554
555
560 public void setDDMTemplateFinder(DDMTemplateFinder ddmTemplateFinder) {
561 this.ddmTemplateFinder = ddmTemplateFinder;
562 }
563
564
569 public CounterLocalService getCounterLocalService() {
570 return counterLocalService;
571 }
572
573
578 public void setCounterLocalService(CounterLocalService counterLocalService) {
579 this.counterLocalService = counterLocalService;
580 }
581
582
587 public ResourceLocalService getResourceLocalService() {
588 return resourceLocalService;
589 }
590
591
596 public void setResourceLocalService(
597 ResourceLocalService resourceLocalService) {
598 this.resourceLocalService = resourceLocalService;
599 }
600
601
606 public ResourceService getResourceService() {
607 return resourceService;
608 }
609
610
615 public void setResourceService(ResourceService resourceService) {
616 this.resourceService = resourceService;
617 }
618
619
624 public ResourcePersistence getResourcePersistence() {
625 return resourcePersistence;
626 }
627
628
633 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
634 this.resourcePersistence = resourcePersistence;
635 }
636
637
642 public ResourceFinder getResourceFinder() {
643 return resourceFinder;
644 }
645
646
651 public void setResourceFinder(ResourceFinder resourceFinder) {
652 this.resourceFinder = resourceFinder;
653 }
654
655
660 public UserLocalService getUserLocalService() {
661 return userLocalService;
662 }
663
664
669 public void setUserLocalService(UserLocalService userLocalService) {
670 this.userLocalService = userLocalService;
671 }
672
673
678 public UserService getUserService() {
679 return userService;
680 }
681
682
687 public void setUserService(UserService userService) {
688 this.userService = userService;
689 }
690
691
696 public UserPersistence getUserPersistence() {
697 return userPersistence;
698 }
699
700
705 public void setUserPersistence(UserPersistence userPersistence) {
706 this.userPersistence = userPersistence;
707 }
708
709
714 public UserFinder getUserFinder() {
715 return userFinder;
716 }
717
718
723 public void setUserFinder(UserFinder userFinder) {
724 this.userFinder = userFinder;
725 }
726
727 public void afterPropertiesSet() {
728 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatamapping.model.DDMContent",
729 ddmContentLocalService);
730 }
731
732 public void destroy() {
733 persistedModelLocalServiceRegistry.unregister(
734 "com.liferay.portlet.dynamicdatamapping.model.DDMContent");
735 }
736
737
742 public String getBeanIdentifier() {
743 return _beanIdentifier;
744 }
745
746
751 public void setBeanIdentifier(String beanIdentifier) {
752 _beanIdentifier = beanIdentifier;
753 }
754
755 protected Class<?> getModelClass() {
756 return DDMContent.class;
757 }
758
759 protected String getModelClassName() {
760 return DDMContent.class.getName();
761 }
762
763
768 protected void runSQL(String sql) throws SystemException {
769 try {
770 DataSource dataSource = ddmContentPersistence.getDataSource();
771
772 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
773 sql, new int[0]);
774
775 sqlUpdate.update();
776 }
777 catch (Exception e) {
778 throw new SystemException(e);
779 }
780 }
781
782 @BeanReference(type = DDMContentLocalService.class)
783 protected DDMContentLocalService ddmContentLocalService;
784 @BeanReference(type = DDMContentPersistence.class)
785 protected DDMContentPersistence ddmContentPersistence;
786 @BeanReference(type = DDMStorageLinkLocalService.class)
787 protected DDMStorageLinkLocalService ddmStorageLinkLocalService;
788 @BeanReference(type = DDMStorageLinkPersistence.class)
789 protected DDMStorageLinkPersistence ddmStorageLinkPersistence;
790 @BeanReference(type = DDMStructureLocalService.class)
791 protected DDMStructureLocalService ddmStructureLocalService;
792 @BeanReference(type = DDMStructureService.class)
793 protected DDMStructureService ddmStructureService;
794 @BeanReference(type = DDMStructurePersistence.class)
795 protected DDMStructurePersistence ddmStructurePersistence;
796 @BeanReference(type = DDMStructureFinder.class)
797 protected DDMStructureFinder ddmStructureFinder;
798 @BeanReference(type = DDMStructureLinkLocalService.class)
799 protected DDMStructureLinkLocalService ddmStructureLinkLocalService;
800 @BeanReference(type = DDMStructureLinkPersistence.class)
801 protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
802 @BeanReference(type = DDMTemplateLocalService.class)
803 protected DDMTemplateLocalService ddmTemplateLocalService;
804 @BeanReference(type = DDMTemplateService.class)
805 protected DDMTemplateService ddmTemplateService;
806 @BeanReference(type = DDMTemplatePersistence.class)
807 protected DDMTemplatePersistence ddmTemplatePersistence;
808 @BeanReference(type = DDMTemplateFinder.class)
809 protected DDMTemplateFinder ddmTemplateFinder;
810 @BeanReference(type = CounterLocalService.class)
811 protected CounterLocalService counterLocalService;
812 @BeanReference(type = ResourceLocalService.class)
813 protected ResourceLocalService resourceLocalService;
814 @BeanReference(type = ResourceService.class)
815 protected ResourceService resourceService;
816 @BeanReference(type = ResourcePersistence.class)
817 protected ResourcePersistence resourcePersistence;
818 @BeanReference(type = ResourceFinder.class)
819 protected ResourceFinder resourceFinder;
820 @BeanReference(type = UserLocalService.class)
821 protected UserLocalService userLocalService;
822 @BeanReference(type = UserService.class)
823 protected UserService userService;
824 @BeanReference(type = UserPersistence.class)
825 protected UserPersistence userPersistence;
826 @BeanReference(type = UserFinder.class)
827 protected UserFinder userFinder;
828 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
829 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
830 private String _beanIdentifier;
831 }