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 matching the dynamic query.
197             *
198             * @param dynamicQuery the dynamic query
199             * @return the number of rows matching 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 matching 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 matching 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            /**
352             * Returns all the document library file versions matching the UUID and company.
353             *
354             * @param uuid the UUID of the document library file versions
355             * @param companyId the primary key of the company
356             * @return the matching document library file versions, or an empty list if no matches were found
357             */
358            @Override
359            public List<DLFileVersion> getDLFileVersionsByUuidAndCompanyId(
360                    String uuid, long companyId) {
361                    return dlFileVersionPersistence.findByUuid_C(uuid, companyId);
362            }
363    
364            /**
365             * Returns a range of document library file versions matching the UUID and company.
366             *
367             * @param uuid the UUID of the document library file versions
368             * @param companyId the primary key of the company
369             * @param start the lower bound of the range of document library file versions
370             * @param end the upper bound of the range of document library file versions (not inclusive)
371             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
372             * @return the range of matching document library file versions, or an empty list if no matches were found
373             */
374            @Override
375            public List<DLFileVersion> getDLFileVersionsByUuidAndCompanyId(
376                    String uuid, long companyId, int start, int end,
377                    OrderByComparator<DLFileVersion> orderByComparator) {
378                    return dlFileVersionPersistence.findByUuid_C(uuid, companyId, start,
379                            end, orderByComparator);
380            }
381    
382            /**
383             * Returns the document library file version matching the UUID and group.
384             *
385             * @param uuid the document library file version's UUID
386             * @param groupId the primary key of the group
387             * @return the matching document library file version
388             * @throws PortalException if a matching document library file version could not be found
389             */
390            @Override
391            public DLFileVersion getDLFileVersionByUuidAndGroupId(String uuid,
392                    long groupId) throws PortalException {
393                    return dlFileVersionPersistence.findByUUID_G(uuid, groupId);
394            }
395    
396            /**
397             * Returns a range of all the document library file versions.
398             *
399             * <p>
400             * 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.
401             * </p>
402             *
403             * @param start the lower bound of the range of document library file versions
404             * @param end the upper bound of the range of document library file versions (not inclusive)
405             * @return the range of document library file versions
406             */
407            @Override
408            public List<DLFileVersion> getDLFileVersions(int start, int end) {
409                    return dlFileVersionPersistence.findAll(start, end);
410            }
411    
412            /**
413             * Returns the number of document library file versions.
414             *
415             * @return the number of document library file versions
416             */
417            @Override
418            public int getDLFileVersionsCount() {
419                    return dlFileVersionPersistence.countAll();
420            }
421    
422            /**
423             * Updates the document library file version in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
424             *
425             * @param dlFileVersion the document library file version
426             * @return the document library file version that was updated
427             */
428            @Indexable(type = IndexableType.REINDEX)
429            @Override
430            public DLFileVersion updateDLFileVersion(DLFileVersion dlFileVersion) {
431                    return dlFileVersionPersistence.update(dlFileVersion);
432            }
433    
434            /**
435             * Returns the document library file version local service.
436             *
437             * @return the document library file version local service
438             */
439            public com.liferay.portlet.documentlibrary.service.DLFileVersionLocalService getDLFileVersionLocalService() {
440                    return dlFileVersionLocalService;
441            }
442    
443            /**
444             * Sets the document library file version local service.
445             *
446             * @param dlFileVersionLocalService the document library file version local service
447             */
448            public void setDLFileVersionLocalService(
449                    com.liferay.portlet.documentlibrary.service.DLFileVersionLocalService dlFileVersionLocalService) {
450                    this.dlFileVersionLocalService = dlFileVersionLocalService;
451            }
452    
453            /**
454             * Returns the document library file version remote service.
455             *
456             * @return the document library file version remote service
457             */
458            public com.liferay.portlet.documentlibrary.service.DLFileVersionService getDLFileVersionService() {
459                    return dlFileVersionService;
460            }
461    
462            /**
463             * Sets the document library file version remote service.
464             *
465             * @param dlFileVersionService the document library file version remote service
466             */
467            public void setDLFileVersionService(
468                    com.liferay.portlet.documentlibrary.service.DLFileVersionService dlFileVersionService) {
469                    this.dlFileVersionService = dlFileVersionService;
470            }
471    
472            /**
473             * Returns the document library file version persistence.
474             *
475             * @return the document library file version persistence
476             */
477            public DLFileVersionPersistence getDLFileVersionPersistence() {
478                    return dlFileVersionPersistence;
479            }
480    
481            /**
482             * Sets the document library file version persistence.
483             *
484             * @param dlFileVersionPersistence the document library file version persistence
485             */
486            public void setDLFileVersionPersistence(
487                    DLFileVersionPersistence dlFileVersionPersistence) {
488                    this.dlFileVersionPersistence = dlFileVersionPersistence;
489            }
490    
491            /**
492             * Returns the counter local service.
493             *
494             * @return the counter local service
495             */
496            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
497                    return counterLocalService;
498            }
499    
500            /**
501             * Sets the counter local service.
502             *
503             * @param counterLocalService the counter local service
504             */
505            public void setCounterLocalService(
506                    com.liferay.counter.service.CounterLocalService counterLocalService) {
507                    this.counterLocalService = counterLocalService;
508            }
509    
510            /**
511             * Returns the document library file entry local service.
512             *
513             * @return the document library file entry local service
514             */
515            public com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService getDLFileEntryLocalService() {
516                    return dlFileEntryLocalService;
517            }
518    
519            /**
520             * Sets the document library file entry local service.
521             *
522             * @param dlFileEntryLocalService the document library file entry local service
523             */
524            public void setDLFileEntryLocalService(
525                    com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService dlFileEntryLocalService) {
526                    this.dlFileEntryLocalService = dlFileEntryLocalService;
527            }
528    
529            /**
530             * Returns the document library file entry remote service.
531             *
532             * @return the document library file entry remote service
533             */
534            public com.liferay.portlet.documentlibrary.service.DLFileEntryService getDLFileEntryService() {
535                    return dlFileEntryService;
536            }
537    
538            /**
539             * Sets the document library file entry remote service.
540             *
541             * @param dlFileEntryService the document library file entry remote service
542             */
543            public void setDLFileEntryService(
544                    com.liferay.portlet.documentlibrary.service.DLFileEntryService dlFileEntryService) {
545                    this.dlFileEntryService = dlFileEntryService;
546            }
547    
548            /**
549             * Returns the document library file entry persistence.
550             *
551             * @return the document library file entry persistence
552             */
553            public DLFileEntryPersistence getDLFileEntryPersistence() {
554                    return dlFileEntryPersistence;
555            }
556    
557            /**
558             * Sets the document library file entry persistence.
559             *
560             * @param dlFileEntryPersistence the document library file entry persistence
561             */
562            public void setDLFileEntryPersistence(
563                    DLFileEntryPersistence dlFileEntryPersistence) {
564                    this.dlFileEntryPersistence = dlFileEntryPersistence;
565            }
566    
567            /**
568             * Returns the document library file entry finder.
569             *
570             * @return the document library file entry finder
571             */
572            public DLFileEntryFinder getDLFileEntryFinder() {
573                    return dlFileEntryFinder;
574            }
575    
576            /**
577             * Sets the document library file entry finder.
578             *
579             * @param dlFileEntryFinder the document library file entry finder
580             */
581            public void setDLFileEntryFinder(DLFileEntryFinder dlFileEntryFinder) {
582                    this.dlFileEntryFinder = dlFileEntryFinder;
583            }
584    
585            /**
586             * Returns the document library folder local service.
587             *
588             * @return the document library folder local service
589             */
590            public com.liferay.portlet.documentlibrary.service.DLFolderLocalService getDLFolderLocalService() {
591                    return dlFolderLocalService;
592            }
593    
594            /**
595             * Sets the document library folder local service.
596             *
597             * @param dlFolderLocalService the document library folder local service
598             */
599            public void setDLFolderLocalService(
600                    com.liferay.portlet.documentlibrary.service.DLFolderLocalService dlFolderLocalService) {
601                    this.dlFolderLocalService = dlFolderLocalService;
602            }
603    
604            /**
605             * Returns the document library folder remote service.
606             *
607             * @return the document library folder remote service
608             */
609            public com.liferay.portlet.documentlibrary.service.DLFolderService getDLFolderService() {
610                    return dlFolderService;
611            }
612    
613            /**
614             * Sets the document library folder remote service.
615             *
616             * @param dlFolderService the document library folder remote service
617             */
618            public void setDLFolderService(
619                    com.liferay.portlet.documentlibrary.service.DLFolderService dlFolderService) {
620                    this.dlFolderService = dlFolderService;
621            }
622    
623            /**
624             * Returns the document library folder persistence.
625             *
626             * @return the document library folder persistence
627             */
628            public DLFolderPersistence getDLFolderPersistence() {
629                    return dlFolderPersistence;
630            }
631    
632            /**
633             * Sets the document library folder persistence.
634             *
635             * @param dlFolderPersistence the document library folder persistence
636             */
637            public void setDLFolderPersistence(DLFolderPersistence dlFolderPersistence) {
638                    this.dlFolderPersistence = dlFolderPersistence;
639            }
640    
641            /**
642             * Returns the document library folder finder.
643             *
644             * @return the document library folder finder
645             */
646            public DLFolderFinder getDLFolderFinder() {
647                    return dlFolderFinder;
648            }
649    
650            /**
651             * Sets the document library folder finder.
652             *
653             * @param dlFolderFinder the document library folder finder
654             */
655            public void setDLFolderFinder(DLFolderFinder dlFolderFinder) {
656                    this.dlFolderFinder = dlFolderFinder;
657            }
658    
659            public void afterPropertiesSet() {
660                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.documentlibrary.model.DLFileVersion",
661                            dlFileVersionLocalService);
662            }
663    
664            public void destroy() {
665                    persistedModelLocalServiceRegistry.unregister(
666                            "com.liferay.portlet.documentlibrary.model.DLFileVersion");
667            }
668    
669            /**
670             * Returns the Spring bean ID for this bean.
671             *
672             * @return the Spring bean ID for this bean
673             */
674            @Override
675            public String getBeanIdentifier() {
676                    return _beanIdentifier;
677            }
678    
679            /**
680             * Sets the Spring bean ID for this bean.
681             *
682             * @param beanIdentifier the Spring bean ID for this bean
683             */
684            @Override
685            public void setBeanIdentifier(String beanIdentifier) {
686                    _beanIdentifier = beanIdentifier;
687            }
688    
689            protected Class<?> getModelClass() {
690                    return DLFileVersion.class;
691            }
692    
693            protected String getModelClassName() {
694                    return DLFileVersion.class.getName();
695            }
696    
697            /**
698             * Performs a SQL query.
699             *
700             * @param sql the sql query
701             */
702            protected void runSQL(String sql) {
703                    try {
704                            DataSource dataSource = dlFileVersionPersistence.getDataSource();
705    
706                            DB db = DBFactoryUtil.getDB();
707    
708                            sql = db.buildSQL(sql);
709                            sql = PortalUtil.transformSQL(sql);
710    
711                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
712                                            sql, new int[0]);
713    
714                            sqlUpdate.update();
715                    }
716                    catch (Exception e) {
717                            throw new SystemException(e);
718                    }
719            }
720    
721            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileVersionLocalService.class)
722            protected com.liferay.portlet.documentlibrary.service.DLFileVersionLocalService dlFileVersionLocalService;
723            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileVersionService.class)
724            protected com.liferay.portlet.documentlibrary.service.DLFileVersionService dlFileVersionService;
725            @BeanReference(type = DLFileVersionPersistence.class)
726            protected DLFileVersionPersistence dlFileVersionPersistence;
727            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
728            protected com.liferay.counter.service.CounterLocalService counterLocalService;
729            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService.class)
730            protected com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService dlFileEntryLocalService;
731            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileEntryService.class)
732            protected com.liferay.portlet.documentlibrary.service.DLFileEntryService dlFileEntryService;
733            @BeanReference(type = DLFileEntryPersistence.class)
734            protected DLFileEntryPersistence dlFileEntryPersistence;
735            @BeanReference(type = DLFileEntryFinder.class)
736            protected DLFileEntryFinder dlFileEntryFinder;
737            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFolderLocalService.class)
738            protected com.liferay.portlet.documentlibrary.service.DLFolderLocalService dlFolderLocalService;
739            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFolderService.class)
740            protected com.liferay.portlet.documentlibrary.service.DLFolderService dlFolderService;
741            @BeanReference(type = DLFolderPersistence.class)
742            protected DLFolderPersistence dlFolderPersistence;
743            @BeanReference(type = DLFolderFinder.class)
744            protected DLFolderFinder dlFolderFinder;
745            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
746            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
747            private String _beanIdentifier;
748    }