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.DDMStorageLink;
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 DDMStorageLinkLocalServiceBaseImpl
077 extends BaseLocalServiceImpl implements DDMStorageLinkLocalService,
078 IdentifiableBean {
079
084
085
092 @Indexable(type = IndexableType.REINDEX)
093 public DDMStorageLink addDDMStorageLink(DDMStorageLink ddmStorageLink)
094 throws SystemException {
095 ddmStorageLink.setNew(true);
096
097 return ddmStorageLinkPersistence.update(ddmStorageLink, false);
098 }
099
100
106 public DDMStorageLink createDDMStorageLink(long storageLinkId) {
107 return ddmStorageLinkPersistence.create(storageLinkId);
108 }
109
110
118 @Indexable(type = IndexableType.DELETE)
119 public DDMStorageLink deleteDDMStorageLink(long storageLinkId)
120 throws PortalException, SystemException {
121 return ddmStorageLinkPersistence.remove(storageLinkId);
122 }
123
124
131 @Indexable(type = IndexableType.DELETE)
132 public DDMStorageLink deleteDDMStorageLink(DDMStorageLink ddmStorageLink)
133 throws SystemException {
134 return ddmStorageLinkPersistence.remove(ddmStorageLink);
135 }
136
137 public DynamicQuery dynamicQuery() {
138 Class<?> clazz = getClass();
139
140 return DynamicQueryFactoryUtil.forClass(DDMStorageLink.class,
141 clazz.getClassLoader());
142 }
143
144
151 @SuppressWarnings("rawtypes")
152 public List dynamicQuery(DynamicQuery dynamicQuery)
153 throws SystemException {
154 return ddmStorageLinkPersistence.findWithDynamicQuery(dynamicQuery);
155 }
156
157
170 @SuppressWarnings("rawtypes")
171 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
172 throws SystemException {
173 return ddmStorageLinkPersistence.findWithDynamicQuery(dynamicQuery,
174 start, end);
175 }
176
177
191 @SuppressWarnings("rawtypes")
192 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
193 OrderByComparator orderByComparator) throws SystemException {
194 return ddmStorageLinkPersistence.findWithDynamicQuery(dynamicQuery,
195 start, end, orderByComparator);
196 }
197
198
205 public long dynamicQueryCount(DynamicQuery dynamicQuery)
206 throws SystemException {
207 return ddmStorageLinkPersistence.countWithDynamicQuery(dynamicQuery);
208 }
209
210 public DDMStorageLink fetchDDMStorageLink(long storageLinkId)
211 throws SystemException {
212 return ddmStorageLinkPersistence.fetchByPrimaryKey(storageLinkId);
213 }
214
215
223 public DDMStorageLink getDDMStorageLink(long storageLinkId)
224 throws PortalException, SystemException {
225 return ddmStorageLinkPersistence.findByPrimaryKey(storageLinkId);
226 }
227
228 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
229 throws PortalException, SystemException {
230 return ddmStorageLinkPersistence.findByPrimaryKey(primaryKeyObj);
231 }
232
233
245 public List<DDMStorageLink> getDDMStorageLinks(int start, int end)
246 throws SystemException {
247 return ddmStorageLinkPersistence.findAll(start, end);
248 }
249
250
256 public int getDDMStorageLinksCount() throws SystemException {
257 return ddmStorageLinkPersistence.countAll();
258 }
259
260
267 @Indexable(type = IndexableType.REINDEX)
268 public DDMStorageLink updateDDMStorageLink(DDMStorageLink ddmStorageLink)
269 throws SystemException {
270 return updateDDMStorageLink(ddmStorageLink, true);
271 }
272
273
281 @Indexable(type = IndexableType.REINDEX)
282 public DDMStorageLink updateDDMStorageLink(DDMStorageLink ddmStorageLink,
283 boolean merge) throws SystemException {
284 ddmStorageLink.setNew(false);
285
286 return ddmStorageLinkPersistence.update(ddmStorageLink, merge);
287 }
288
289
294 public DDMContentLocalService getDDMContentLocalService() {
295 return ddmContentLocalService;
296 }
297
298
303 public void setDDMContentLocalService(
304 DDMContentLocalService ddmContentLocalService) {
305 this.ddmContentLocalService = ddmContentLocalService;
306 }
307
308
313 public DDMContentPersistence getDDMContentPersistence() {
314 return ddmContentPersistence;
315 }
316
317
322 public void setDDMContentPersistence(
323 DDMContentPersistence ddmContentPersistence) {
324 this.ddmContentPersistence = ddmContentPersistence;
325 }
326
327
332 public DDMStorageLinkLocalService getDDMStorageLinkLocalService() {
333 return ddmStorageLinkLocalService;
334 }
335
336
341 public void setDDMStorageLinkLocalService(
342 DDMStorageLinkLocalService ddmStorageLinkLocalService) {
343 this.ddmStorageLinkLocalService = ddmStorageLinkLocalService;
344 }
345
346
351 public DDMStorageLinkPersistence getDDMStorageLinkPersistence() {
352 return ddmStorageLinkPersistence;
353 }
354
355
360 public void setDDMStorageLinkPersistence(
361 DDMStorageLinkPersistence ddmStorageLinkPersistence) {
362 this.ddmStorageLinkPersistence = ddmStorageLinkPersistence;
363 }
364
365
370 public DDMStructureLocalService getDDMStructureLocalService() {
371 return ddmStructureLocalService;
372 }
373
374
379 public void setDDMStructureLocalService(
380 DDMStructureLocalService ddmStructureLocalService) {
381 this.ddmStructureLocalService = ddmStructureLocalService;
382 }
383
384
389 public DDMStructureService getDDMStructureService() {
390 return ddmStructureService;
391 }
392
393
398 public void setDDMStructureService(DDMStructureService ddmStructureService) {
399 this.ddmStructureService = ddmStructureService;
400 }
401
402
407 public DDMStructurePersistence getDDMStructurePersistence() {
408 return ddmStructurePersistence;
409 }
410
411
416 public void setDDMStructurePersistence(
417 DDMStructurePersistence ddmStructurePersistence) {
418 this.ddmStructurePersistence = ddmStructurePersistence;
419 }
420
421
426 public DDMStructureFinder getDDMStructureFinder() {
427 return ddmStructureFinder;
428 }
429
430
435 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
436 this.ddmStructureFinder = ddmStructureFinder;
437 }
438
439
444 public DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
445 return ddmStructureLinkLocalService;
446 }
447
448
453 public void setDDMStructureLinkLocalService(
454 DDMStructureLinkLocalService ddmStructureLinkLocalService) {
455 this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
456 }
457
458
463 public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
464 return ddmStructureLinkPersistence;
465 }
466
467
472 public void setDDMStructureLinkPersistence(
473 DDMStructureLinkPersistence ddmStructureLinkPersistence) {
474 this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
475 }
476
477
482 public DDMTemplateLocalService getDDMTemplateLocalService() {
483 return ddmTemplateLocalService;
484 }
485
486
491 public void setDDMTemplateLocalService(
492 DDMTemplateLocalService ddmTemplateLocalService) {
493 this.ddmTemplateLocalService = ddmTemplateLocalService;
494 }
495
496
501 public DDMTemplateService getDDMTemplateService() {
502 return ddmTemplateService;
503 }
504
505
510 public void setDDMTemplateService(DDMTemplateService ddmTemplateService) {
511 this.ddmTemplateService = ddmTemplateService;
512 }
513
514
519 public DDMTemplatePersistence getDDMTemplatePersistence() {
520 return ddmTemplatePersistence;
521 }
522
523
528 public void setDDMTemplatePersistence(
529 DDMTemplatePersistence ddmTemplatePersistence) {
530 this.ddmTemplatePersistence = ddmTemplatePersistence;
531 }
532
533
538 public DDMTemplateFinder getDDMTemplateFinder() {
539 return ddmTemplateFinder;
540 }
541
542
547 public void setDDMTemplateFinder(DDMTemplateFinder ddmTemplateFinder) {
548 this.ddmTemplateFinder = ddmTemplateFinder;
549 }
550
551
556 public CounterLocalService getCounterLocalService() {
557 return counterLocalService;
558 }
559
560
565 public void setCounterLocalService(CounterLocalService counterLocalService) {
566 this.counterLocalService = counterLocalService;
567 }
568
569
574 public ResourceLocalService getResourceLocalService() {
575 return resourceLocalService;
576 }
577
578
583 public void setResourceLocalService(
584 ResourceLocalService resourceLocalService) {
585 this.resourceLocalService = resourceLocalService;
586 }
587
588
593 public ResourceService getResourceService() {
594 return resourceService;
595 }
596
597
602 public void setResourceService(ResourceService resourceService) {
603 this.resourceService = resourceService;
604 }
605
606
611 public ResourcePersistence getResourcePersistence() {
612 return resourcePersistence;
613 }
614
615
620 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
621 this.resourcePersistence = resourcePersistence;
622 }
623
624
629 public ResourceFinder getResourceFinder() {
630 return resourceFinder;
631 }
632
633
638 public void setResourceFinder(ResourceFinder resourceFinder) {
639 this.resourceFinder = resourceFinder;
640 }
641
642
647 public UserLocalService getUserLocalService() {
648 return userLocalService;
649 }
650
651
656 public void setUserLocalService(UserLocalService userLocalService) {
657 this.userLocalService = userLocalService;
658 }
659
660
665 public UserService getUserService() {
666 return userService;
667 }
668
669
674 public void setUserService(UserService userService) {
675 this.userService = userService;
676 }
677
678
683 public UserPersistence getUserPersistence() {
684 return userPersistence;
685 }
686
687
692 public void setUserPersistence(UserPersistence userPersistence) {
693 this.userPersistence = userPersistence;
694 }
695
696
701 public UserFinder getUserFinder() {
702 return userFinder;
703 }
704
705
710 public void setUserFinder(UserFinder userFinder) {
711 this.userFinder = userFinder;
712 }
713
714 public void afterPropertiesSet() {
715 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatamapping.model.DDMStorageLink",
716 ddmStorageLinkLocalService);
717 }
718
719 public void destroy() {
720 persistedModelLocalServiceRegistry.unregister(
721 "com.liferay.portlet.dynamicdatamapping.model.DDMStorageLink");
722 }
723
724
729 public String getBeanIdentifier() {
730 return _beanIdentifier;
731 }
732
733
738 public void setBeanIdentifier(String beanIdentifier) {
739 _beanIdentifier = beanIdentifier;
740 }
741
742 protected Class<?> getModelClass() {
743 return DDMStorageLink.class;
744 }
745
746 protected String getModelClassName() {
747 return DDMStorageLink.class.getName();
748 }
749
750
755 protected void runSQL(String sql) throws SystemException {
756 try {
757 DataSource dataSource = ddmStorageLinkPersistence.getDataSource();
758
759 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
760 sql, new int[0]);
761
762 sqlUpdate.update();
763 }
764 catch (Exception e) {
765 throw new SystemException(e);
766 }
767 }
768
769 @BeanReference(type = DDMContentLocalService.class)
770 protected DDMContentLocalService ddmContentLocalService;
771 @BeanReference(type = DDMContentPersistence.class)
772 protected DDMContentPersistence ddmContentPersistence;
773 @BeanReference(type = DDMStorageLinkLocalService.class)
774 protected DDMStorageLinkLocalService ddmStorageLinkLocalService;
775 @BeanReference(type = DDMStorageLinkPersistence.class)
776 protected DDMStorageLinkPersistence ddmStorageLinkPersistence;
777 @BeanReference(type = DDMStructureLocalService.class)
778 protected DDMStructureLocalService ddmStructureLocalService;
779 @BeanReference(type = DDMStructureService.class)
780 protected DDMStructureService ddmStructureService;
781 @BeanReference(type = DDMStructurePersistence.class)
782 protected DDMStructurePersistence ddmStructurePersistence;
783 @BeanReference(type = DDMStructureFinder.class)
784 protected DDMStructureFinder ddmStructureFinder;
785 @BeanReference(type = DDMStructureLinkLocalService.class)
786 protected DDMStructureLinkLocalService ddmStructureLinkLocalService;
787 @BeanReference(type = DDMStructureLinkPersistence.class)
788 protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
789 @BeanReference(type = DDMTemplateLocalService.class)
790 protected DDMTemplateLocalService ddmTemplateLocalService;
791 @BeanReference(type = DDMTemplateService.class)
792 protected DDMTemplateService ddmTemplateService;
793 @BeanReference(type = DDMTemplatePersistence.class)
794 protected DDMTemplatePersistence ddmTemplatePersistence;
795 @BeanReference(type = DDMTemplateFinder.class)
796 protected DDMTemplateFinder ddmTemplateFinder;
797 @BeanReference(type = CounterLocalService.class)
798 protected CounterLocalService counterLocalService;
799 @BeanReference(type = ResourceLocalService.class)
800 protected ResourceLocalService resourceLocalService;
801 @BeanReference(type = ResourceService.class)
802 protected ResourceService resourceService;
803 @BeanReference(type = ResourcePersistence.class)
804 protected ResourcePersistence resourcePersistence;
805 @BeanReference(type = ResourceFinder.class)
806 protected ResourceFinder resourceFinder;
807 @BeanReference(type = UserLocalService.class)
808 protected UserLocalService userLocalService;
809 @BeanReference(type = UserService.class)
810 protected UserService userService;
811 @BeanReference(type = UserPersistence.class)
812 protected UserPersistence userPersistence;
813 @BeanReference(type = UserFinder.class)
814 protected UserFinder userFinder;
815 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
816 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
817 private String _beanIdentifier;
818 }