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