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.UserLocalService;
035 import com.liferay.portal.service.UserService;
036 import com.liferay.portal.service.WorkflowInstanceLinkLocalService;
037 import com.liferay.portal.service.persistence.UserFinder;
038 import com.liferay.portal.service.persistence.UserPersistence;
039 import com.liferay.portal.service.persistence.WorkflowInstanceLinkPersistence;
040
041 import com.liferay.portlet.asset.service.AssetEntryLocalService;
042 import com.liferay.portlet.asset.service.AssetEntryService;
043 import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
044 import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
045 import com.liferay.portlet.dynamicdatalists.model.DDLRecord;
046 import com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService;
047 import com.liferay.portlet.dynamicdatalists.service.DDLRecordService;
048 import com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalService;
049 import com.liferay.portlet.dynamicdatalists.service.DDLRecordSetService;
050 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordFinder;
051 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordPersistence;
052 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordSetFinder;
053 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordSetPersistence;
054 import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordVersionPersistence;
055 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService;
056 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureService;
057 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureFinder;
058 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistence;
059
060 import java.io.Serializable;
061
062 import java.util.List;
063
064 import javax.sql.DataSource;
065
066
078 public abstract class DDLRecordLocalServiceBaseImpl extends BaseLocalServiceImpl
079 implements DDLRecordLocalService, IdentifiableBean {
080
085
086
093 @Indexable(type = IndexableType.REINDEX)
094 public DDLRecord addDDLRecord(DDLRecord ddlRecord)
095 throws SystemException {
096 ddlRecord.setNew(true);
097
098 return ddlRecordPersistence.update(ddlRecord);
099 }
100
101
107 public DDLRecord createDDLRecord(long recordId) {
108 return ddlRecordPersistence.create(recordId);
109 }
110
111
119 @Indexable(type = IndexableType.DELETE)
120 public DDLRecord deleteDDLRecord(long recordId)
121 throws PortalException, SystemException {
122 return ddlRecordPersistence.remove(recordId);
123 }
124
125
132 @Indexable(type = IndexableType.DELETE)
133 public DDLRecord deleteDDLRecord(DDLRecord ddlRecord)
134 throws SystemException {
135 return ddlRecordPersistence.remove(ddlRecord);
136 }
137
138 public DynamicQuery dynamicQuery() {
139 Class<?> clazz = getClass();
140
141 return DynamicQueryFactoryUtil.forClass(DDLRecord.class,
142 clazz.getClassLoader());
143 }
144
145
152 @SuppressWarnings("rawtypes")
153 public List dynamicQuery(DynamicQuery dynamicQuery)
154 throws SystemException {
155 return ddlRecordPersistence.findWithDynamicQuery(dynamicQuery);
156 }
157
158
171 @SuppressWarnings("rawtypes")
172 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
173 throws SystemException {
174 return ddlRecordPersistence.findWithDynamicQuery(dynamicQuery, start,
175 end);
176 }
177
178
192 @SuppressWarnings("rawtypes")
193 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
194 OrderByComparator orderByComparator) throws SystemException {
195 return ddlRecordPersistence.findWithDynamicQuery(dynamicQuery, start,
196 end, orderByComparator);
197 }
198
199
206 public long dynamicQueryCount(DynamicQuery dynamicQuery)
207 throws SystemException {
208 return ddlRecordPersistence.countWithDynamicQuery(dynamicQuery);
209 }
210
211 public DDLRecord fetchDDLRecord(long recordId) throws SystemException {
212 return ddlRecordPersistence.fetchByPrimaryKey(recordId);
213 }
214
215
223 public DDLRecord getDDLRecord(long recordId)
224 throws PortalException, SystemException {
225 return ddlRecordPersistence.findByPrimaryKey(recordId);
226 }
227
228 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
229 throws PortalException, SystemException {
230 return ddlRecordPersistence.findByPrimaryKey(primaryKeyObj);
231 }
232
233
242 public DDLRecord getDDLRecordByUuidAndGroupId(String uuid, long groupId)
243 throws PortalException, SystemException {
244 return ddlRecordPersistence.findByUUID_G(uuid, groupId);
245 }
246
247
259 public List<DDLRecord> getDDLRecords(int start, int end)
260 throws SystemException {
261 return ddlRecordPersistence.findAll(start, end);
262 }
263
264
270 public int getDDLRecordsCount() throws SystemException {
271 return ddlRecordPersistence.countAll();
272 }
273
274
281 @Indexable(type = IndexableType.REINDEX)
282 public DDLRecord updateDDLRecord(DDLRecord ddlRecord)
283 throws SystemException {
284 return ddlRecordPersistence.update(ddlRecord);
285 }
286
287
292 public DDLRecordLocalService getDDLRecordLocalService() {
293 return ddlRecordLocalService;
294 }
295
296
301 public void setDDLRecordLocalService(
302 DDLRecordLocalService ddlRecordLocalService) {
303 this.ddlRecordLocalService = ddlRecordLocalService;
304 }
305
306
311 public DDLRecordService getDDLRecordService() {
312 return ddlRecordService;
313 }
314
315
320 public void setDDLRecordService(DDLRecordService ddlRecordService) {
321 this.ddlRecordService = ddlRecordService;
322 }
323
324
329 public DDLRecordPersistence getDDLRecordPersistence() {
330 return ddlRecordPersistence;
331 }
332
333
338 public void setDDLRecordPersistence(
339 DDLRecordPersistence ddlRecordPersistence) {
340 this.ddlRecordPersistence = ddlRecordPersistence;
341 }
342
343
348 public DDLRecordFinder getDDLRecordFinder() {
349 return ddlRecordFinder;
350 }
351
352
357 public void setDDLRecordFinder(DDLRecordFinder ddlRecordFinder) {
358 this.ddlRecordFinder = ddlRecordFinder;
359 }
360
361
366 public DDLRecordSetLocalService getDDLRecordSetLocalService() {
367 return ddlRecordSetLocalService;
368 }
369
370
375 public void setDDLRecordSetLocalService(
376 DDLRecordSetLocalService ddlRecordSetLocalService) {
377 this.ddlRecordSetLocalService = ddlRecordSetLocalService;
378 }
379
380
385 public DDLRecordSetService getDDLRecordSetService() {
386 return ddlRecordSetService;
387 }
388
389
394 public void setDDLRecordSetService(DDLRecordSetService ddlRecordSetService) {
395 this.ddlRecordSetService = ddlRecordSetService;
396 }
397
398
403 public DDLRecordSetPersistence getDDLRecordSetPersistence() {
404 return ddlRecordSetPersistence;
405 }
406
407
412 public void setDDLRecordSetPersistence(
413 DDLRecordSetPersistence ddlRecordSetPersistence) {
414 this.ddlRecordSetPersistence = ddlRecordSetPersistence;
415 }
416
417
422 public DDLRecordSetFinder getDDLRecordSetFinder() {
423 return ddlRecordSetFinder;
424 }
425
426
431 public void setDDLRecordSetFinder(DDLRecordSetFinder ddlRecordSetFinder) {
432 this.ddlRecordSetFinder = ddlRecordSetFinder;
433 }
434
435
440 public DDLRecordVersionPersistence getDDLRecordVersionPersistence() {
441 return ddlRecordVersionPersistence;
442 }
443
444
449 public void setDDLRecordVersionPersistence(
450 DDLRecordVersionPersistence ddlRecordVersionPersistence) {
451 this.ddlRecordVersionPersistence = ddlRecordVersionPersistence;
452 }
453
454
459 public CounterLocalService getCounterLocalService() {
460 return counterLocalService;
461 }
462
463
468 public void setCounterLocalService(CounterLocalService counterLocalService) {
469 this.counterLocalService = counterLocalService;
470 }
471
472
477 public ResourceLocalService getResourceLocalService() {
478 return resourceLocalService;
479 }
480
481
486 public void setResourceLocalService(
487 ResourceLocalService resourceLocalService) {
488 this.resourceLocalService = resourceLocalService;
489 }
490
491
496 public UserLocalService getUserLocalService() {
497 return userLocalService;
498 }
499
500
505 public void setUserLocalService(UserLocalService userLocalService) {
506 this.userLocalService = userLocalService;
507 }
508
509
514 public UserService getUserService() {
515 return userService;
516 }
517
518
523 public void setUserService(UserService userService) {
524 this.userService = userService;
525 }
526
527
532 public UserPersistence getUserPersistence() {
533 return userPersistence;
534 }
535
536
541 public void setUserPersistence(UserPersistence userPersistence) {
542 this.userPersistence = userPersistence;
543 }
544
545
550 public UserFinder getUserFinder() {
551 return userFinder;
552 }
553
554
559 public void setUserFinder(UserFinder userFinder) {
560 this.userFinder = userFinder;
561 }
562
563
568 public WorkflowInstanceLinkLocalService getWorkflowInstanceLinkLocalService() {
569 return workflowInstanceLinkLocalService;
570 }
571
572
577 public void setWorkflowInstanceLinkLocalService(
578 WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService) {
579 this.workflowInstanceLinkLocalService = workflowInstanceLinkLocalService;
580 }
581
582
587 public WorkflowInstanceLinkPersistence getWorkflowInstanceLinkPersistence() {
588 return workflowInstanceLinkPersistence;
589 }
590
591
596 public void setWorkflowInstanceLinkPersistence(
597 WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence) {
598 this.workflowInstanceLinkPersistence = workflowInstanceLinkPersistence;
599 }
600
601
606 public AssetEntryLocalService getAssetEntryLocalService() {
607 return assetEntryLocalService;
608 }
609
610
615 public void setAssetEntryLocalService(
616 AssetEntryLocalService assetEntryLocalService) {
617 this.assetEntryLocalService = assetEntryLocalService;
618 }
619
620
625 public AssetEntryService getAssetEntryService() {
626 return assetEntryService;
627 }
628
629
634 public void setAssetEntryService(AssetEntryService assetEntryService) {
635 this.assetEntryService = assetEntryService;
636 }
637
638
643 public AssetEntryPersistence getAssetEntryPersistence() {
644 return assetEntryPersistence;
645 }
646
647
652 public void setAssetEntryPersistence(
653 AssetEntryPersistence assetEntryPersistence) {
654 this.assetEntryPersistence = assetEntryPersistence;
655 }
656
657
662 public AssetEntryFinder getAssetEntryFinder() {
663 return assetEntryFinder;
664 }
665
666
671 public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
672 this.assetEntryFinder = assetEntryFinder;
673 }
674
675
680 public DDMStructureLocalService getDDMStructureLocalService() {
681 return ddmStructureLocalService;
682 }
683
684
689 public void setDDMStructureLocalService(
690 DDMStructureLocalService ddmStructureLocalService) {
691 this.ddmStructureLocalService = ddmStructureLocalService;
692 }
693
694
699 public DDMStructureService getDDMStructureService() {
700 return ddmStructureService;
701 }
702
703
708 public void setDDMStructureService(DDMStructureService ddmStructureService) {
709 this.ddmStructureService = ddmStructureService;
710 }
711
712
717 public DDMStructurePersistence getDDMStructurePersistence() {
718 return ddmStructurePersistence;
719 }
720
721
726 public void setDDMStructurePersistence(
727 DDMStructurePersistence ddmStructurePersistence) {
728 this.ddmStructurePersistence = ddmStructurePersistence;
729 }
730
731
736 public DDMStructureFinder getDDMStructureFinder() {
737 return ddmStructureFinder;
738 }
739
740
745 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
746 this.ddmStructureFinder = ddmStructureFinder;
747 }
748
749 public void afterPropertiesSet() {
750 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatalists.model.DDLRecord",
751 ddlRecordLocalService);
752 }
753
754 public void destroy() {
755 persistedModelLocalServiceRegistry.unregister(
756 "com.liferay.portlet.dynamicdatalists.model.DDLRecord");
757 }
758
759
764 public String getBeanIdentifier() {
765 return _beanIdentifier;
766 }
767
768
773 public void setBeanIdentifier(String beanIdentifier) {
774 _beanIdentifier = beanIdentifier;
775 }
776
777 protected Class<?> getModelClass() {
778 return DDLRecord.class;
779 }
780
781 protected String getModelClassName() {
782 return DDLRecord.class.getName();
783 }
784
785
790 protected void runSQL(String sql) throws SystemException {
791 try {
792 DataSource dataSource = ddlRecordPersistence.getDataSource();
793
794 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
795 sql, new int[0]);
796
797 sqlUpdate.update();
798 }
799 catch (Exception e) {
800 throw new SystemException(e);
801 }
802 }
803
804 @BeanReference(type = DDLRecordLocalService.class)
805 protected DDLRecordLocalService ddlRecordLocalService;
806 @BeanReference(type = DDLRecordService.class)
807 protected DDLRecordService ddlRecordService;
808 @BeanReference(type = DDLRecordPersistence.class)
809 protected DDLRecordPersistence ddlRecordPersistence;
810 @BeanReference(type = DDLRecordFinder.class)
811 protected DDLRecordFinder ddlRecordFinder;
812 @BeanReference(type = DDLRecordSetLocalService.class)
813 protected DDLRecordSetLocalService ddlRecordSetLocalService;
814 @BeanReference(type = DDLRecordSetService.class)
815 protected DDLRecordSetService ddlRecordSetService;
816 @BeanReference(type = DDLRecordSetPersistence.class)
817 protected DDLRecordSetPersistence ddlRecordSetPersistence;
818 @BeanReference(type = DDLRecordSetFinder.class)
819 protected DDLRecordSetFinder ddlRecordSetFinder;
820 @BeanReference(type = DDLRecordVersionPersistence.class)
821 protected DDLRecordVersionPersistence ddlRecordVersionPersistence;
822 @BeanReference(type = CounterLocalService.class)
823 protected CounterLocalService counterLocalService;
824 @BeanReference(type = ResourceLocalService.class)
825 protected ResourceLocalService resourceLocalService;
826 @BeanReference(type = UserLocalService.class)
827 protected UserLocalService userLocalService;
828 @BeanReference(type = UserService.class)
829 protected UserService userService;
830 @BeanReference(type = UserPersistence.class)
831 protected UserPersistence userPersistence;
832 @BeanReference(type = UserFinder.class)
833 protected UserFinder userFinder;
834 @BeanReference(type = WorkflowInstanceLinkLocalService.class)
835 protected WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService;
836 @BeanReference(type = WorkflowInstanceLinkPersistence.class)
837 protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
838 @BeanReference(type = AssetEntryLocalService.class)
839 protected AssetEntryLocalService assetEntryLocalService;
840 @BeanReference(type = AssetEntryService.class)
841 protected AssetEntryService assetEntryService;
842 @BeanReference(type = AssetEntryPersistence.class)
843 protected AssetEntryPersistence assetEntryPersistence;
844 @BeanReference(type = AssetEntryFinder.class)
845 protected AssetEntryFinder assetEntryFinder;
846 @BeanReference(type = DDMStructureLocalService.class)
847 protected DDMStructureLocalService ddmStructureLocalService;
848 @BeanReference(type = DDMStructureService.class)
849 protected DDMStructureService ddmStructureService;
850 @BeanReference(type = DDMStructurePersistence.class)
851 protected DDMStructurePersistence ddmStructurePersistence;
852 @BeanReference(type = DDMStructureFinder.class)
853 protected DDMStructureFinder ddmStructureFinder;
854 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
855 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
856 private String _beanIdentifier;
857 }