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