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.documentlibrary.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.dao.orm.Property;
032    import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
033    import com.liferay.portal.kernel.exception.PortalException;
034    import com.liferay.portal.kernel.exception.SystemException;
035    import com.liferay.portal.kernel.lar.ExportImportHelperUtil;
036    import com.liferay.portal.kernel.lar.ManifestSummary;
037    import com.liferay.portal.kernel.lar.PortletDataContext;
038    import com.liferay.portal.kernel.lar.StagedModelDataHandler;
039    import com.liferay.portal.kernel.lar.StagedModelDataHandlerRegistryUtil;
040    import com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil;
041    import com.liferay.portal.kernel.lar.StagedModelType;
042    import com.liferay.portal.kernel.search.Indexable;
043    import com.liferay.portal.kernel.search.IndexableType;
044    import com.liferay.portal.kernel.util.OrderByComparator;
045    import com.liferay.portal.model.PersistedModel;
046    import com.liferay.portal.service.BaseLocalServiceImpl;
047    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
048    import com.liferay.portal.util.PortalUtil;
049    
050    import com.liferay.portlet.documentlibrary.model.DLFileVersion;
051    import com.liferay.portlet.documentlibrary.service.DLFileVersionLocalService;
052    import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryFinder;
053    import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryPersistence;
054    import com.liferay.portlet.documentlibrary.service.persistence.DLFileVersionPersistence;
055    import com.liferay.portlet.documentlibrary.service.persistence.DLFolderFinder;
056    import com.liferay.portlet.documentlibrary.service.persistence.DLFolderPersistence;
057    
058    import java.io.Serializable;
059    
060    import java.util.List;
061    
062    import javax.sql.DataSource;
063    
064    /**
065     * Provides the base implementation for the document library file version local service.
066     *
067     * <p>
068     * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.portlet.documentlibrary.service.impl.DLFileVersionLocalServiceImpl}.
069     * </p>
070     *
071     * @author Brian Wing Shun Chan
072     * @see com.liferay.portlet.documentlibrary.service.impl.DLFileVersionLocalServiceImpl
073     * @see com.liferay.portlet.documentlibrary.service.DLFileVersionLocalServiceUtil
074     * @generated
075     */
076    @ProviderType
077    public abstract class DLFileVersionLocalServiceBaseImpl
078            extends BaseLocalServiceImpl implements DLFileVersionLocalService,
079                    IdentifiableBean {
080            /*
081             * NOTE FOR DEVELOPERS:
082             *
083             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.documentlibrary.service.DLFileVersionLocalServiceUtil} to access the document library file version local service.
084             */
085    
086            /**
087             * Adds the document library file version to the database. Also notifies the appropriate model listeners.
088             *
089             * @param dlFileVersion the document library file version
090             * @return the document library file version that was added
091             */
092            @Indexable(type = IndexableType.REINDEX)
093            @Override
094            public DLFileVersion addDLFileVersion(DLFileVersion dlFileVersion) {
095                    dlFileVersion.setNew(true);
096    
097                    return dlFileVersionPersistence.update(dlFileVersion);
098            }
099    
100            /**
101             * Creates a new document library file version with the primary key. Does not add the document library file version to the database.
102             *
103             * @param fileVersionId the primary key for the new document library file version
104             * @return the new document library file version
105             */
106            @Override
107            public DLFileVersion createDLFileVersion(long fileVersionId) {
108                    return dlFileVersionPersistence.create(fileVersionId);
109            }
110    
111            /**
112             * Deletes the document library file version with the primary key from the database. Also notifies the appropriate model listeners.
113             *
114             * @param fileVersionId the primary key of the document library file version
115             * @return the document library file version that was removed
116             * @throws PortalException if a document library file version with the primary key could not be found
117             */
118            @Indexable(type = IndexableType.DELETE)
119            @Override
120            public DLFileVersion deleteDLFileVersion(long fileVersionId)
121                    throws PortalException {
122                    return dlFileVersionPersistence.remove(fileVersionId);
123            }
124    
125            /**
126             * Deletes the document library file version from the database. Also notifies the appropriate model listeners.
127             *
128             * @param dlFileVersion the document library file version
129             * @return the document library file version that was removed
130             */
131            @Indexable(type = IndexableType.DELETE)
132            @Override
133            public DLFileVersion deleteDLFileVersion(DLFileVersion dlFileVersion) {
134                    return dlFileVersionPersistence.remove(dlFileVersion);
135            }
136    
137            @Override
138            public DynamicQuery dynamicQuery() {
139                    Class<?> clazz = getClass();
140    
141                    return DynamicQueryFactoryUtil.forClass(DLFileVersion.class,
142                            clazz.getClassLoader());
143            }
144    
145            /**
146             * Performs a dynamic query on the database and returns the matching rows.
147             *
148             * @param dynamicQuery the dynamic query
149             * @return the matching rows
150             */
151            @Override
152            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
153                    return dlFileVersionPersistence.findWithDynamicQuery(dynamicQuery);
154            }
155    
156            /**
157             * Performs a dynamic query on the database and returns a range of the matching rows.
158             *
159             * <p>
160             * 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.documentlibrary.model.impl.DLFileVersionModelImpl}. 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.
161             * </p>
162             *
163             * @param dynamicQuery the dynamic query
164             * @param start the lower bound of the range of model instances
165             * @param end the upper bound of the range of model instances (not inclusive)
166             * @return the range of matching rows
167             */
168            @Override
169            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
170                    int end) {
171                    return dlFileVersionPersistence.findWithDynamicQuery(dynamicQuery,
172                            start, end);
173            }
174    
175            /**
176             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
177             *
178             * <p>
179             * 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.documentlibrary.model.impl.DLFileVersionModelImpl}. 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.
180             * </p>
181             *
182             * @param dynamicQuery the dynamic query
183             * @param start the lower bound of the range of model instances
184             * @param end the upper bound of the range of model instances (not inclusive)
185             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
186             * @return the ordered range of matching rows
187             */
188            @Override
189            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
190                    int end, OrderByComparator<T> orderByComparator) {
191                    return dlFileVersionPersistence.findWithDynamicQuery(dynamicQuery,
192                            start, end, orderByComparator);
193            }
194    
195            /**
196             * Returns the number of rows that match the dynamic query.
197             *
198             * @param dynamicQuery the dynamic query
199             * @return the number of rows that match the dynamic query
200             */
201            @Override
202            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
203                    return dlFileVersionPersistence.countWithDynamicQuery(dynamicQuery);
204            }
205    
206            /**
207             * Returns the number of rows that match the dynamic query.
208             *
209             * @param dynamicQuery the dynamic query
210             * @param projection the projection to apply to the query
211             * @return the number of rows that match the dynamic query
212             */
213            @Override
214            public long dynamicQueryCount(DynamicQuery dynamicQuery,
215                    Projection projection) {
216                    return dlFileVersionPersistence.countWithDynamicQuery(dynamicQuery,
217                            projection);
218            }
219    
220            @Override
221            public DLFileVersion fetchDLFileVersion(long fileVersionId) {
222                    return dlFileVersionPersistence.fetchByPrimaryKey(fileVersionId);
223            }
224    
225            /**
226             * Returns the document library file version matching the UUID and group.
227             *
228             * @param uuid the document library file version's UUID
229             * @param groupId the primary key of the group
230             * @return the matching document library file version, or <code>null</code> if a matching document library file version could not be found
231             */
232            @Override
233            public DLFileVersion fetchDLFileVersionByUuidAndGroupId(String uuid,
234                    long groupId) {
235                    return dlFileVersionPersistence.fetchByUUID_G(uuid, groupId);
236            }
237    
238            /**
239             * Returns the document library file version with the primary key.
240             *
241             * @param fileVersionId the primary key of the document library file version
242             * @return the document library file version
243             * @throws PortalException if a document library file version with the primary key could not be found
244             */
245            @Override
246            public DLFileVersion getDLFileVersion(long fileVersionId)
247                    throws PortalException {
248                    return dlFileVersionPersistence.findByPrimaryKey(fileVersionId);
249            }
250    
251            @Override
252            public ActionableDynamicQuery getActionableDynamicQuery() {
253                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
254    
255                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.documentlibrary.service.DLFileVersionLocalServiceUtil.getService());
256                    actionableDynamicQuery.setClass(DLFileVersion.class);
257                    actionableDynamicQuery.setClassLoader(getClassLoader());
258    
259                    actionableDynamicQuery.setPrimaryKeyPropertyName("fileVersionId");
260    
261                    return actionableDynamicQuery;
262            }
263    
264            protected void initActionableDynamicQuery(
265                    ActionableDynamicQuery actionableDynamicQuery) {
266                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.documentlibrary.service.DLFileVersionLocalServiceUtil.getService());
267                    actionableDynamicQuery.setClass(DLFileVersion.class);
268                    actionableDynamicQuery.setClassLoader(getClassLoader());
269    
270                    actionableDynamicQuery.setPrimaryKeyPropertyName("fileVersionId");
271            }
272    
273            @Override
274            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
275                    final PortletDataContext portletDataContext) {
276                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
277                                    @Override
278                                    public long performCount() throws PortalException {
279                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
280    
281                                            StagedModelType stagedModelType = getStagedModelType();
282    
283                                            long modelAdditionCount = super.performCount();
284    
285                                            manifestSummary.addModelAdditionCount(stagedModelType.toString(),
286                                                    modelAdditionCount);
287    
288                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
289                                                            stagedModelType);
290    
291                                            manifestSummary.addModelDeletionCount(stagedModelType.toString(),
292                                                    modelDeletionCount);
293    
294                                            return modelAdditionCount;
295                                    }
296                            };
297    
298                    initActionableDynamicQuery(exportActionableDynamicQuery);
299    
300                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
301                                    @Override
302                                    public void addCriteria(DynamicQuery dynamicQuery) {
303                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
304                                                    "modifiedDate");
305    
306                                            StagedModelDataHandler<?> stagedModelDataHandler = StagedModelDataHandlerRegistryUtil.getStagedModelDataHandler(DLFileVersion.class.getName());
307    
308                                            Property workflowStatusProperty = PropertyFactoryUtil.forName(
309                                                            "status");
310    
311                                            dynamicQuery.add(workflowStatusProperty.in(
312                                                            stagedModelDataHandler.getExportableStatuses()));
313                                    }
314                            });
315    
316                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
317    
318                    exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
319    
320                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod() {
321                                    @Override
322                                    public void performAction(Object object)
323                                            throws PortalException {
324                                            DLFileVersion stagedModel = (DLFileVersion)object;
325    
326                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
327                                                    stagedModel);
328                                    }
329                            });
330                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
331                                    PortalUtil.getClassNameId(DLFileVersion.class.getName())));
332    
333                    return exportActionableDynamicQuery;
334            }
335    
336            /**
337             * @throws PortalException
338             */
339            @Override
340            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
341                    throws PortalException {
342                    return dlFileVersionLocalService.deleteDLFileVersion((DLFileVersion)persistedModel);
343            }
344    
345            @Override
346            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
347                    throws PortalException {
348                    return dlFileVersionPersistence.findByPrimaryKey(primaryKeyObj);
349            }
350    
351            @Override
352            public List<DLFileVersion> getDLFileVersionsByUuidAndCompanyId(
353                    String uuid, long companyId) {
354                    return dlFileVersionPersistence.findByUuid_C(uuid, companyId);
355            }
356    
357            @Override
358            public List<DLFileVersion> getDLFileVersionsByUuidAndCompanyId(
359                    String uuid, long companyId, int start, int end,
360                    OrderByComparator<DLFileVersion> orderByComparator) {
361                    return dlFileVersionPersistence.findByUuid_C(uuid, companyId, start,
362                            end, orderByComparator);
363            }
364    
365            /**
366             * Returns the document library file version matching the UUID and group.
367             *
368             * @param uuid the document library file version's UUID
369             * @param groupId the primary key of the group
370             * @return the matching document library file version
371             * @throws PortalException if a matching document library file version could not be found
372             */
373            @Override
374            public DLFileVersion getDLFileVersionByUuidAndGroupId(String uuid,
375                    long groupId) throws PortalException {
376                    return dlFileVersionPersistence.findByUUID_G(uuid, groupId);
377            }
378    
379            /**
380             * Returns a range of all the document library file versions.
381             *
382             * <p>
383             * 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.documentlibrary.model.impl.DLFileVersionModelImpl}. 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.
384             * </p>
385             *
386             * @param start the lower bound of the range of document library file versions
387             * @param end the upper bound of the range of document library file versions (not inclusive)
388             * @return the range of document library file versions
389             */
390            @Override
391            public List<DLFileVersion> getDLFileVersions(int start, int end) {
392                    return dlFileVersionPersistence.findAll(start, end);
393            }
394    
395            /**
396             * Returns the number of document library file versions.
397             *
398             * @return the number of document library file versions
399             */
400            @Override
401            public int getDLFileVersionsCount() {
402                    return dlFileVersionPersistence.countAll();
403            }
404    
405            /**
406             * Updates the document library file version in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
407             *
408             * @param dlFileVersion the document library file version
409             * @return the document library file version that was updated
410             */
411            @Indexable(type = IndexableType.REINDEX)
412            @Override
413            public DLFileVersion updateDLFileVersion(DLFileVersion dlFileVersion) {
414                    return dlFileVersionPersistence.update(dlFileVersion);
415            }
416    
417            /**
418             * Returns the document library file version local service.
419             *
420             * @return the document library file version local service
421             */
422            public com.liferay.portlet.documentlibrary.service.DLFileVersionLocalService getDLFileVersionLocalService() {
423                    return dlFileVersionLocalService;
424            }
425    
426            /**
427             * Sets the document library file version local service.
428             *
429             * @param dlFileVersionLocalService the document library file version local service
430             */
431            public void setDLFileVersionLocalService(
432                    com.liferay.portlet.documentlibrary.service.DLFileVersionLocalService dlFileVersionLocalService) {
433                    this.dlFileVersionLocalService = dlFileVersionLocalService;
434            }
435    
436            /**
437             * Returns the document library file version remote service.
438             *
439             * @return the document library file version remote service
440             */
441            public com.liferay.portlet.documentlibrary.service.DLFileVersionService getDLFileVersionService() {
442                    return dlFileVersionService;
443            }
444    
445            /**
446             * Sets the document library file version remote service.
447             *
448             * @param dlFileVersionService the document library file version remote service
449             */
450            public void setDLFileVersionService(
451                    com.liferay.portlet.documentlibrary.service.DLFileVersionService dlFileVersionService) {
452                    this.dlFileVersionService = dlFileVersionService;
453            }
454    
455            /**
456             * Returns the document library file version persistence.
457             *
458             * @return the document library file version persistence
459             */
460            public DLFileVersionPersistence getDLFileVersionPersistence() {
461                    return dlFileVersionPersistence;
462            }
463    
464            /**
465             * Sets the document library file version persistence.
466             *
467             * @param dlFileVersionPersistence the document library file version persistence
468             */
469            public void setDLFileVersionPersistence(
470                    DLFileVersionPersistence dlFileVersionPersistence) {
471                    this.dlFileVersionPersistence = dlFileVersionPersistence;
472            }
473    
474            /**
475             * Returns the counter local service.
476             *
477             * @return the counter local service
478             */
479            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
480                    return counterLocalService;
481            }
482    
483            /**
484             * Sets the counter local service.
485             *
486             * @param counterLocalService the counter local service
487             */
488            public void setCounterLocalService(
489                    com.liferay.counter.service.CounterLocalService counterLocalService) {
490                    this.counterLocalService = counterLocalService;
491            }
492    
493            /**
494             * Returns the document library file entry local service.
495             *
496             * @return the document library file entry local service
497             */
498            public com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService getDLFileEntryLocalService() {
499                    return dlFileEntryLocalService;
500            }
501    
502            /**
503             * Sets the document library file entry local service.
504             *
505             * @param dlFileEntryLocalService the document library file entry local service
506             */
507            public void setDLFileEntryLocalService(
508                    com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService dlFileEntryLocalService) {
509                    this.dlFileEntryLocalService = dlFileEntryLocalService;
510            }
511    
512            /**
513             * Returns the document library file entry remote service.
514             *
515             * @return the document library file entry remote service
516             */
517            public com.liferay.portlet.documentlibrary.service.DLFileEntryService getDLFileEntryService() {
518                    return dlFileEntryService;
519            }
520    
521            /**
522             * Sets the document library file entry remote service.
523             *
524             * @param dlFileEntryService the document library file entry remote service
525             */
526            public void setDLFileEntryService(
527                    com.liferay.portlet.documentlibrary.service.DLFileEntryService dlFileEntryService) {
528                    this.dlFileEntryService = dlFileEntryService;
529            }
530    
531            /**
532             * Returns the document library file entry persistence.
533             *
534             * @return the document library file entry persistence
535             */
536            public DLFileEntryPersistence getDLFileEntryPersistence() {
537                    return dlFileEntryPersistence;
538            }
539    
540            /**
541             * Sets the document library file entry persistence.
542             *
543             * @param dlFileEntryPersistence the document library file entry persistence
544             */
545            public void setDLFileEntryPersistence(
546                    DLFileEntryPersistence dlFileEntryPersistence) {
547                    this.dlFileEntryPersistence = dlFileEntryPersistence;
548            }
549    
550            /**
551             * Returns the document library file entry finder.
552             *
553             * @return the document library file entry finder
554             */
555            public DLFileEntryFinder getDLFileEntryFinder() {
556                    return dlFileEntryFinder;
557            }
558    
559            /**
560             * Sets the document library file entry finder.
561             *
562             * @param dlFileEntryFinder the document library file entry finder
563             */
564            public void setDLFileEntryFinder(DLFileEntryFinder dlFileEntryFinder) {
565                    this.dlFileEntryFinder = dlFileEntryFinder;
566            }
567    
568            /**
569             * Returns the document library folder local service.
570             *
571             * @return the document library folder local service
572             */
573            public com.liferay.portlet.documentlibrary.service.DLFolderLocalService getDLFolderLocalService() {
574                    return dlFolderLocalService;
575            }
576    
577            /**
578             * Sets the document library folder local service.
579             *
580             * @param dlFolderLocalService the document library folder local service
581             */
582            public void setDLFolderLocalService(
583                    com.liferay.portlet.documentlibrary.service.DLFolderLocalService dlFolderLocalService) {
584                    this.dlFolderLocalService = dlFolderLocalService;
585            }
586    
587            /**
588             * Returns the document library folder remote service.
589             *
590             * @return the document library folder remote service
591             */
592            public com.liferay.portlet.documentlibrary.service.DLFolderService getDLFolderService() {
593                    return dlFolderService;
594            }
595    
596            /**
597             * Sets the document library folder remote service.
598             *
599             * @param dlFolderService the document library folder remote service
600             */
601            public void setDLFolderService(
602                    com.liferay.portlet.documentlibrary.service.DLFolderService dlFolderService) {
603                    this.dlFolderService = dlFolderService;
604            }
605    
606            /**
607             * Returns the document library folder persistence.
608             *
609             * @return the document library folder persistence
610             */
611            public DLFolderPersistence getDLFolderPersistence() {
612                    return dlFolderPersistence;
613            }
614    
615            /**
616             * Sets the document library folder persistence.
617             *
618             * @param dlFolderPersistence the document library folder persistence
619             */
620            public void setDLFolderPersistence(DLFolderPersistence dlFolderPersistence) {
621                    this.dlFolderPersistence = dlFolderPersistence;
622            }
623    
624            /**
625             * Returns the document library folder finder.
626             *
627             * @return the document library folder finder
628             */
629            public DLFolderFinder getDLFolderFinder() {
630                    return dlFolderFinder;
631            }
632    
633            /**
634             * Sets the document library folder finder.
635             *
636             * @param dlFolderFinder the document library folder finder
637             */
638            public void setDLFolderFinder(DLFolderFinder dlFolderFinder) {
639                    this.dlFolderFinder = dlFolderFinder;
640            }
641    
642            public void afterPropertiesSet() {
643                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.documentlibrary.model.DLFileVersion",
644                            dlFileVersionLocalService);
645            }
646    
647            public void destroy() {
648                    persistedModelLocalServiceRegistry.unregister(
649                            "com.liferay.portlet.documentlibrary.model.DLFileVersion");
650            }
651    
652            /**
653             * Returns the Spring bean ID for this bean.
654             *
655             * @return the Spring bean ID for this bean
656             */
657            @Override
658            public String getBeanIdentifier() {
659                    return _beanIdentifier;
660            }
661    
662            /**
663             * Sets the Spring bean ID for this bean.
664             *
665             * @param beanIdentifier the Spring bean ID for this bean
666             */
667            @Override
668            public void setBeanIdentifier(String beanIdentifier) {
669                    _beanIdentifier = beanIdentifier;
670            }
671    
672            protected Class<?> getModelClass() {
673                    return DLFileVersion.class;
674            }
675    
676            protected String getModelClassName() {
677                    return DLFileVersion.class.getName();
678            }
679    
680            /**
681             * Performs a SQL query.
682             *
683             * @param sql the sql query
684             */
685            protected void runSQL(String sql) {
686                    try {
687                            DataSource dataSource = dlFileVersionPersistence.getDataSource();
688    
689                            DB db = DBFactoryUtil.getDB();
690    
691                            sql = db.buildSQL(sql);
692                            sql = PortalUtil.transformSQL(sql);
693    
694                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
695                                            sql, new int[0]);
696    
697                            sqlUpdate.update();
698                    }
699                    catch (Exception e) {
700                            throw new SystemException(e);
701                    }
702            }
703    
704            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileVersionLocalService.class)
705            protected com.liferay.portlet.documentlibrary.service.DLFileVersionLocalService dlFileVersionLocalService;
706            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileVersionService.class)
707            protected com.liferay.portlet.documentlibrary.service.DLFileVersionService dlFileVersionService;
708            @BeanReference(type = DLFileVersionPersistence.class)
709            protected DLFileVersionPersistence dlFileVersionPersistence;
710            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
711            protected com.liferay.counter.service.CounterLocalService counterLocalService;
712            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService.class)
713            protected com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService dlFileEntryLocalService;
714            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileEntryService.class)
715            protected com.liferay.portlet.documentlibrary.service.DLFileEntryService dlFileEntryService;
716            @BeanReference(type = DLFileEntryPersistence.class)
717            protected DLFileEntryPersistence dlFileEntryPersistence;
718            @BeanReference(type = DLFileEntryFinder.class)
719            protected DLFileEntryFinder dlFileEntryFinder;
720            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFolderLocalService.class)
721            protected com.liferay.portlet.documentlibrary.service.DLFolderLocalService dlFolderLocalService;
722            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFolderService.class)
723            protected com.liferay.portlet.documentlibrary.service.DLFolderService dlFolderService;
724            @BeanReference(type = DLFolderPersistence.class)
725            protected DLFolderPersistence dlFolderPersistence;
726            @BeanReference(type = DLFolderFinder.class)
727            protected DLFolderFinder dlFolderFinder;
728            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
729            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
730            private String _beanIdentifier;
731    }