001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
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.GroupLocalService;
033    import com.liferay.portal.service.GroupService;
034    import com.liferay.portal.service.ImageLocalService;
035    import com.liferay.portal.service.ImageService;
036    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
037    import com.liferay.portal.service.ResourceLocalService;
038    import com.liferay.portal.service.UserLocalService;
039    import com.liferay.portal.service.UserService;
040    import com.liferay.portal.service.persistence.GroupFinder;
041    import com.liferay.portal.service.persistence.GroupPersistence;
042    import com.liferay.portal.service.persistence.ImagePersistence;
043    import com.liferay.portal.service.persistence.UserFinder;
044    import com.liferay.portal.service.persistence.UserPersistence;
045    
046    import com.liferay.portlet.dynamicdatamapping.model.DDMTemplate;
047    import com.liferay.portlet.dynamicdatamapping.service.DDMContentLocalService;
048    import com.liferay.portlet.dynamicdatamapping.service.DDMStorageLinkLocalService;
049    import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService;
050    import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService;
051    import com.liferay.portlet.dynamicdatamapping.service.DDMStructureService;
052    import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalService;
053    import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateService;
054    import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMContentPersistence;
055    import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStorageLinkPersistence;
056    import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureFinder;
057    import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureLinkPersistence;
058    import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistence;
059    import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplateFinder;
060    import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplatePersistence;
061    
062    import java.io.Serializable;
063    
064    import java.util.List;
065    
066    import javax.sql.DataSource;
067    
068    /**
069     * The base implementation of the d d m template local service.
070     *
071     * <p>
072     * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl}.
073     * </p>
074     *
075     * @author Brian Wing Shun Chan
076     * @see com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl
077     * @see com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalServiceUtil
078     * @generated
079     */
080    public abstract class DDMTemplateLocalServiceBaseImpl
081            extends BaseLocalServiceImpl implements DDMTemplateLocalService,
082                    IdentifiableBean {
083            /*
084             * NOTE FOR DEVELOPERS:
085             *
086             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalServiceUtil} to access the d d m template local service.
087             */
088    
089            /**
090             * Adds the d d m template to the database. Also notifies the appropriate model listeners.
091             *
092             * @param ddmTemplate the d d m template
093             * @return the d d m template that was added
094             * @throws SystemException if a system exception occurred
095             */
096            @Indexable(type = IndexableType.REINDEX)
097            public DDMTemplate addDDMTemplate(DDMTemplate ddmTemplate)
098                    throws SystemException {
099                    ddmTemplate.setNew(true);
100    
101                    return ddmTemplatePersistence.update(ddmTemplate);
102            }
103    
104            /**
105             * Creates a new d d m template with the primary key. Does not add the d d m template to the database.
106             *
107             * @param templateId the primary key for the new d d m template
108             * @return the new d d m template
109             */
110            public DDMTemplate createDDMTemplate(long templateId) {
111                    return ddmTemplatePersistence.create(templateId);
112            }
113    
114            /**
115             * Deletes the d d m template with the primary key from the database. Also notifies the appropriate model listeners.
116             *
117             * @param templateId the primary key of the d d m template
118             * @return the d d m template that was removed
119             * @throws PortalException if a d d m template with the primary key could not be found
120             * @throws SystemException if a system exception occurred
121             */
122            @Indexable(type = IndexableType.DELETE)
123            public DDMTemplate deleteDDMTemplate(long templateId)
124                    throws PortalException, SystemException {
125                    return ddmTemplatePersistence.remove(templateId);
126            }
127    
128            /**
129             * Deletes the d d m template from the database. Also notifies the appropriate model listeners.
130             *
131             * @param ddmTemplate the d d m template
132             * @return the d d m template that was removed
133             * @throws SystemException if a system exception occurred
134             */
135            @Indexable(type = IndexableType.DELETE)
136            public DDMTemplate deleteDDMTemplate(DDMTemplate ddmTemplate)
137                    throws SystemException {
138                    return ddmTemplatePersistence.remove(ddmTemplate);
139            }
140    
141            public DynamicQuery dynamicQuery() {
142                    Class<?> clazz = getClass();
143    
144                    return DynamicQueryFactoryUtil.forClass(DDMTemplate.class,
145                            clazz.getClassLoader());
146            }
147    
148            /**
149             * Performs a dynamic query on the database and returns the matching rows.
150             *
151             * @param dynamicQuery the dynamic query
152             * @return the matching rows
153             * @throws SystemException if a system exception occurred
154             */
155            @SuppressWarnings("rawtypes")
156            public List dynamicQuery(DynamicQuery dynamicQuery)
157                    throws SystemException {
158                    return ddmTemplatePersistence.findWithDynamicQuery(dynamicQuery);
159            }
160    
161            /**
162             * Performs a dynamic query on the database and returns a range of the matching rows.
163             *
164             * <p>
165             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatamapping.model.impl.DDMTemplateModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
166             * </p>
167             *
168             * @param dynamicQuery the dynamic query
169             * @param start the lower bound of the range of model instances
170             * @param end the upper bound of the range of model instances (not inclusive)
171             * @return the range of matching rows
172             * @throws SystemException if a system exception occurred
173             */
174            @SuppressWarnings("rawtypes")
175            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
176                    throws SystemException {
177                    return ddmTemplatePersistence.findWithDynamicQuery(dynamicQuery, start,
178                            end);
179            }
180    
181            /**
182             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
183             *
184             * <p>
185             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatamapping.model.impl.DDMTemplateModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
186             * </p>
187             *
188             * @param dynamicQuery the dynamic query
189             * @param start the lower bound of the range of model instances
190             * @param end the upper bound of the range of model instances (not inclusive)
191             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
192             * @return the ordered range of matching rows
193             * @throws SystemException if a system exception occurred
194             */
195            @SuppressWarnings("rawtypes")
196            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
197                    OrderByComparator orderByComparator) throws SystemException {
198                    return ddmTemplatePersistence.findWithDynamicQuery(dynamicQuery, start,
199                            end, orderByComparator);
200            }
201    
202            /**
203             * Returns the number of rows that match the dynamic query.
204             *
205             * @param dynamicQuery the dynamic query
206             * @return the number of rows that match the dynamic query
207             * @throws SystemException if a system exception occurred
208             */
209            public long dynamicQueryCount(DynamicQuery dynamicQuery)
210                    throws SystemException {
211                    return ddmTemplatePersistence.countWithDynamicQuery(dynamicQuery);
212            }
213    
214            public DDMTemplate fetchDDMTemplate(long templateId)
215                    throws SystemException {
216                    return ddmTemplatePersistence.fetchByPrimaryKey(templateId);
217            }
218    
219            /**
220             * Returns the d d m template with the primary key.
221             *
222             * @param templateId the primary key of the d d m template
223             * @return the d d m template
224             * @throws PortalException if a d d m template with the primary key could not be found
225             * @throws SystemException if a system exception occurred
226             */
227            public DDMTemplate getDDMTemplate(long templateId)
228                    throws PortalException, SystemException {
229                    return ddmTemplatePersistence.findByPrimaryKey(templateId);
230            }
231    
232            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
233                    throws PortalException, SystemException {
234                    return ddmTemplatePersistence.findByPrimaryKey(primaryKeyObj);
235            }
236    
237            /**
238             * Returns the d d m template matching the UUID and group.
239             *
240             * @param uuid the d d m template's UUID
241             * @param groupId the primary key of the group
242             * @return the matching d d m template
243             * @throws PortalException if a matching d d m template could not be found
244             * @throws SystemException if a system exception occurred
245             */
246            public DDMTemplate getDDMTemplateByUuidAndGroupId(String uuid, long groupId)
247                    throws PortalException, SystemException {
248                    return ddmTemplatePersistence.findByUUID_G(uuid, groupId);
249            }
250    
251            /**
252             * Returns a range of all the d d m templates.
253             *
254             * <p>
255             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatamapping.model.impl.DDMTemplateModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
256             * </p>
257             *
258             * @param start the lower bound of the range of d d m templates
259             * @param end the upper bound of the range of d d m templates (not inclusive)
260             * @return the range of d d m templates
261             * @throws SystemException if a system exception occurred
262             */
263            public List<DDMTemplate> getDDMTemplates(int start, int end)
264                    throws SystemException {
265                    return ddmTemplatePersistence.findAll(start, end);
266            }
267    
268            /**
269             * Returns the number of d d m templates.
270             *
271             * @return the number of d d m templates
272             * @throws SystemException if a system exception occurred
273             */
274            public int getDDMTemplatesCount() throws SystemException {
275                    return ddmTemplatePersistence.countAll();
276            }
277    
278            /**
279             * Updates the d d m template in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
280             *
281             * @param ddmTemplate the d d m template
282             * @return the d d m template that was updated
283             * @throws SystemException if a system exception occurred
284             */
285            @Indexable(type = IndexableType.REINDEX)
286            public DDMTemplate updateDDMTemplate(DDMTemplate ddmTemplate)
287                    throws SystemException {
288                    return ddmTemplatePersistence.update(ddmTemplate);
289            }
290    
291            /**
292             * Returns the d d m content local service.
293             *
294             * @return the d d m content local service
295             */
296            public DDMContentLocalService getDDMContentLocalService() {
297                    return ddmContentLocalService;
298            }
299    
300            /**
301             * Sets the d d m content local service.
302             *
303             * @param ddmContentLocalService the d d m content local service
304             */
305            public void setDDMContentLocalService(
306                    DDMContentLocalService ddmContentLocalService) {
307                    this.ddmContentLocalService = ddmContentLocalService;
308            }
309    
310            /**
311             * Returns the d d m content persistence.
312             *
313             * @return the d d m content persistence
314             */
315            public DDMContentPersistence getDDMContentPersistence() {
316                    return ddmContentPersistence;
317            }
318    
319            /**
320             * Sets the d d m content persistence.
321             *
322             * @param ddmContentPersistence the d d m content persistence
323             */
324            public void setDDMContentPersistence(
325                    DDMContentPersistence ddmContentPersistence) {
326                    this.ddmContentPersistence = ddmContentPersistence;
327            }
328    
329            /**
330             * Returns the d d m storage link local service.
331             *
332             * @return the d d m storage link local service
333             */
334            public DDMStorageLinkLocalService getDDMStorageLinkLocalService() {
335                    return ddmStorageLinkLocalService;
336            }
337    
338            /**
339             * Sets the d d m storage link local service.
340             *
341             * @param ddmStorageLinkLocalService the d d m storage link local service
342             */
343            public void setDDMStorageLinkLocalService(
344                    DDMStorageLinkLocalService ddmStorageLinkLocalService) {
345                    this.ddmStorageLinkLocalService = ddmStorageLinkLocalService;
346            }
347    
348            /**
349             * Returns the d d m storage link persistence.
350             *
351             * @return the d d m storage link persistence
352             */
353            public DDMStorageLinkPersistence getDDMStorageLinkPersistence() {
354                    return ddmStorageLinkPersistence;
355            }
356    
357            /**
358             * Sets the d d m storage link persistence.
359             *
360             * @param ddmStorageLinkPersistence the d d m storage link persistence
361             */
362            public void setDDMStorageLinkPersistence(
363                    DDMStorageLinkPersistence ddmStorageLinkPersistence) {
364                    this.ddmStorageLinkPersistence = ddmStorageLinkPersistence;
365            }
366    
367            /**
368             * Returns the d d m structure local service.
369             *
370             * @return the d d m structure local service
371             */
372            public DDMStructureLocalService getDDMStructureLocalService() {
373                    return ddmStructureLocalService;
374            }
375    
376            /**
377             * Sets the d d m structure local service.
378             *
379             * @param ddmStructureLocalService the d d m structure local service
380             */
381            public void setDDMStructureLocalService(
382                    DDMStructureLocalService ddmStructureLocalService) {
383                    this.ddmStructureLocalService = ddmStructureLocalService;
384            }
385    
386            /**
387             * Returns the d d m structure remote service.
388             *
389             * @return the d d m structure remote service
390             */
391            public DDMStructureService getDDMStructureService() {
392                    return ddmStructureService;
393            }
394    
395            /**
396             * Sets the d d m structure remote service.
397             *
398             * @param ddmStructureService the d d m structure remote service
399             */
400            public void setDDMStructureService(DDMStructureService ddmStructureService) {
401                    this.ddmStructureService = ddmStructureService;
402            }
403    
404            /**
405             * Returns the d d m structure persistence.
406             *
407             * @return the d d m structure persistence
408             */
409            public DDMStructurePersistence getDDMStructurePersistence() {
410                    return ddmStructurePersistence;
411            }
412    
413            /**
414             * Sets the d d m structure persistence.
415             *
416             * @param ddmStructurePersistence the d d m structure persistence
417             */
418            public void setDDMStructurePersistence(
419                    DDMStructurePersistence ddmStructurePersistence) {
420                    this.ddmStructurePersistence = ddmStructurePersistence;
421            }
422    
423            /**
424             * Returns the d d m structure finder.
425             *
426             * @return the d d m structure finder
427             */
428            public DDMStructureFinder getDDMStructureFinder() {
429                    return ddmStructureFinder;
430            }
431    
432            /**
433             * Sets the d d m structure finder.
434             *
435             * @param ddmStructureFinder the d d m structure finder
436             */
437            public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
438                    this.ddmStructureFinder = ddmStructureFinder;
439            }
440    
441            /**
442             * Returns the d d m structure link local service.
443             *
444             * @return the d d m structure link local service
445             */
446            public DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
447                    return ddmStructureLinkLocalService;
448            }
449    
450            /**
451             * Sets the d d m structure link local service.
452             *
453             * @param ddmStructureLinkLocalService the d d m structure link local service
454             */
455            public void setDDMStructureLinkLocalService(
456                    DDMStructureLinkLocalService ddmStructureLinkLocalService) {
457                    this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
458            }
459    
460            /**
461             * Returns the d d m structure link persistence.
462             *
463             * @return the d d m structure link persistence
464             */
465            public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
466                    return ddmStructureLinkPersistence;
467            }
468    
469            /**
470             * Sets the d d m structure link persistence.
471             *
472             * @param ddmStructureLinkPersistence the d d m structure link persistence
473             */
474            public void setDDMStructureLinkPersistence(
475                    DDMStructureLinkPersistence ddmStructureLinkPersistence) {
476                    this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
477            }
478    
479            /**
480             * Returns the d d m template local service.
481             *
482             * @return the d d m template local service
483             */
484            public DDMTemplateLocalService getDDMTemplateLocalService() {
485                    return ddmTemplateLocalService;
486            }
487    
488            /**
489             * Sets the d d m template local service.
490             *
491             * @param ddmTemplateLocalService the d d m template local service
492             */
493            public void setDDMTemplateLocalService(
494                    DDMTemplateLocalService ddmTemplateLocalService) {
495                    this.ddmTemplateLocalService = ddmTemplateLocalService;
496            }
497    
498            /**
499             * Returns the d d m template remote service.
500             *
501             * @return the d d m template remote service
502             */
503            public DDMTemplateService getDDMTemplateService() {
504                    return ddmTemplateService;
505            }
506    
507            /**
508             * Sets the d d m template remote service.
509             *
510             * @param ddmTemplateService the d d m template remote service
511             */
512            public void setDDMTemplateService(DDMTemplateService ddmTemplateService) {
513                    this.ddmTemplateService = ddmTemplateService;
514            }
515    
516            /**
517             * Returns the d d m template persistence.
518             *
519             * @return the d d m template persistence
520             */
521            public DDMTemplatePersistence getDDMTemplatePersistence() {
522                    return ddmTemplatePersistence;
523            }
524    
525            /**
526             * Sets the d d m template persistence.
527             *
528             * @param ddmTemplatePersistence the d d m template persistence
529             */
530            public void setDDMTemplatePersistence(
531                    DDMTemplatePersistence ddmTemplatePersistence) {
532                    this.ddmTemplatePersistence = ddmTemplatePersistence;
533            }
534    
535            /**
536             * Returns the d d m template finder.
537             *
538             * @return the d d m template finder
539             */
540            public DDMTemplateFinder getDDMTemplateFinder() {
541                    return ddmTemplateFinder;
542            }
543    
544            /**
545             * Sets the d d m template finder.
546             *
547             * @param ddmTemplateFinder the d d m template finder
548             */
549            public void setDDMTemplateFinder(DDMTemplateFinder ddmTemplateFinder) {
550                    this.ddmTemplateFinder = ddmTemplateFinder;
551            }
552    
553            /**
554             * Returns the counter local service.
555             *
556             * @return the counter local service
557             */
558            public CounterLocalService getCounterLocalService() {
559                    return counterLocalService;
560            }
561    
562            /**
563             * Sets the counter local service.
564             *
565             * @param counterLocalService the counter local service
566             */
567            public void setCounterLocalService(CounterLocalService counterLocalService) {
568                    this.counterLocalService = counterLocalService;
569            }
570    
571            /**
572             * Returns the group local service.
573             *
574             * @return the group local service
575             */
576            public GroupLocalService getGroupLocalService() {
577                    return groupLocalService;
578            }
579    
580            /**
581             * Sets the group local service.
582             *
583             * @param groupLocalService the group local service
584             */
585            public void setGroupLocalService(GroupLocalService groupLocalService) {
586                    this.groupLocalService = groupLocalService;
587            }
588    
589            /**
590             * Returns the group remote service.
591             *
592             * @return the group remote service
593             */
594            public GroupService getGroupService() {
595                    return groupService;
596            }
597    
598            /**
599             * Sets the group remote service.
600             *
601             * @param groupService the group remote service
602             */
603            public void setGroupService(GroupService groupService) {
604                    this.groupService = groupService;
605            }
606    
607            /**
608             * Returns the group persistence.
609             *
610             * @return the group persistence
611             */
612            public GroupPersistence getGroupPersistence() {
613                    return groupPersistence;
614            }
615    
616            /**
617             * Sets the group persistence.
618             *
619             * @param groupPersistence the group persistence
620             */
621            public void setGroupPersistence(GroupPersistence groupPersistence) {
622                    this.groupPersistence = groupPersistence;
623            }
624    
625            /**
626             * Returns the group finder.
627             *
628             * @return the group finder
629             */
630            public GroupFinder getGroupFinder() {
631                    return groupFinder;
632            }
633    
634            /**
635             * Sets the group finder.
636             *
637             * @param groupFinder the group finder
638             */
639            public void setGroupFinder(GroupFinder groupFinder) {
640                    this.groupFinder = groupFinder;
641            }
642    
643            /**
644             * Returns the image local service.
645             *
646             * @return the image local service
647             */
648            public ImageLocalService getImageLocalService() {
649                    return imageLocalService;
650            }
651    
652            /**
653             * Sets the image local service.
654             *
655             * @param imageLocalService the image local service
656             */
657            public void setImageLocalService(ImageLocalService imageLocalService) {
658                    this.imageLocalService = imageLocalService;
659            }
660    
661            /**
662             * Returns the image remote service.
663             *
664             * @return the image remote service
665             */
666            public ImageService getImageService() {
667                    return imageService;
668            }
669    
670            /**
671             * Sets the image remote service.
672             *
673             * @param imageService the image remote service
674             */
675            public void setImageService(ImageService imageService) {
676                    this.imageService = imageService;
677            }
678    
679            /**
680             * Returns the image persistence.
681             *
682             * @return the image persistence
683             */
684            public ImagePersistence getImagePersistence() {
685                    return imagePersistence;
686            }
687    
688            /**
689             * Sets the image persistence.
690             *
691             * @param imagePersistence the image persistence
692             */
693            public void setImagePersistence(ImagePersistence imagePersistence) {
694                    this.imagePersistence = imagePersistence;
695            }
696    
697            /**
698             * Returns the resource local service.
699             *
700             * @return the resource local service
701             */
702            public ResourceLocalService getResourceLocalService() {
703                    return resourceLocalService;
704            }
705    
706            /**
707             * Sets the resource local service.
708             *
709             * @param resourceLocalService the resource local service
710             */
711            public void setResourceLocalService(
712                    ResourceLocalService resourceLocalService) {
713                    this.resourceLocalService = resourceLocalService;
714            }
715    
716            /**
717             * Returns the user local service.
718             *
719             * @return the user local service
720             */
721            public UserLocalService getUserLocalService() {
722                    return userLocalService;
723            }
724    
725            /**
726             * Sets the user local service.
727             *
728             * @param userLocalService the user local service
729             */
730            public void setUserLocalService(UserLocalService userLocalService) {
731                    this.userLocalService = userLocalService;
732            }
733    
734            /**
735             * Returns the user remote service.
736             *
737             * @return the user remote service
738             */
739            public UserService getUserService() {
740                    return userService;
741            }
742    
743            /**
744             * Sets the user remote service.
745             *
746             * @param userService the user remote service
747             */
748            public void setUserService(UserService userService) {
749                    this.userService = userService;
750            }
751    
752            /**
753             * Returns the user persistence.
754             *
755             * @return the user persistence
756             */
757            public UserPersistence getUserPersistence() {
758                    return userPersistence;
759            }
760    
761            /**
762             * Sets the user persistence.
763             *
764             * @param userPersistence the user persistence
765             */
766            public void setUserPersistence(UserPersistence userPersistence) {
767                    this.userPersistence = userPersistence;
768            }
769    
770            /**
771             * Returns the user finder.
772             *
773             * @return the user finder
774             */
775            public UserFinder getUserFinder() {
776                    return userFinder;
777            }
778    
779            /**
780             * Sets the user finder.
781             *
782             * @param userFinder the user finder
783             */
784            public void setUserFinder(UserFinder userFinder) {
785                    this.userFinder = userFinder;
786            }
787    
788            public void afterPropertiesSet() {
789                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatamapping.model.DDMTemplate",
790                            ddmTemplateLocalService);
791            }
792    
793            public void destroy() {
794                    persistedModelLocalServiceRegistry.unregister(
795                            "com.liferay.portlet.dynamicdatamapping.model.DDMTemplate");
796            }
797    
798            /**
799             * Returns the Spring bean ID for this bean.
800             *
801             * @return the Spring bean ID for this bean
802             */
803            public String getBeanIdentifier() {
804                    return _beanIdentifier;
805            }
806    
807            /**
808             * Sets the Spring bean ID for this bean.
809             *
810             * @param beanIdentifier the Spring bean ID for this bean
811             */
812            public void setBeanIdentifier(String beanIdentifier) {
813                    _beanIdentifier = beanIdentifier;
814            }
815    
816            protected Class<?> getModelClass() {
817                    return DDMTemplate.class;
818            }
819    
820            protected String getModelClassName() {
821                    return DDMTemplate.class.getName();
822            }
823    
824            /**
825             * Performs an SQL query.
826             *
827             * @param sql the sql query
828             */
829            protected void runSQL(String sql) throws SystemException {
830                    try {
831                            DataSource dataSource = ddmTemplatePersistence.getDataSource();
832    
833                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
834                                            sql, new int[0]);
835    
836                            sqlUpdate.update();
837                    }
838                    catch (Exception e) {
839                            throw new SystemException(e);
840                    }
841            }
842    
843            @BeanReference(type = DDMContentLocalService.class)
844            protected DDMContentLocalService ddmContentLocalService;
845            @BeanReference(type = DDMContentPersistence.class)
846            protected DDMContentPersistence ddmContentPersistence;
847            @BeanReference(type = DDMStorageLinkLocalService.class)
848            protected DDMStorageLinkLocalService ddmStorageLinkLocalService;
849            @BeanReference(type = DDMStorageLinkPersistence.class)
850            protected DDMStorageLinkPersistence ddmStorageLinkPersistence;
851            @BeanReference(type = DDMStructureLocalService.class)
852            protected DDMStructureLocalService ddmStructureLocalService;
853            @BeanReference(type = DDMStructureService.class)
854            protected DDMStructureService ddmStructureService;
855            @BeanReference(type = DDMStructurePersistence.class)
856            protected DDMStructurePersistence ddmStructurePersistence;
857            @BeanReference(type = DDMStructureFinder.class)
858            protected DDMStructureFinder ddmStructureFinder;
859            @BeanReference(type = DDMStructureLinkLocalService.class)
860            protected DDMStructureLinkLocalService ddmStructureLinkLocalService;
861            @BeanReference(type = DDMStructureLinkPersistence.class)
862            protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
863            @BeanReference(type = DDMTemplateLocalService.class)
864            protected DDMTemplateLocalService ddmTemplateLocalService;
865            @BeanReference(type = DDMTemplateService.class)
866            protected DDMTemplateService ddmTemplateService;
867            @BeanReference(type = DDMTemplatePersistence.class)
868            protected DDMTemplatePersistence ddmTemplatePersistence;
869            @BeanReference(type = DDMTemplateFinder.class)
870            protected DDMTemplateFinder ddmTemplateFinder;
871            @BeanReference(type = CounterLocalService.class)
872            protected CounterLocalService counterLocalService;
873            @BeanReference(type = GroupLocalService.class)
874            protected GroupLocalService groupLocalService;
875            @BeanReference(type = GroupService.class)
876            protected GroupService groupService;
877            @BeanReference(type = GroupPersistence.class)
878            protected GroupPersistence groupPersistence;
879            @BeanReference(type = GroupFinder.class)
880            protected GroupFinder groupFinder;
881            @BeanReference(type = ImageLocalService.class)
882            protected ImageLocalService imageLocalService;
883            @BeanReference(type = ImageService.class)
884            protected ImageService imageService;
885            @BeanReference(type = ImagePersistence.class)
886            protected ImagePersistence imagePersistence;
887            @BeanReference(type = ResourceLocalService.class)
888            protected ResourceLocalService resourceLocalService;
889            @BeanReference(type = UserLocalService.class)
890            protected UserLocalService userLocalService;
891            @BeanReference(type = UserService.class)
892            protected UserService userService;
893            @BeanReference(type = UserPersistence.class)
894            protected UserPersistence userPersistence;
895            @BeanReference(type = UserFinder.class)
896            protected UserFinder userFinder;
897            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
898            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
899            private String _beanIdentifier;
900    }