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.dynamicdatamapping.model.DDMContent;
040 import com.liferay.portlet.dynamicdatamapping.service.DDMContentLocalService;
041 import com.liferay.portlet.dynamicdatamapping.service.DDMStorageLinkLocalService;
042 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService;
043 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService;
044 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureService;
045 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalService;
046 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateService;
047 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMContentPersistence;
048 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStorageLinkPersistence;
049 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureFinder;
050 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureLinkPersistence;
051 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistence;
052 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplateFinder;
053 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplatePersistence;
054
055 import java.io.Serializable;
056
057 import java.util.List;
058
059 import javax.sql.DataSource;
060
061
073 public abstract class DDMContentLocalServiceBaseImpl
074 extends BaseLocalServiceImpl implements DDMContentLocalService,
075 IdentifiableBean {
076
081
082
089 @Indexable(type = IndexableType.REINDEX)
090 public DDMContent addDDMContent(DDMContent ddmContent)
091 throws SystemException {
092 ddmContent.setNew(true);
093
094 return ddmContentPersistence.update(ddmContent);
095 }
096
097
103 public DDMContent createDDMContent(long contentId) {
104 return ddmContentPersistence.create(contentId);
105 }
106
107
115 @Indexable(type = IndexableType.DELETE)
116 public DDMContent deleteDDMContent(long contentId)
117 throws PortalException, SystemException {
118 return ddmContentPersistence.remove(contentId);
119 }
120
121
128 @Indexable(type = IndexableType.DELETE)
129 public DDMContent deleteDDMContent(DDMContent ddmContent)
130 throws SystemException {
131 return ddmContentPersistence.remove(ddmContent);
132 }
133
134 public DynamicQuery dynamicQuery() {
135 Class<?> clazz = getClass();
136
137 return DynamicQueryFactoryUtil.forClass(DDMContent.class,
138 clazz.getClassLoader());
139 }
140
141
148 @SuppressWarnings("rawtypes")
149 public List dynamicQuery(DynamicQuery dynamicQuery)
150 throws SystemException {
151 return ddmContentPersistence.findWithDynamicQuery(dynamicQuery);
152 }
153
154
167 @SuppressWarnings("rawtypes")
168 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
169 throws SystemException {
170 return ddmContentPersistence.findWithDynamicQuery(dynamicQuery, start,
171 end);
172 }
173
174
188 @SuppressWarnings("rawtypes")
189 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
190 OrderByComparator orderByComparator) throws SystemException {
191 return ddmContentPersistence.findWithDynamicQuery(dynamicQuery, start,
192 end, orderByComparator);
193 }
194
195
202 public long dynamicQueryCount(DynamicQuery dynamicQuery)
203 throws SystemException {
204 return ddmContentPersistence.countWithDynamicQuery(dynamicQuery);
205 }
206
207 public DDMContent fetchDDMContent(long contentId) throws SystemException {
208 return ddmContentPersistence.fetchByPrimaryKey(contentId);
209 }
210
211
219 public DDMContent getDDMContent(long contentId)
220 throws PortalException, SystemException {
221 return ddmContentPersistence.findByPrimaryKey(contentId);
222 }
223
224 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
225 throws PortalException, SystemException {
226 return ddmContentPersistence.findByPrimaryKey(primaryKeyObj);
227 }
228
229
238 public DDMContent getDDMContentByUuidAndGroupId(String uuid, long groupId)
239 throws PortalException, SystemException {
240 return ddmContentPersistence.findByUUID_G(uuid, groupId);
241 }
242
243
255 public List<DDMContent> getDDMContents(int start, int end)
256 throws SystemException {
257 return ddmContentPersistence.findAll(start, end);
258 }
259
260
266 public int getDDMContentsCount() throws SystemException {
267 return ddmContentPersistence.countAll();
268 }
269
270
277 @Indexable(type = IndexableType.REINDEX)
278 public DDMContent updateDDMContent(DDMContent ddmContent)
279 throws SystemException {
280 return ddmContentPersistence.update(ddmContent);
281 }
282
283
288 public DDMContentLocalService getDDMContentLocalService() {
289 return ddmContentLocalService;
290 }
291
292
297 public void setDDMContentLocalService(
298 DDMContentLocalService ddmContentLocalService) {
299 this.ddmContentLocalService = ddmContentLocalService;
300 }
301
302
307 public DDMContentPersistence getDDMContentPersistence() {
308 return ddmContentPersistence;
309 }
310
311
316 public void setDDMContentPersistence(
317 DDMContentPersistence ddmContentPersistence) {
318 this.ddmContentPersistence = ddmContentPersistence;
319 }
320
321
326 public DDMStorageLinkLocalService getDDMStorageLinkLocalService() {
327 return ddmStorageLinkLocalService;
328 }
329
330
335 public void setDDMStorageLinkLocalService(
336 DDMStorageLinkLocalService ddmStorageLinkLocalService) {
337 this.ddmStorageLinkLocalService = ddmStorageLinkLocalService;
338 }
339
340
345 public DDMStorageLinkPersistence getDDMStorageLinkPersistence() {
346 return ddmStorageLinkPersistence;
347 }
348
349
354 public void setDDMStorageLinkPersistence(
355 DDMStorageLinkPersistence ddmStorageLinkPersistence) {
356 this.ddmStorageLinkPersistence = ddmStorageLinkPersistence;
357 }
358
359
364 public DDMStructureLocalService getDDMStructureLocalService() {
365 return ddmStructureLocalService;
366 }
367
368
373 public void setDDMStructureLocalService(
374 DDMStructureLocalService ddmStructureLocalService) {
375 this.ddmStructureLocalService = ddmStructureLocalService;
376 }
377
378
383 public DDMStructureService getDDMStructureService() {
384 return ddmStructureService;
385 }
386
387
392 public void setDDMStructureService(DDMStructureService ddmStructureService) {
393 this.ddmStructureService = ddmStructureService;
394 }
395
396
401 public DDMStructurePersistence getDDMStructurePersistence() {
402 return ddmStructurePersistence;
403 }
404
405
410 public void setDDMStructurePersistence(
411 DDMStructurePersistence ddmStructurePersistence) {
412 this.ddmStructurePersistence = ddmStructurePersistence;
413 }
414
415
420 public DDMStructureFinder getDDMStructureFinder() {
421 return ddmStructureFinder;
422 }
423
424
429 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
430 this.ddmStructureFinder = ddmStructureFinder;
431 }
432
433
438 public DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
439 return ddmStructureLinkLocalService;
440 }
441
442
447 public void setDDMStructureLinkLocalService(
448 DDMStructureLinkLocalService ddmStructureLinkLocalService) {
449 this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
450 }
451
452
457 public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
458 return ddmStructureLinkPersistence;
459 }
460
461
466 public void setDDMStructureLinkPersistence(
467 DDMStructureLinkPersistence ddmStructureLinkPersistence) {
468 this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
469 }
470
471
476 public DDMTemplateLocalService getDDMTemplateLocalService() {
477 return ddmTemplateLocalService;
478 }
479
480
485 public void setDDMTemplateLocalService(
486 DDMTemplateLocalService ddmTemplateLocalService) {
487 this.ddmTemplateLocalService = ddmTemplateLocalService;
488 }
489
490
495 public DDMTemplateService getDDMTemplateService() {
496 return ddmTemplateService;
497 }
498
499
504 public void setDDMTemplateService(DDMTemplateService ddmTemplateService) {
505 this.ddmTemplateService = ddmTemplateService;
506 }
507
508
513 public DDMTemplatePersistence getDDMTemplatePersistence() {
514 return ddmTemplatePersistence;
515 }
516
517
522 public void setDDMTemplatePersistence(
523 DDMTemplatePersistence ddmTemplatePersistence) {
524 this.ddmTemplatePersistence = ddmTemplatePersistence;
525 }
526
527
532 public DDMTemplateFinder getDDMTemplateFinder() {
533 return ddmTemplateFinder;
534 }
535
536
541 public void setDDMTemplateFinder(DDMTemplateFinder ddmTemplateFinder) {
542 this.ddmTemplateFinder = ddmTemplateFinder;
543 }
544
545
550 public CounterLocalService getCounterLocalService() {
551 return counterLocalService;
552 }
553
554
559 public void setCounterLocalService(CounterLocalService counterLocalService) {
560 this.counterLocalService = counterLocalService;
561 }
562
563
568 public ResourceLocalService getResourceLocalService() {
569 return resourceLocalService;
570 }
571
572
577 public void setResourceLocalService(
578 ResourceLocalService resourceLocalService) {
579 this.resourceLocalService = resourceLocalService;
580 }
581
582
587 public UserLocalService getUserLocalService() {
588 return userLocalService;
589 }
590
591
596 public void setUserLocalService(UserLocalService userLocalService) {
597 this.userLocalService = userLocalService;
598 }
599
600
605 public UserService getUserService() {
606 return userService;
607 }
608
609
614 public void setUserService(UserService userService) {
615 this.userService = userService;
616 }
617
618
623 public UserPersistence getUserPersistence() {
624 return userPersistence;
625 }
626
627
632 public void setUserPersistence(UserPersistence userPersistence) {
633 this.userPersistence = userPersistence;
634 }
635
636
641 public UserFinder getUserFinder() {
642 return userFinder;
643 }
644
645
650 public void setUserFinder(UserFinder userFinder) {
651 this.userFinder = userFinder;
652 }
653
654 public void afterPropertiesSet() {
655 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatamapping.model.DDMContent",
656 ddmContentLocalService);
657 }
658
659 public void destroy() {
660 persistedModelLocalServiceRegistry.unregister(
661 "com.liferay.portlet.dynamicdatamapping.model.DDMContent");
662 }
663
664
669 public String getBeanIdentifier() {
670 return _beanIdentifier;
671 }
672
673
678 public void setBeanIdentifier(String beanIdentifier) {
679 _beanIdentifier = beanIdentifier;
680 }
681
682 protected Class<?> getModelClass() {
683 return DDMContent.class;
684 }
685
686 protected String getModelClassName() {
687 return DDMContent.class.getName();
688 }
689
690
695 protected void runSQL(String sql) throws SystemException {
696 try {
697 DataSource dataSource = ddmContentPersistence.getDataSource();
698
699 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
700 sql, new int[0]);
701
702 sqlUpdate.update();
703 }
704 catch (Exception e) {
705 throw new SystemException(e);
706 }
707 }
708
709 @BeanReference(type = DDMContentLocalService.class)
710 protected DDMContentLocalService ddmContentLocalService;
711 @BeanReference(type = DDMContentPersistence.class)
712 protected DDMContentPersistence ddmContentPersistence;
713 @BeanReference(type = DDMStorageLinkLocalService.class)
714 protected DDMStorageLinkLocalService ddmStorageLinkLocalService;
715 @BeanReference(type = DDMStorageLinkPersistence.class)
716 protected DDMStorageLinkPersistence ddmStorageLinkPersistence;
717 @BeanReference(type = DDMStructureLocalService.class)
718 protected DDMStructureLocalService ddmStructureLocalService;
719 @BeanReference(type = DDMStructureService.class)
720 protected DDMStructureService ddmStructureService;
721 @BeanReference(type = DDMStructurePersistence.class)
722 protected DDMStructurePersistence ddmStructurePersistence;
723 @BeanReference(type = DDMStructureFinder.class)
724 protected DDMStructureFinder ddmStructureFinder;
725 @BeanReference(type = DDMStructureLinkLocalService.class)
726 protected DDMStructureLinkLocalService ddmStructureLinkLocalService;
727 @BeanReference(type = DDMStructureLinkPersistence.class)
728 protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
729 @BeanReference(type = DDMTemplateLocalService.class)
730 protected DDMTemplateLocalService ddmTemplateLocalService;
731 @BeanReference(type = DDMTemplateService.class)
732 protected DDMTemplateService ddmTemplateService;
733 @BeanReference(type = DDMTemplatePersistence.class)
734 protected DDMTemplatePersistence ddmTemplatePersistence;
735 @BeanReference(type = DDMTemplateFinder.class)
736 protected DDMTemplateFinder ddmTemplateFinder;
737 @BeanReference(type = CounterLocalService.class)
738 protected CounterLocalService counterLocalService;
739 @BeanReference(type = ResourceLocalService.class)
740 protected ResourceLocalService resourceLocalService;
741 @BeanReference(type = UserLocalService.class)
742 protected UserLocalService userLocalService;
743 @BeanReference(type = UserService.class)
744 protected UserService userService;
745 @BeanReference(type = UserPersistence.class)
746 protected UserPersistence userPersistence;
747 @BeanReference(type = UserFinder.class)
748 protected UserFinder userFinder;
749 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
750 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
751 private String _beanIdentifier;
752 }