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