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