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