001    /**
002     * Copyright (c) 2000-present 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.dynamicdatalists.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.bean.IdentifiableBean;
021    import com.liferay.portal.kernel.dao.db.DB;
022    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
024    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
025    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
028    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
029    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
030    import com.liferay.portal.kernel.dao.orm.Projection;
031    import com.liferay.portal.kernel.exception.PortalException;
032    import com.liferay.portal.kernel.exception.SystemException;
033    import com.liferay.portal.kernel.lar.ExportImportHelperUtil;
034    import com.liferay.portal.kernel.lar.ManifestSummary;
035    import com.liferay.portal.kernel.lar.PortletDataContext;
036    import com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil;
037    import com.liferay.portal.kernel.lar.StagedModelType;
038    import com.liferay.portal.kernel.search.Indexable;
039    import com.liferay.portal.kernel.search.IndexableType;
040    import com.liferay.portal.kernel.util.OrderByComparator;
041    import com.liferay.portal.model.PersistedModel;
042    import com.liferay.portal.service.BaseLocalServiceImpl;
043    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
044    import com.liferay.portal.service.persistence.ClassNamePersistence;
045    import com.liferay.portal.service.persistence.UserFinder;
046    import com.liferay.portal.service.persistence.UserPersistence;
047    import com.liferay.portal.service.persistence.WorkflowDefinitionLinkPersistence;
048    import com.liferay.portal.util.PortalUtil;
049    
050    import com.liferay.portlet.dynamicdatalists.model.DDLRecordSet;
051    import com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalService;
052    import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordFinder;
053    import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordPersistence;
054    import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordSetFinder;
055    import com.liferay.portlet.dynamicdatalists.service.persistence.DDLRecordSetPersistence;
056    import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureFinder;
057    import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureLinkPersistence;
058    import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistence;
059    
060    import java.io.Serializable;
061    
062    import java.util.List;
063    
064    import javax.sql.DataSource;
065    
066    /**
067     * Provides the base implementation for the d d l record set 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.dynamicdatalists.service.impl.DDLRecordSetLocalServiceImpl}.
071     * </p>
072     *
073     * @author Brian Wing Shun Chan
074     * @see com.liferay.portlet.dynamicdatalists.service.impl.DDLRecordSetLocalServiceImpl
075     * @see com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalServiceUtil
076     * @generated
077     */
078    @ProviderType
079    public abstract class DDLRecordSetLocalServiceBaseImpl
080            extends BaseLocalServiceImpl implements DDLRecordSetLocalService,
081                    IdentifiableBean {
082            /*
083             * NOTE FOR DEVELOPERS:
084             *
085             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalServiceUtil} to access the d d l record set local service.
086             */
087    
088            /**
089             * Adds the d d l record set to the database. Also notifies the appropriate model listeners.
090             *
091             * @param ddlRecordSet the d d l record set
092             * @return the d d l record set that was added
093             */
094            @Indexable(type = IndexableType.REINDEX)
095            @Override
096            public DDLRecordSet addDDLRecordSet(DDLRecordSet ddlRecordSet) {
097                    ddlRecordSet.setNew(true);
098    
099                    return ddlRecordSetPersistence.update(ddlRecordSet);
100            }
101    
102            /**
103             * Creates a new d d l record set with the primary key. Does not add the d d l record set to the database.
104             *
105             * @param recordSetId the primary key for the new d d l record set
106             * @return the new d d l record set
107             */
108            @Override
109            public DDLRecordSet createDDLRecordSet(long recordSetId) {
110                    return ddlRecordSetPersistence.create(recordSetId);
111            }
112    
113            /**
114             * Deletes the d d l record set with the primary key from the database. Also notifies the appropriate model listeners.
115             *
116             * @param recordSetId the primary key of the d d l record set
117             * @return the d d l record set that was removed
118             * @throws PortalException if a d d l record set with the primary key could not be found
119             */
120            @Indexable(type = IndexableType.DELETE)
121            @Override
122            public DDLRecordSet deleteDDLRecordSet(long recordSetId)
123                    throws PortalException {
124                    return ddlRecordSetPersistence.remove(recordSetId);
125            }
126    
127            /**
128             * Deletes the d d l record set from the database. Also notifies the appropriate model listeners.
129             *
130             * @param ddlRecordSet the d d l record set
131             * @return the d d l record set that was removed
132             */
133            @Indexable(type = IndexableType.DELETE)
134            @Override
135            public DDLRecordSet deleteDDLRecordSet(DDLRecordSet ddlRecordSet) {
136                    return ddlRecordSetPersistence.remove(ddlRecordSet);
137            }
138    
139            @Override
140            public DynamicQuery dynamicQuery() {
141                    Class<?> clazz = getClass();
142    
143                    return DynamicQueryFactoryUtil.forClass(DDLRecordSet.class,
144                            clazz.getClassLoader());
145            }
146    
147            /**
148             * Performs a dynamic query on the database and returns the matching rows.
149             *
150             * @param dynamicQuery the dynamic query
151             * @return the matching rows
152             */
153            @Override
154            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
155                    return ddlRecordSetPersistence.findWithDynamicQuery(dynamicQuery);
156            }
157    
158            /**
159             * Performs a dynamic query on the database and returns a range of the matching rows.
160             *
161             * <p>
162             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatalists.model.impl.DDLRecordSetModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
163             * </p>
164             *
165             * @param dynamicQuery the dynamic query
166             * @param start the lower bound of the range of model instances
167             * @param end the upper bound of the range of model instances (not inclusive)
168             * @return the range of matching rows
169             */
170            @Override
171            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
172                    int end) {
173                    return ddlRecordSetPersistence.findWithDynamicQuery(dynamicQuery,
174                            start, 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatalists.model.impl.DDLRecordSetModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
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             */
190            @Override
191            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
192                    int end, OrderByComparator<T> orderByComparator) {
193                    return ddlRecordSetPersistence.findWithDynamicQuery(dynamicQuery,
194                            start, end, orderByComparator);
195            }
196    
197            /**
198             * Returns the number of rows matching the dynamic query.
199             *
200             * @param dynamicQuery the dynamic query
201             * @return the number of rows matching the dynamic query
202             */
203            @Override
204            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
205                    return ddlRecordSetPersistence.countWithDynamicQuery(dynamicQuery);
206            }
207    
208            /**
209             * Returns the number of rows matching the dynamic query.
210             *
211             * @param dynamicQuery the dynamic query
212             * @param projection the projection to apply to the query
213             * @return the number of rows matching the dynamic query
214             */
215            @Override
216            public long dynamicQueryCount(DynamicQuery dynamicQuery,
217                    Projection projection) {
218                    return ddlRecordSetPersistence.countWithDynamicQuery(dynamicQuery,
219                            projection);
220            }
221    
222            @Override
223            public DDLRecordSet fetchDDLRecordSet(long recordSetId) {
224                    return ddlRecordSetPersistence.fetchByPrimaryKey(recordSetId);
225            }
226    
227            /**
228             * Returns the d d l record set matching the UUID and group.
229             *
230             * @param uuid the d d l record set's UUID
231             * @param groupId the primary key of the group
232             * @return the matching d d l record set, or <code>null</code> if a matching d d l record set could not be found
233             */
234            @Override
235            public DDLRecordSet fetchDDLRecordSetByUuidAndGroupId(String uuid,
236                    long groupId) {
237                    return ddlRecordSetPersistence.fetchByUUID_G(uuid, groupId);
238            }
239    
240            /**
241             * Returns the d d l record set with the primary key.
242             *
243             * @param recordSetId the primary key of the d d l record set
244             * @return the d d l record set
245             * @throws PortalException if a d d l record set with the primary key could not be found
246             */
247            @Override
248            public DDLRecordSet getDDLRecordSet(long recordSetId)
249                    throws PortalException {
250                    return ddlRecordSetPersistence.findByPrimaryKey(recordSetId);
251            }
252    
253            @Override
254            public ActionableDynamicQuery getActionableDynamicQuery() {
255                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
256    
257                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalServiceUtil.getService());
258                    actionableDynamicQuery.setClass(DDLRecordSet.class);
259                    actionableDynamicQuery.setClassLoader(getClassLoader());
260    
261                    actionableDynamicQuery.setPrimaryKeyPropertyName("recordSetId");
262    
263                    return actionableDynamicQuery;
264            }
265    
266            protected void initActionableDynamicQuery(
267                    ActionableDynamicQuery actionableDynamicQuery) {
268                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalServiceUtil.getService());
269                    actionableDynamicQuery.setClass(DDLRecordSet.class);
270                    actionableDynamicQuery.setClassLoader(getClassLoader());
271    
272                    actionableDynamicQuery.setPrimaryKeyPropertyName("recordSetId");
273            }
274    
275            @Override
276            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
277                    final PortletDataContext portletDataContext) {
278                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
279                                    @Override
280                                    public long performCount() throws PortalException {
281                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
282    
283                                            StagedModelType stagedModelType = getStagedModelType();
284    
285                                            long modelAdditionCount = super.performCount();
286    
287                                            manifestSummary.addModelAdditionCount(stagedModelType.toString(),
288                                                    modelAdditionCount);
289    
290                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
291                                                            stagedModelType);
292    
293                                            manifestSummary.addModelDeletionCount(stagedModelType.toString(),
294                                                    modelDeletionCount);
295    
296                                            return modelAdditionCount;
297                                    }
298                            };
299    
300                    initActionableDynamicQuery(exportActionableDynamicQuery);
301    
302                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
303                                    @Override
304                                    public void addCriteria(DynamicQuery dynamicQuery) {
305                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
306                                                    "modifiedDate");
307                                    }
308                            });
309    
310                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
311    
312                    exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
313    
314                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod() {
315                                    @Override
316                                    public void performAction(Object object)
317                                            throws PortalException {
318                                            DDLRecordSet stagedModel = (DDLRecordSet)object;
319    
320                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
321                                                    stagedModel);
322                                    }
323                            });
324                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
325                                    PortalUtil.getClassNameId(DDLRecordSet.class.getName())));
326    
327                    return exportActionableDynamicQuery;
328            }
329    
330            /**
331             * @throws PortalException
332             */
333            @Override
334            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
335                    throws PortalException {
336                    return ddlRecordSetLocalService.deleteDDLRecordSet((DDLRecordSet)persistedModel);
337            }
338    
339            @Override
340            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
341                    throws PortalException {
342                    return ddlRecordSetPersistence.findByPrimaryKey(primaryKeyObj);
343            }
344    
345            /**
346             * Returns all the d d l record sets matching the UUID and company.
347             *
348             * @param uuid the UUID of the d d l record sets
349             * @param companyId the primary key of the company
350             * @return the matching d d l record sets, or an empty list if no matches were found
351             */
352            @Override
353            public List<DDLRecordSet> getDDLRecordSetsByUuidAndCompanyId(String uuid,
354                    long companyId) {
355                    return ddlRecordSetPersistence.findByUuid_C(uuid, companyId);
356            }
357    
358            /**
359             * Returns a range of d d l record sets matching the UUID and company.
360             *
361             * @param uuid the UUID of the d d l record sets
362             * @param companyId the primary key of the company
363             * @param start the lower bound of the range of d d l record sets
364             * @param end the upper bound of the range of d d l record sets (not inclusive)
365             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
366             * @return the range of matching d d l record sets, or an empty list if no matches were found
367             */
368            @Override
369            public List<DDLRecordSet> getDDLRecordSetsByUuidAndCompanyId(String uuid,
370                    long companyId, int start, int end,
371                    OrderByComparator<DDLRecordSet> orderByComparator) {
372                    return ddlRecordSetPersistence.findByUuid_C(uuid, companyId, start,
373                            end, orderByComparator);
374            }
375    
376            /**
377             * Returns the d d l record set matching the UUID and group.
378             *
379             * @param uuid the d d l record set's UUID
380             * @param groupId the primary key of the group
381             * @return the matching d d l record set
382             * @throws PortalException if a matching d d l record set could not be found
383             */
384            @Override
385            public DDLRecordSet getDDLRecordSetByUuidAndGroupId(String uuid,
386                    long groupId) throws PortalException {
387                    return ddlRecordSetPersistence.findByUUID_G(uuid, groupId);
388            }
389    
390            /**
391             * Returns a range of all the d d l record sets.
392             *
393             * <p>
394             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatalists.model.impl.DDLRecordSetModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
395             * </p>
396             *
397             * @param start the lower bound of the range of d d l record sets
398             * @param end the upper bound of the range of d d l record sets (not inclusive)
399             * @return the range of d d l record sets
400             */
401            @Override
402            public List<DDLRecordSet> getDDLRecordSets(int start, int end) {
403                    return ddlRecordSetPersistence.findAll(start, end);
404            }
405    
406            /**
407             * Returns the number of d d l record sets.
408             *
409             * @return the number of d d l record sets
410             */
411            @Override
412            public int getDDLRecordSetsCount() {
413                    return ddlRecordSetPersistence.countAll();
414            }
415    
416            /**
417             * Updates the d d l record set in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
418             *
419             * @param ddlRecordSet the d d l record set
420             * @return the d d l record set that was updated
421             */
422            @Indexable(type = IndexableType.REINDEX)
423            @Override
424            public DDLRecordSet updateDDLRecordSet(DDLRecordSet ddlRecordSet) {
425                    return ddlRecordSetPersistence.update(ddlRecordSet);
426            }
427    
428            /**
429             * Returns the d d l record set local service.
430             *
431             * @return the d d l record set local service
432             */
433            public com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalService getDDLRecordSetLocalService() {
434                    return ddlRecordSetLocalService;
435            }
436    
437            /**
438             * Sets the d d l record set local service.
439             *
440             * @param ddlRecordSetLocalService the d d l record set local service
441             */
442            public void setDDLRecordSetLocalService(
443                    com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalService ddlRecordSetLocalService) {
444                    this.ddlRecordSetLocalService = ddlRecordSetLocalService;
445            }
446    
447            /**
448             * Returns the d d l record set remote service.
449             *
450             * @return the d d l record set remote service
451             */
452            public com.liferay.portlet.dynamicdatalists.service.DDLRecordSetService getDDLRecordSetService() {
453                    return ddlRecordSetService;
454            }
455    
456            /**
457             * Sets the d d l record set remote service.
458             *
459             * @param ddlRecordSetService the d d l record set remote service
460             */
461            public void setDDLRecordSetService(
462                    com.liferay.portlet.dynamicdatalists.service.DDLRecordSetService ddlRecordSetService) {
463                    this.ddlRecordSetService = ddlRecordSetService;
464            }
465    
466            /**
467             * Returns the d d l record set persistence.
468             *
469             * @return the d d l record set persistence
470             */
471            public DDLRecordSetPersistence getDDLRecordSetPersistence() {
472                    return ddlRecordSetPersistence;
473            }
474    
475            /**
476             * Sets the d d l record set persistence.
477             *
478             * @param ddlRecordSetPersistence the d d l record set persistence
479             */
480            public void setDDLRecordSetPersistence(
481                    DDLRecordSetPersistence ddlRecordSetPersistence) {
482                    this.ddlRecordSetPersistence = ddlRecordSetPersistence;
483            }
484    
485            /**
486             * Returns the d d l record set finder.
487             *
488             * @return the d d l record set finder
489             */
490            public DDLRecordSetFinder getDDLRecordSetFinder() {
491                    return ddlRecordSetFinder;
492            }
493    
494            /**
495             * Sets the d d l record set finder.
496             *
497             * @param ddlRecordSetFinder the d d l record set finder
498             */
499            public void setDDLRecordSetFinder(DDLRecordSetFinder ddlRecordSetFinder) {
500                    this.ddlRecordSetFinder = ddlRecordSetFinder;
501            }
502    
503            /**
504             * Returns the counter local service.
505             *
506             * @return the counter local service
507             */
508            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
509                    return counterLocalService;
510            }
511    
512            /**
513             * Sets the counter local service.
514             *
515             * @param counterLocalService the counter local service
516             */
517            public void setCounterLocalService(
518                    com.liferay.counter.service.CounterLocalService counterLocalService) {
519                    this.counterLocalService = counterLocalService;
520            }
521    
522            /**
523             * Returns the class name local service.
524             *
525             * @return the class name local service
526             */
527            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
528                    return classNameLocalService;
529            }
530    
531            /**
532             * Sets the class name local service.
533             *
534             * @param classNameLocalService the class name local service
535             */
536            public void setClassNameLocalService(
537                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
538                    this.classNameLocalService = classNameLocalService;
539            }
540    
541            /**
542             * Returns the class name remote service.
543             *
544             * @return the class name remote service
545             */
546            public com.liferay.portal.service.ClassNameService getClassNameService() {
547                    return classNameService;
548            }
549    
550            /**
551             * Sets the class name remote service.
552             *
553             * @param classNameService the class name remote service
554             */
555            public void setClassNameService(
556                    com.liferay.portal.service.ClassNameService classNameService) {
557                    this.classNameService = classNameService;
558            }
559    
560            /**
561             * Returns the class name persistence.
562             *
563             * @return the class name persistence
564             */
565            public ClassNamePersistence getClassNamePersistence() {
566                    return classNamePersistence;
567            }
568    
569            /**
570             * Sets the class name persistence.
571             *
572             * @param classNamePersistence the class name persistence
573             */
574            public void setClassNamePersistence(
575                    ClassNamePersistence classNamePersistence) {
576                    this.classNamePersistence = classNamePersistence;
577            }
578    
579            /**
580             * Returns the resource local service.
581             *
582             * @return the resource local service
583             */
584            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
585                    return resourceLocalService;
586            }
587    
588            /**
589             * Sets the resource local service.
590             *
591             * @param resourceLocalService the resource local service
592             */
593            public void setResourceLocalService(
594                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
595                    this.resourceLocalService = resourceLocalService;
596            }
597    
598            /**
599             * Returns the user local service.
600             *
601             * @return the user local service
602             */
603            public com.liferay.portal.service.UserLocalService getUserLocalService() {
604                    return userLocalService;
605            }
606    
607            /**
608             * Sets the user local service.
609             *
610             * @param userLocalService the user local service
611             */
612            public void setUserLocalService(
613                    com.liferay.portal.service.UserLocalService userLocalService) {
614                    this.userLocalService = userLocalService;
615            }
616    
617            /**
618             * Returns the user remote service.
619             *
620             * @return the user remote service
621             */
622            public com.liferay.portal.service.UserService getUserService() {
623                    return userService;
624            }
625    
626            /**
627             * Sets the user remote service.
628             *
629             * @param userService the user remote service
630             */
631            public void setUserService(
632                    com.liferay.portal.service.UserService userService) {
633                    this.userService = userService;
634            }
635    
636            /**
637             * Returns the user persistence.
638             *
639             * @return the user persistence
640             */
641            public UserPersistence getUserPersistence() {
642                    return userPersistence;
643            }
644    
645            /**
646             * Sets the user persistence.
647             *
648             * @param userPersistence the user persistence
649             */
650            public void setUserPersistence(UserPersistence userPersistence) {
651                    this.userPersistence = userPersistence;
652            }
653    
654            /**
655             * Returns the user finder.
656             *
657             * @return the user finder
658             */
659            public UserFinder getUserFinder() {
660                    return userFinder;
661            }
662    
663            /**
664             * Sets the user finder.
665             *
666             * @param userFinder the user finder
667             */
668            public void setUserFinder(UserFinder userFinder) {
669                    this.userFinder = userFinder;
670            }
671    
672            /**
673             * Returns the workflow definition link local service.
674             *
675             * @return the workflow definition link local service
676             */
677            public com.liferay.portal.service.WorkflowDefinitionLinkLocalService getWorkflowDefinitionLinkLocalService() {
678                    return workflowDefinitionLinkLocalService;
679            }
680    
681            /**
682             * Sets the workflow definition link local service.
683             *
684             * @param workflowDefinitionLinkLocalService the workflow definition link local service
685             */
686            public void setWorkflowDefinitionLinkLocalService(
687                    com.liferay.portal.service.WorkflowDefinitionLinkLocalService workflowDefinitionLinkLocalService) {
688                    this.workflowDefinitionLinkLocalService = workflowDefinitionLinkLocalService;
689            }
690    
691            /**
692             * Returns the workflow definition link persistence.
693             *
694             * @return the workflow definition link persistence
695             */
696            public WorkflowDefinitionLinkPersistence getWorkflowDefinitionLinkPersistence() {
697                    return workflowDefinitionLinkPersistence;
698            }
699    
700            /**
701             * Sets the workflow definition link persistence.
702             *
703             * @param workflowDefinitionLinkPersistence the workflow definition link persistence
704             */
705            public void setWorkflowDefinitionLinkPersistence(
706                    WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence) {
707                    this.workflowDefinitionLinkPersistence = workflowDefinitionLinkPersistence;
708            }
709    
710            /**
711             * Returns the d d l record local service.
712             *
713             * @return the d d l record local service
714             */
715            public com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService getDDLRecordLocalService() {
716                    return ddlRecordLocalService;
717            }
718    
719            /**
720             * Sets the d d l record local service.
721             *
722             * @param ddlRecordLocalService the d d l record local service
723             */
724            public void setDDLRecordLocalService(
725                    com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService ddlRecordLocalService) {
726                    this.ddlRecordLocalService = ddlRecordLocalService;
727            }
728    
729            /**
730             * Returns the d d l record remote service.
731             *
732             * @return the d d l record remote service
733             */
734            public com.liferay.portlet.dynamicdatalists.service.DDLRecordService getDDLRecordService() {
735                    return ddlRecordService;
736            }
737    
738            /**
739             * Sets the d d l record remote service.
740             *
741             * @param ddlRecordService the d d l record remote service
742             */
743            public void setDDLRecordService(
744                    com.liferay.portlet.dynamicdatalists.service.DDLRecordService ddlRecordService) {
745                    this.ddlRecordService = ddlRecordService;
746            }
747    
748            /**
749             * Returns the d d l record persistence.
750             *
751             * @return the d d l record persistence
752             */
753            public DDLRecordPersistence getDDLRecordPersistence() {
754                    return ddlRecordPersistence;
755            }
756    
757            /**
758             * Sets the d d l record persistence.
759             *
760             * @param ddlRecordPersistence the d d l record persistence
761             */
762            public void setDDLRecordPersistence(
763                    DDLRecordPersistence ddlRecordPersistence) {
764                    this.ddlRecordPersistence = ddlRecordPersistence;
765            }
766    
767            /**
768             * Returns the d d l record finder.
769             *
770             * @return the d d l record finder
771             */
772            public DDLRecordFinder getDDLRecordFinder() {
773                    return ddlRecordFinder;
774            }
775    
776            /**
777             * Sets the d d l record finder.
778             *
779             * @param ddlRecordFinder the d d l record finder
780             */
781            public void setDDLRecordFinder(DDLRecordFinder ddlRecordFinder) {
782                    this.ddlRecordFinder = ddlRecordFinder;
783            }
784    
785            /**
786             * Returns the d d m structure local service.
787             *
788             * @return the d d m structure local service
789             */
790            public com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService getDDMStructureLocalService() {
791                    return ddmStructureLocalService;
792            }
793    
794            /**
795             * Sets the d d m structure local service.
796             *
797             * @param ddmStructureLocalService the d d m structure local service
798             */
799            public void setDDMStructureLocalService(
800                    com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService ddmStructureLocalService) {
801                    this.ddmStructureLocalService = ddmStructureLocalService;
802            }
803    
804            /**
805             * Returns the d d m structure remote service.
806             *
807             * @return the d d m structure remote service
808             */
809            public com.liferay.portlet.dynamicdatamapping.service.DDMStructureService getDDMStructureService() {
810                    return ddmStructureService;
811            }
812    
813            /**
814             * Sets the d d m structure remote service.
815             *
816             * @param ddmStructureService the d d m structure remote service
817             */
818            public void setDDMStructureService(
819                    com.liferay.portlet.dynamicdatamapping.service.DDMStructureService ddmStructureService) {
820                    this.ddmStructureService = ddmStructureService;
821            }
822    
823            /**
824             * Returns the d d m structure persistence.
825             *
826             * @return the d d m structure persistence
827             */
828            public DDMStructurePersistence getDDMStructurePersistence() {
829                    return ddmStructurePersistence;
830            }
831    
832            /**
833             * Sets the d d m structure persistence.
834             *
835             * @param ddmStructurePersistence the d d m structure persistence
836             */
837            public void setDDMStructurePersistence(
838                    DDMStructurePersistence ddmStructurePersistence) {
839                    this.ddmStructurePersistence = ddmStructurePersistence;
840            }
841    
842            /**
843             * Returns the d d m structure finder.
844             *
845             * @return the d d m structure finder
846             */
847            public DDMStructureFinder getDDMStructureFinder() {
848                    return ddmStructureFinder;
849            }
850    
851            /**
852             * Sets the d d m structure finder.
853             *
854             * @param ddmStructureFinder the d d m structure finder
855             */
856            public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
857                    this.ddmStructureFinder = ddmStructureFinder;
858            }
859    
860            /**
861             * Returns the d d m structure link local service.
862             *
863             * @return the d d m structure link local service
864             */
865            public com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
866                    return ddmStructureLinkLocalService;
867            }
868    
869            /**
870             * Sets the d d m structure link local service.
871             *
872             * @param ddmStructureLinkLocalService the d d m structure link local service
873             */
874            public void setDDMStructureLinkLocalService(
875                    com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService ddmStructureLinkLocalService) {
876                    this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
877            }
878    
879            /**
880             * Returns the d d m structure link persistence.
881             *
882             * @return the d d m structure link persistence
883             */
884            public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
885                    return ddmStructureLinkPersistence;
886            }
887    
888            /**
889             * Sets the d d m structure link persistence.
890             *
891             * @param ddmStructureLinkPersistence the d d m structure link persistence
892             */
893            public void setDDMStructureLinkPersistence(
894                    DDMStructureLinkPersistence ddmStructureLinkPersistence) {
895                    this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
896            }
897    
898            public void afterPropertiesSet() {
899                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatalists.model.DDLRecordSet",
900                            ddlRecordSetLocalService);
901            }
902    
903            public void destroy() {
904                    persistedModelLocalServiceRegistry.unregister(
905                            "com.liferay.portlet.dynamicdatalists.model.DDLRecordSet");
906            }
907    
908            /**
909             * Returns the Spring bean ID for this bean.
910             *
911             * @return the Spring bean ID for this bean
912             */
913            @Override
914            public String getBeanIdentifier() {
915                    return _beanIdentifier;
916            }
917    
918            /**
919             * Sets the Spring bean ID for this bean.
920             *
921             * @param beanIdentifier the Spring bean ID for this bean
922             */
923            @Override
924            public void setBeanIdentifier(String beanIdentifier) {
925                    _beanIdentifier = beanIdentifier;
926            }
927    
928            protected Class<?> getModelClass() {
929                    return DDLRecordSet.class;
930            }
931    
932            protected String getModelClassName() {
933                    return DDLRecordSet.class.getName();
934            }
935    
936            /**
937             * Performs a SQL query.
938             *
939             * @param sql the sql query
940             */
941            protected void runSQL(String sql) {
942                    try {
943                            DataSource dataSource = ddlRecordSetPersistence.getDataSource();
944    
945                            DB db = DBFactoryUtil.getDB();
946    
947                            sql = db.buildSQL(sql);
948                            sql = PortalUtil.transformSQL(sql);
949    
950                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
951                                            sql, new int[0]);
952    
953                            sqlUpdate.update();
954                    }
955                    catch (Exception e) {
956                            throw new SystemException(e);
957                    }
958            }
959    
960            @BeanReference(type = com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalService.class)
961            protected com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalService ddlRecordSetLocalService;
962            @BeanReference(type = com.liferay.portlet.dynamicdatalists.service.DDLRecordSetService.class)
963            protected com.liferay.portlet.dynamicdatalists.service.DDLRecordSetService ddlRecordSetService;
964            @BeanReference(type = DDLRecordSetPersistence.class)
965            protected DDLRecordSetPersistence ddlRecordSetPersistence;
966            @BeanReference(type = DDLRecordSetFinder.class)
967            protected DDLRecordSetFinder ddlRecordSetFinder;
968            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
969            protected com.liferay.counter.service.CounterLocalService counterLocalService;
970            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
971            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
972            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
973            protected com.liferay.portal.service.ClassNameService classNameService;
974            @BeanReference(type = ClassNamePersistence.class)
975            protected ClassNamePersistence classNamePersistence;
976            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
977            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
978            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
979            protected com.liferay.portal.service.UserLocalService userLocalService;
980            @BeanReference(type = com.liferay.portal.service.UserService.class)
981            protected com.liferay.portal.service.UserService userService;
982            @BeanReference(type = UserPersistence.class)
983            protected UserPersistence userPersistence;
984            @BeanReference(type = UserFinder.class)
985            protected UserFinder userFinder;
986            @BeanReference(type = com.liferay.portal.service.WorkflowDefinitionLinkLocalService.class)
987            protected com.liferay.portal.service.WorkflowDefinitionLinkLocalService workflowDefinitionLinkLocalService;
988            @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
989            protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
990            @BeanReference(type = com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService.class)
991            protected com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService ddlRecordLocalService;
992            @BeanReference(type = com.liferay.portlet.dynamicdatalists.service.DDLRecordService.class)
993            protected com.liferay.portlet.dynamicdatalists.service.DDLRecordService ddlRecordService;
994            @BeanReference(type = DDLRecordPersistence.class)
995            protected DDLRecordPersistence ddlRecordPersistence;
996            @BeanReference(type = DDLRecordFinder.class)
997            protected DDLRecordFinder ddlRecordFinder;
998            @BeanReference(type = com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService.class)
999            protected com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService ddmStructureLocalService;
1000            @BeanReference(type = com.liferay.portlet.dynamicdatamapping.service.DDMStructureService.class)
1001            protected com.liferay.portlet.dynamicdatamapping.service.DDMStructureService ddmStructureService;
1002            @BeanReference(type = DDMStructurePersistence.class)
1003            protected DDMStructurePersistence ddmStructurePersistence;
1004            @BeanReference(type = DDMStructureFinder.class)
1005            protected DDMStructureFinder ddmStructureFinder;
1006            @BeanReference(type = com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService.class)
1007            protected com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService ddmStructureLinkLocalService;
1008            @BeanReference(type = DDMStructureLinkPersistence.class)
1009            protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
1010            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1011            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1012            private String _beanIdentifier;
1013    }