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 that match the dynamic query.
198             *
199             * @param dynamicQuery the dynamic query
200             * @return the number of rows that match 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 that match 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 that match 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            @Override
343            public List<DDLRecord> getDDLRecordsByUuidAndCompanyId(String uuid,
344                    long companyId) {
345                    return ddlRecordPersistence.findByUuid_C(uuid, companyId);
346            }
347    
348            @Override
349            public List<DDLRecord> getDDLRecordsByUuidAndCompanyId(String uuid,
350                    long companyId, int start, int end,
351                    OrderByComparator<DDLRecord> orderByComparator) {
352                    return ddlRecordPersistence.findByUuid_C(uuid, companyId, start, end,
353                            orderByComparator);
354            }
355    
356            /**
357             * Returns the d d l record matching the UUID and group.
358             *
359             * @param uuid the d d l record's UUID
360             * @param groupId the primary key of the group
361             * @return the matching d d l record
362             * @throws PortalException if a matching d d l record could not be found
363             */
364            @Override
365            public DDLRecord getDDLRecordByUuidAndGroupId(String uuid, long groupId)
366                    throws PortalException {
367                    return ddlRecordPersistence.findByUUID_G(uuid, groupId);
368            }
369    
370            /**
371             * Returns a range of all the d d l records.
372             *
373             * <p>
374             * 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.
375             * </p>
376             *
377             * @param start the lower bound of the range of d d l records
378             * @param end the upper bound of the range of d d l records (not inclusive)
379             * @return the range of d d l records
380             */
381            @Override
382            public List<DDLRecord> getDDLRecords(int start, int end) {
383                    return ddlRecordPersistence.findAll(start, end);
384            }
385    
386            /**
387             * Returns the number of d d l records.
388             *
389             * @return the number of d d l records
390             */
391            @Override
392            public int getDDLRecordsCount() {
393                    return ddlRecordPersistence.countAll();
394            }
395    
396            /**
397             * Updates the d d l record in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
398             *
399             * @param ddlRecord the d d l record
400             * @return the d d l record that was updated
401             */
402            @Indexable(type = IndexableType.REINDEX)
403            @Override
404            public DDLRecord updateDDLRecord(DDLRecord ddlRecord) {
405                    return ddlRecordPersistence.update(ddlRecord);
406            }
407    
408            /**
409             * Returns the d d l record local service.
410             *
411             * @return the d d l record local service
412             */
413            public com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService getDDLRecordLocalService() {
414                    return ddlRecordLocalService;
415            }
416    
417            /**
418             * Sets the d d l record local service.
419             *
420             * @param ddlRecordLocalService the d d l record local service
421             */
422            public void setDDLRecordLocalService(
423                    com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService ddlRecordLocalService) {
424                    this.ddlRecordLocalService = ddlRecordLocalService;
425            }
426    
427            /**
428             * Returns the d d l record remote service.
429             *
430             * @return the d d l record remote service
431             */
432            public com.liferay.portlet.dynamicdatalists.service.DDLRecordService getDDLRecordService() {
433                    return ddlRecordService;
434            }
435    
436            /**
437             * Sets the d d l record remote service.
438             *
439             * @param ddlRecordService the d d l record remote service
440             */
441            public void setDDLRecordService(
442                    com.liferay.portlet.dynamicdatalists.service.DDLRecordService ddlRecordService) {
443                    this.ddlRecordService = ddlRecordService;
444            }
445    
446            /**
447             * Returns the d d l record persistence.
448             *
449             * @return the d d l record persistence
450             */
451            public DDLRecordPersistence getDDLRecordPersistence() {
452                    return ddlRecordPersistence;
453            }
454    
455            /**
456             * Sets the d d l record persistence.
457             *
458             * @param ddlRecordPersistence the d d l record persistence
459             */
460            public void setDDLRecordPersistence(
461                    DDLRecordPersistence ddlRecordPersistence) {
462                    this.ddlRecordPersistence = ddlRecordPersistence;
463            }
464    
465            /**
466             * Returns the d d l record finder.
467             *
468             * @return the d d l record finder
469             */
470            public DDLRecordFinder getDDLRecordFinder() {
471                    return ddlRecordFinder;
472            }
473    
474            /**
475             * Sets the d d l record finder.
476             *
477             * @param ddlRecordFinder the d d l record finder
478             */
479            public void setDDLRecordFinder(DDLRecordFinder ddlRecordFinder) {
480                    this.ddlRecordFinder = ddlRecordFinder;
481            }
482    
483            /**
484             * Returns the counter local service.
485             *
486             * @return the counter local service
487             */
488            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
489                    return counterLocalService;
490            }
491    
492            /**
493             * Sets the counter local service.
494             *
495             * @param counterLocalService the counter local service
496             */
497            public void setCounterLocalService(
498                    com.liferay.counter.service.CounterLocalService counterLocalService) {
499                    this.counterLocalService = counterLocalService;
500            }
501    
502            /**
503             * Returns the user local service.
504             *
505             * @return the user local service
506             */
507            public com.liferay.portal.service.UserLocalService getUserLocalService() {
508                    return userLocalService;
509            }
510    
511            /**
512             * Sets the user local service.
513             *
514             * @param userLocalService the user local service
515             */
516            public void setUserLocalService(
517                    com.liferay.portal.service.UserLocalService userLocalService) {
518                    this.userLocalService = userLocalService;
519            }
520    
521            /**
522             * Returns the user remote service.
523             *
524             * @return the user remote service
525             */
526            public com.liferay.portal.service.UserService getUserService() {
527                    return userService;
528            }
529    
530            /**
531             * Sets the user remote service.
532             *
533             * @param userService the user remote service
534             */
535            public void setUserService(
536                    com.liferay.portal.service.UserService userService) {
537                    this.userService = userService;
538            }
539    
540            /**
541             * Returns the user persistence.
542             *
543             * @return the user persistence
544             */
545            public UserPersistence getUserPersistence() {
546                    return userPersistence;
547            }
548    
549            /**
550             * Sets the user persistence.
551             *
552             * @param userPersistence the user persistence
553             */
554            public void setUserPersistence(UserPersistence userPersistence) {
555                    this.userPersistence = userPersistence;
556            }
557    
558            /**
559             * Returns the user finder.
560             *
561             * @return the user finder
562             */
563            public UserFinder getUserFinder() {
564                    return userFinder;
565            }
566    
567            /**
568             * Sets the user finder.
569             *
570             * @param userFinder the user finder
571             */
572            public void setUserFinder(UserFinder userFinder) {
573                    this.userFinder = userFinder;
574            }
575    
576            /**
577             * Returns the workflow instance link local service.
578             *
579             * @return the workflow instance link local service
580             */
581            public com.liferay.portal.service.WorkflowInstanceLinkLocalService getWorkflowInstanceLinkLocalService() {
582                    return workflowInstanceLinkLocalService;
583            }
584    
585            /**
586             * Sets the workflow instance link local service.
587             *
588             * @param workflowInstanceLinkLocalService the workflow instance link local service
589             */
590            public void setWorkflowInstanceLinkLocalService(
591                    com.liferay.portal.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService) {
592                    this.workflowInstanceLinkLocalService = workflowInstanceLinkLocalService;
593            }
594    
595            /**
596             * Returns the workflow instance link persistence.
597             *
598             * @return the workflow instance link persistence
599             */
600            public WorkflowInstanceLinkPersistence getWorkflowInstanceLinkPersistence() {
601                    return workflowInstanceLinkPersistence;
602            }
603    
604            /**
605             * Sets the workflow instance link persistence.
606             *
607             * @param workflowInstanceLinkPersistence the workflow instance link persistence
608             */
609            public void setWorkflowInstanceLinkPersistence(
610                    WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence) {
611                    this.workflowInstanceLinkPersistence = workflowInstanceLinkPersistence;
612            }
613    
614            /**
615             * Returns the asset entry local service.
616             *
617             * @return the asset entry local service
618             */
619            public com.liferay.portlet.asset.service.AssetEntryLocalService getAssetEntryLocalService() {
620                    return assetEntryLocalService;
621            }
622    
623            /**
624             * Sets the asset entry local service.
625             *
626             * @param assetEntryLocalService the asset entry local service
627             */
628            public void setAssetEntryLocalService(
629                    com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService) {
630                    this.assetEntryLocalService = assetEntryLocalService;
631            }
632    
633            /**
634             * Returns the asset entry remote service.
635             *
636             * @return the asset entry remote service
637             */
638            public com.liferay.portlet.asset.service.AssetEntryService getAssetEntryService() {
639                    return assetEntryService;
640            }
641    
642            /**
643             * Sets the asset entry remote service.
644             *
645             * @param assetEntryService the asset entry remote service
646             */
647            public void setAssetEntryService(
648                    com.liferay.portlet.asset.service.AssetEntryService assetEntryService) {
649                    this.assetEntryService = assetEntryService;
650            }
651    
652            /**
653             * Returns the asset entry persistence.
654             *
655             * @return the asset entry persistence
656             */
657            public AssetEntryPersistence getAssetEntryPersistence() {
658                    return assetEntryPersistence;
659            }
660    
661            /**
662             * Sets the asset entry persistence.
663             *
664             * @param assetEntryPersistence the asset entry persistence
665             */
666            public void setAssetEntryPersistence(
667                    AssetEntryPersistence assetEntryPersistence) {
668                    this.assetEntryPersistence = assetEntryPersistence;
669            }
670    
671            /**
672             * Returns the asset entry finder.
673             *
674             * @return the asset entry finder
675             */
676            public AssetEntryFinder getAssetEntryFinder() {
677                    return assetEntryFinder;
678            }
679    
680            /**
681             * Sets the asset entry finder.
682             *
683             * @param assetEntryFinder the asset entry finder
684             */
685            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
686                    this.assetEntryFinder = assetEntryFinder;
687            }
688    
689            /**
690             * Returns the d d m structure local service.
691             *
692             * @return the d d m structure local service
693             */
694            public com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService getDDMStructureLocalService() {
695                    return ddmStructureLocalService;
696            }
697    
698            /**
699             * Sets the d d m structure local service.
700             *
701             * @param ddmStructureLocalService the d d m structure local service
702             */
703            public void setDDMStructureLocalService(
704                    com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService ddmStructureLocalService) {
705                    this.ddmStructureLocalService = ddmStructureLocalService;
706            }
707    
708            /**
709             * Returns the d d m structure remote service.
710             *
711             * @return the d d m structure remote service
712             */
713            public com.liferay.portlet.dynamicdatamapping.service.DDMStructureService getDDMStructureService() {
714                    return ddmStructureService;
715            }
716    
717            /**
718             * Sets the d d m structure remote service.
719             *
720             * @param ddmStructureService the d d m structure remote service
721             */
722            public void setDDMStructureService(
723                    com.liferay.portlet.dynamicdatamapping.service.DDMStructureService ddmStructureService) {
724                    this.ddmStructureService = ddmStructureService;
725            }
726    
727            /**
728             * Returns the d d m structure persistence.
729             *
730             * @return the d d m structure persistence
731             */
732            public DDMStructurePersistence getDDMStructurePersistence() {
733                    return ddmStructurePersistence;
734            }
735    
736            /**
737             * Sets the d d m structure persistence.
738             *
739             * @param ddmStructurePersistence the d d m structure persistence
740             */
741            public void setDDMStructurePersistence(
742                    DDMStructurePersistence ddmStructurePersistence) {
743                    this.ddmStructurePersistence = ddmStructurePersistence;
744            }
745    
746            /**
747             * Returns the d d m structure finder.
748             *
749             * @return the d d m structure finder
750             */
751            public DDMStructureFinder getDDMStructureFinder() {
752                    return ddmStructureFinder;
753            }
754    
755            /**
756             * Sets the d d m structure finder.
757             *
758             * @param ddmStructureFinder the d d m structure finder
759             */
760            public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
761                    this.ddmStructureFinder = ddmStructureFinder;
762            }
763    
764            /**
765             * Returns the d d l record set local service.
766             *
767             * @return the d d l record set local service
768             */
769            public com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalService getDDLRecordSetLocalService() {
770                    return ddlRecordSetLocalService;
771            }
772    
773            /**
774             * Sets the d d l record set local service.
775             *
776             * @param ddlRecordSetLocalService the d d l record set local service
777             */
778            public void setDDLRecordSetLocalService(
779                    com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalService ddlRecordSetLocalService) {
780                    this.ddlRecordSetLocalService = ddlRecordSetLocalService;
781            }
782    
783            /**
784             * Returns the d d l record set remote service.
785             *
786             * @return the d d l record set remote service
787             */
788            public com.liferay.portlet.dynamicdatalists.service.DDLRecordSetService getDDLRecordSetService() {
789                    return ddlRecordSetService;
790            }
791    
792            /**
793             * Sets the d d l record set remote service.
794             *
795             * @param ddlRecordSetService the d d l record set remote service
796             */
797            public void setDDLRecordSetService(
798                    com.liferay.portlet.dynamicdatalists.service.DDLRecordSetService ddlRecordSetService) {
799                    this.ddlRecordSetService = ddlRecordSetService;
800            }
801    
802            /**
803             * Returns the d d l record set persistence.
804             *
805             * @return the d d l record set persistence
806             */
807            public DDLRecordSetPersistence getDDLRecordSetPersistence() {
808                    return ddlRecordSetPersistence;
809            }
810    
811            /**
812             * Sets the d d l record set persistence.
813             *
814             * @param ddlRecordSetPersistence the d d l record set persistence
815             */
816            public void setDDLRecordSetPersistence(
817                    DDLRecordSetPersistence ddlRecordSetPersistence) {
818                    this.ddlRecordSetPersistence = ddlRecordSetPersistence;
819            }
820    
821            /**
822             * Returns the d d l record set finder.
823             *
824             * @return the d d l record set finder
825             */
826            public DDLRecordSetFinder getDDLRecordSetFinder() {
827                    return ddlRecordSetFinder;
828            }
829    
830            /**
831             * Sets the d d l record set finder.
832             *
833             * @param ddlRecordSetFinder the d d l record set finder
834             */
835            public void setDDLRecordSetFinder(DDLRecordSetFinder ddlRecordSetFinder) {
836                    this.ddlRecordSetFinder = ddlRecordSetFinder;
837            }
838    
839            /**
840             * Returns the d d l record version local service.
841             *
842             * @return the d d l record version local service
843             */
844            public com.liferay.portlet.dynamicdatalists.service.DDLRecordVersionLocalService getDDLRecordVersionLocalService() {
845                    return ddlRecordVersionLocalService;
846            }
847    
848            /**
849             * Sets the d d l record version local service.
850             *
851             * @param ddlRecordVersionLocalService the d d l record version local service
852             */
853            public void setDDLRecordVersionLocalService(
854                    com.liferay.portlet.dynamicdatalists.service.DDLRecordVersionLocalService ddlRecordVersionLocalService) {
855                    this.ddlRecordVersionLocalService = ddlRecordVersionLocalService;
856            }
857    
858            /**
859             * Returns the d d l record version remote service.
860             *
861             * @return the d d l record version remote service
862             */
863            public com.liferay.portlet.dynamicdatalists.service.DDLRecordVersionService getDDLRecordVersionService() {
864                    return ddlRecordVersionService;
865            }
866    
867            /**
868             * Sets the d d l record version remote service.
869             *
870             * @param ddlRecordVersionService the d d l record version remote service
871             */
872            public void setDDLRecordVersionService(
873                    com.liferay.portlet.dynamicdatalists.service.DDLRecordVersionService ddlRecordVersionService) {
874                    this.ddlRecordVersionService = ddlRecordVersionService;
875            }
876    
877            /**
878             * Returns the d d l record version persistence.
879             *
880             * @return the d d l record version persistence
881             */
882            public DDLRecordVersionPersistence getDDLRecordVersionPersistence() {
883                    return ddlRecordVersionPersistence;
884            }
885    
886            /**
887             * Sets the d d l record version persistence.
888             *
889             * @param ddlRecordVersionPersistence the d d l record version persistence
890             */
891            public void setDDLRecordVersionPersistence(
892                    DDLRecordVersionPersistence ddlRecordVersionPersistence) {
893                    this.ddlRecordVersionPersistence = ddlRecordVersionPersistence;
894            }
895    
896            public void afterPropertiesSet() {
897                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatalists.model.DDLRecord",
898                            ddlRecordLocalService);
899            }
900    
901            public void destroy() {
902                    persistedModelLocalServiceRegistry.unregister(
903                            "com.liferay.portlet.dynamicdatalists.model.DDLRecord");
904            }
905    
906            /**
907             * Returns the Spring bean ID for this bean.
908             *
909             * @return the Spring bean ID for this bean
910             */
911            @Override
912            public String getBeanIdentifier() {
913                    return _beanIdentifier;
914            }
915    
916            /**
917             * Sets the Spring bean ID for this bean.
918             *
919             * @param beanIdentifier the Spring bean ID for this bean
920             */
921            @Override
922            public void setBeanIdentifier(String beanIdentifier) {
923                    _beanIdentifier = beanIdentifier;
924            }
925    
926            protected Class<?> getModelClass() {
927                    return DDLRecord.class;
928            }
929    
930            protected String getModelClassName() {
931                    return DDLRecord.class.getName();
932            }
933    
934            /**
935             * Performs a SQL query.
936             *
937             * @param sql the sql query
938             */
939            protected void runSQL(String sql) {
940                    try {
941                            DataSource dataSource = ddlRecordPersistence.getDataSource();
942    
943                            DB db = DBFactoryUtil.getDB();
944    
945                            sql = db.buildSQL(sql);
946                            sql = PortalUtil.transformSQL(sql);
947    
948                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
949                                            sql, new int[0]);
950    
951                            sqlUpdate.update();
952                    }
953                    catch (Exception e) {
954                            throw new SystemException(e);
955                    }
956            }
957    
958            @BeanReference(type = com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService.class)
959            protected com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService ddlRecordLocalService;
960            @BeanReference(type = com.liferay.portlet.dynamicdatalists.service.DDLRecordService.class)
961            protected com.liferay.portlet.dynamicdatalists.service.DDLRecordService ddlRecordService;
962            @BeanReference(type = DDLRecordPersistence.class)
963            protected DDLRecordPersistence ddlRecordPersistence;
964            @BeanReference(type = DDLRecordFinder.class)
965            protected DDLRecordFinder ddlRecordFinder;
966            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
967            protected com.liferay.counter.service.CounterLocalService counterLocalService;
968            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
969            protected com.liferay.portal.service.UserLocalService userLocalService;
970            @BeanReference(type = com.liferay.portal.service.UserService.class)
971            protected com.liferay.portal.service.UserService userService;
972            @BeanReference(type = UserPersistence.class)
973            protected UserPersistence userPersistence;
974            @BeanReference(type = UserFinder.class)
975            protected UserFinder userFinder;
976            @BeanReference(type = com.liferay.portal.service.WorkflowInstanceLinkLocalService.class)
977            protected com.liferay.portal.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService;
978            @BeanReference(type = WorkflowInstanceLinkPersistence.class)
979            protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
980            @BeanReference(type = com.liferay.portlet.asset.service.AssetEntryLocalService.class)
981            protected com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService;
982            @BeanReference(type = com.liferay.portlet.asset.service.AssetEntryService.class)
983            protected com.liferay.portlet.asset.service.AssetEntryService assetEntryService;
984            @BeanReference(type = AssetEntryPersistence.class)
985            protected AssetEntryPersistence assetEntryPersistence;
986            @BeanReference(type = AssetEntryFinder.class)
987            protected AssetEntryFinder assetEntryFinder;
988            @BeanReference(type = com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService.class)
989            protected com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService ddmStructureLocalService;
990            @BeanReference(type = com.liferay.portlet.dynamicdatamapping.service.DDMStructureService.class)
991            protected com.liferay.portlet.dynamicdatamapping.service.DDMStructureService ddmStructureService;
992            @BeanReference(type = DDMStructurePersistence.class)
993            protected DDMStructurePersistence ddmStructurePersistence;
994            @BeanReference(type = DDMStructureFinder.class)
995            protected DDMStructureFinder ddmStructureFinder;
996            @BeanReference(type = com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalService.class)
997            protected com.liferay.portlet.dynamicdatalists.service.DDLRecordSetLocalService ddlRecordSetLocalService;
998            @BeanReference(type = com.liferay.portlet.dynamicdatalists.service.DDLRecordSetService.class)
999            protected com.liferay.portlet.dynamicdatalists.service.DDLRecordSetService ddlRecordSetService;
1000            @BeanReference(type = DDLRecordSetPersistence.class)
1001            protected DDLRecordSetPersistence ddlRecordSetPersistence;
1002            @BeanReference(type = DDLRecordSetFinder.class)
1003            protected DDLRecordSetFinder ddlRecordSetFinder;
1004            @BeanReference(type = com.liferay.portlet.dynamicdatalists.service.DDLRecordVersionLocalService.class)
1005            protected com.liferay.portlet.dynamicdatalists.service.DDLRecordVersionLocalService ddlRecordVersionLocalService;
1006            @BeanReference(type = com.liferay.portlet.dynamicdatalists.service.DDLRecordVersionService.class)
1007            protected com.liferay.portlet.dynamicdatalists.service.DDLRecordVersionService ddlRecordVersionService;
1008            @BeanReference(type = DDLRecordVersionPersistence.class)
1009            protected DDLRecordVersionPersistence ddlRecordVersionPersistence;
1010            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1011            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1012            private String _beanIdentifier;
1013    }