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.asset.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.dao.db.DB;
021    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
028    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
029    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
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.module.framework.service.IdentifiableOSGiService;
034    import com.liferay.portal.kernel.search.Indexable;
035    import com.liferay.portal.kernel.search.IndexableType;
036    import com.liferay.portal.kernel.util.OrderByComparator;
037    import com.liferay.portal.model.PersistedModel;
038    import com.liferay.portal.service.BaseLocalServiceImpl;
039    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
040    import com.liferay.portal.service.persistence.ClassNamePersistence;
041    import com.liferay.portal.service.persistence.GroupFinder;
042    import com.liferay.portal.service.persistence.GroupPersistence;
043    import com.liferay.portal.service.persistence.UserFinder;
044    import com.liferay.portal.service.persistence.UserPersistence;
045    import com.liferay.portal.util.PortalUtil;
046    
047    import com.liferay.portlet.asset.model.AssetVocabulary;
048    import com.liferay.portlet.asset.service.AssetVocabularyLocalService;
049    import com.liferay.portlet.asset.service.persistence.AssetCategoryFinder;
050    import com.liferay.portlet.asset.service.persistence.AssetCategoryPersistence;
051    import com.liferay.portlet.asset.service.persistence.AssetVocabularyFinder;
052    import com.liferay.portlet.asset.service.persistence.AssetVocabularyPersistence;
053    import com.liferay.portlet.exportimport.lar.ExportImportHelperUtil;
054    import com.liferay.portlet.exportimport.lar.ManifestSummary;
055    import com.liferay.portlet.exportimport.lar.PortletDataContext;
056    import com.liferay.portlet.exportimport.lar.StagedModelDataHandlerUtil;
057    import com.liferay.portlet.exportimport.lar.StagedModelType;
058    
059    import java.io.Serializable;
060    
061    import java.util.List;
062    
063    import javax.sql.DataSource;
064    
065    /**
066     * Provides the base implementation for the asset vocabulary local service.
067     *
068     * <p>
069     * 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.asset.service.impl.AssetVocabularyLocalServiceImpl}.
070     * </p>
071     *
072     * @author Brian Wing Shun Chan
073     * @see com.liferay.portlet.asset.service.impl.AssetVocabularyLocalServiceImpl
074     * @see com.liferay.portlet.asset.service.AssetVocabularyLocalServiceUtil
075     * @generated
076     */
077    @ProviderType
078    public abstract class AssetVocabularyLocalServiceBaseImpl
079            extends BaseLocalServiceImpl implements AssetVocabularyLocalService,
080                    IdentifiableOSGiService {
081            /*
082             * NOTE FOR DEVELOPERS:
083             *
084             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.asset.service.AssetVocabularyLocalServiceUtil} to access the asset vocabulary local service.
085             */
086    
087            /**
088             * Adds the asset vocabulary to the database. Also notifies the appropriate model listeners.
089             *
090             * @param assetVocabulary the asset vocabulary
091             * @return the asset vocabulary that was added
092             */
093            @Indexable(type = IndexableType.REINDEX)
094            @Override
095            public AssetVocabulary addAssetVocabulary(AssetVocabulary assetVocabulary) {
096                    assetVocabulary.setNew(true);
097    
098                    return assetVocabularyPersistence.update(assetVocabulary);
099            }
100    
101            /**
102             * Creates a new asset vocabulary with the primary key. Does not add the asset vocabulary to the database.
103             *
104             * @param vocabularyId the primary key for the new asset vocabulary
105             * @return the new asset vocabulary
106             */
107            @Override
108            public AssetVocabulary createAssetVocabulary(long vocabularyId) {
109                    return assetVocabularyPersistence.create(vocabularyId);
110            }
111    
112            /**
113             * Deletes the asset vocabulary with the primary key from the database. Also notifies the appropriate model listeners.
114             *
115             * @param vocabularyId the primary key of the asset vocabulary
116             * @return the asset vocabulary that was removed
117             * @throws PortalException if a asset vocabulary with the primary key could not be found
118             */
119            @Indexable(type = IndexableType.DELETE)
120            @Override
121            public AssetVocabulary deleteAssetVocabulary(long vocabularyId)
122                    throws PortalException {
123                    return assetVocabularyPersistence.remove(vocabularyId);
124            }
125    
126            /**
127             * Deletes the asset vocabulary from the database. Also notifies the appropriate model listeners.
128             *
129             * @param assetVocabulary the asset vocabulary
130             * @return the asset vocabulary that was removed
131             */
132            @Indexable(type = IndexableType.DELETE)
133            @Override
134            public AssetVocabulary deleteAssetVocabulary(
135                    AssetVocabulary assetVocabulary) {
136                    return assetVocabularyPersistence.remove(assetVocabulary);
137            }
138    
139            @Override
140            public DynamicQuery dynamicQuery() {
141                    Class<?> clazz = getClass();
142    
143                    return DynamicQueryFactoryUtil.forClass(AssetVocabulary.class,
144                            clazz.getClassLoader());
145            }
146    
147            /**
148             * Performs a dynamic query on the database and returns the matching rows.
149             *
150             * @param dynamicQuery the dynamic query
151             * @return the matching rows
152             */
153            @Override
154            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
155                    return assetVocabularyPersistence.findWithDynamicQuery(dynamicQuery);
156            }
157    
158            /**
159             * Performs a dynamic query on the database and returns a range of the matching rows.
160             *
161             * <p>
162             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.asset.model.impl.AssetVocabularyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
163             * </p>
164             *
165             * @param dynamicQuery the dynamic query
166             * @param start the lower bound of the range of model instances
167             * @param end the upper bound of the range of model instances (not inclusive)
168             * @return the range of matching rows
169             */
170            @Override
171            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
172                    int end) {
173                    return assetVocabularyPersistence.findWithDynamicQuery(dynamicQuery,
174                            start, end);
175            }
176    
177            /**
178             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
179             *
180             * <p>
181             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.asset.model.impl.AssetVocabularyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
182             * </p>
183             *
184             * @param dynamicQuery the dynamic query
185             * @param start the lower bound of the range of model instances
186             * @param end the upper bound of the range of model instances (not inclusive)
187             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
188             * @return the ordered range of matching rows
189             */
190            @Override
191            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
192                    int end, OrderByComparator<T> orderByComparator) {
193                    return assetVocabularyPersistence.findWithDynamicQuery(dynamicQuery,
194                            start, end, orderByComparator);
195            }
196    
197            /**
198             * Returns the number of rows matching the dynamic query.
199             *
200             * @param dynamicQuery the dynamic query
201             * @return the number of rows matching the dynamic query
202             */
203            @Override
204            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
205                    return assetVocabularyPersistence.countWithDynamicQuery(dynamicQuery);
206            }
207    
208            /**
209             * Returns the number of rows matching the dynamic query.
210             *
211             * @param dynamicQuery the dynamic query
212             * @param projection the projection to apply to the query
213             * @return the number of rows matching the dynamic query
214             */
215            @Override
216            public long dynamicQueryCount(DynamicQuery dynamicQuery,
217                    Projection projection) {
218                    return assetVocabularyPersistence.countWithDynamicQuery(dynamicQuery,
219                            projection);
220            }
221    
222            @Override
223            public AssetVocabulary fetchAssetVocabulary(long vocabularyId) {
224                    return assetVocabularyPersistence.fetchByPrimaryKey(vocabularyId);
225            }
226    
227            /**
228             * Returns the asset vocabulary matching the UUID and group.
229             *
230             * @param uuid the asset vocabulary's UUID
231             * @param groupId the primary key of the group
232             * @return the matching asset vocabulary, or <code>null</code> if a matching asset vocabulary could not be found
233             */
234            @Override
235            public AssetVocabulary fetchAssetVocabularyByUuidAndGroupId(String uuid,
236                    long groupId) {
237                    return assetVocabularyPersistence.fetchByUUID_G(uuid, groupId);
238            }
239    
240            /**
241             * Returns the asset vocabulary with the primary key.
242             *
243             * @param vocabularyId the primary key of the asset vocabulary
244             * @return the asset vocabulary
245             * @throws PortalException if a asset vocabulary with the primary key could not be found
246             */
247            @Override
248            public AssetVocabulary getAssetVocabulary(long vocabularyId)
249                    throws PortalException {
250                    return assetVocabularyPersistence.findByPrimaryKey(vocabularyId);
251            }
252    
253            @Override
254            public ActionableDynamicQuery getActionableDynamicQuery() {
255                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
256    
257                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.asset.service.AssetVocabularyLocalServiceUtil.getService());
258                    actionableDynamicQuery.setClassLoader(getClassLoader());
259                    actionableDynamicQuery.setModelClass(AssetVocabulary.class);
260    
261                    actionableDynamicQuery.setPrimaryKeyPropertyName("vocabularyId");
262    
263                    return actionableDynamicQuery;
264            }
265    
266            @Override
267            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
268                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
269    
270                    indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portlet.asset.service.AssetVocabularyLocalServiceUtil.getService());
271                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
272                    indexableActionableDynamicQuery.setModelClass(AssetVocabulary.class);
273    
274                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName(
275                            "vocabularyId");
276    
277                    return indexableActionableDynamicQuery;
278            }
279    
280            protected void initActionableDynamicQuery(
281                    ActionableDynamicQuery actionableDynamicQuery) {
282                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.asset.service.AssetVocabularyLocalServiceUtil.getService());
283                    actionableDynamicQuery.setClassLoader(getClassLoader());
284                    actionableDynamicQuery.setModelClass(AssetVocabulary.class);
285    
286                    actionableDynamicQuery.setPrimaryKeyPropertyName("vocabularyId");
287            }
288    
289            @Override
290            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
291                    final PortletDataContext portletDataContext) {
292                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
293                                    @Override
294                                    public long performCount() throws PortalException {
295                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
296    
297                                            StagedModelType stagedModelType = getStagedModelType();
298    
299                                            long modelAdditionCount = super.performCount();
300    
301                                            manifestSummary.addModelAdditionCount(stagedModelType,
302                                                    modelAdditionCount);
303    
304                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
305                                                            stagedModelType);
306    
307                                            manifestSummary.addModelDeletionCount(stagedModelType,
308                                                    modelDeletionCount);
309    
310                                            return modelAdditionCount;
311                                    }
312                            };
313    
314                    initActionableDynamicQuery(exportActionableDynamicQuery);
315    
316                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
317                                    @Override
318                                    public void addCriteria(DynamicQuery dynamicQuery) {
319                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
320                                                    "modifiedDate");
321                                    }
322                            });
323    
324                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
325    
326                    exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
327    
328                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<AssetVocabulary>() {
329                                    @Override
330                                    public void performAction(AssetVocabulary assetVocabulary)
331                                            throws PortalException {
332                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
333                                                    assetVocabulary);
334                                    }
335                            });
336                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
337                                    PortalUtil.getClassNameId(AssetVocabulary.class.getName())));
338    
339                    return exportActionableDynamicQuery;
340            }
341    
342            /**
343             * @throws PortalException
344             */
345            @Override
346            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
347                    throws PortalException {
348                    return assetVocabularyLocalService.deleteAssetVocabulary((AssetVocabulary)persistedModel);
349            }
350    
351            @Override
352            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
353                    throws PortalException {
354                    return assetVocabularyPersistence.findByPrimaryKey(primaryKeyObj);
355            }
356    
357            /**
358             * Returns all the asset vocabularies matching the UUID and company.
359             *
360             * @param uuid the UUID of the asset vocabularies
361             * @param companyId the primary key of the company
362             * @return the matching asset vocabularies, or an empty list if no matches were found
363             */
364            @Override
365            public List<AssetVocabulary> getAssetVocabulariesByUuidAndCompanyId(
366                    String uuid, long companyId) {
367                    return assetVocabularyPersistence.findByUuid_C(uuid, companyId);
368            }
369    
370            /**
371             * Returns a range of asset vocabularies matching the UUID and company.
372             *
373             * @param uuid the UUID of the asset vocabularies
374             * @param companyId the primary key of the company
375             * @param start the lower bound of the range of asset vocabularies
376             * @param end the upper bound of the range of asset vocabularies (not inclusive)
377             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
378             * @return the range of matching asset vocabularies, or an empty list if no matches were found
379             */
380            @Override
381            public List<AssetVocabulary> getAssetVocabulariesByUuidAndCompanyId(
382                    String uuid, long companyId, int start, int end,
383                    OrderByComparator<AssetVocabulary> orderByComparator) {
384                    return assetVocabularyPersistence.findByUuid_C(uuid, companyId, start,
385                            end, orderByComparator);
386            }
387    
388            /**
389             * Returns the asset vocabulary matching the UUID and group.
390             *
391             * @param uuid the asset vocabulary's UUID
392             * @param groupId the primary key of the group
393             * @return the matching asset vocabulary
394             * @throws PortalException if a matching asset vocabulary could not be found
395             */
396            @Override
397            public AssetVocabulary getAssetVocabularyByUuidAndGroupId(String uuid,
398                    long groupId) throws PortalException {
399                    return assetVocabularyPersistence.findByUUID_G(uuid, groupId);
400            }
401    
402            /**
403             * Returns a range of all the asset vocabularies.
404             *
405             * <p>
406             * 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.asset.model.impl.AssetVocabularyModelImpl}. 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.
407             * </p>
408             *
409             * @param start the lower bound of the range of asset vocabularies
410             * @param end the upper bound of the range of asset vocabularies (not inclusive)
411             * @return the range of asset vocabularies
412             */
413            @Override
414            public List<AssetVocabulary> getAssetVocabularies(int start, int end) {
415                    return assetVocabularyPersistence.findAll(start, end);
416            }
417    
418            /**
419             * Returns the number of asset vocabularies.
420             *
421             * @return the number of asset vocabularies
422             */
423            @Override
424            public int getAssetVocabulariesCount() {
425                    return assetVocabularyPersistence.countAll();
426            }
427    
428            /**
429             * Updates the asset vocabulary in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
430             *
431             * @param assetVocabulary the asset vocabulary
432             * @return the asset vocabulary that was updated
433             */
434            @Indexable(type = IndexableType.REINDEX)
435            @Override
436            public AssetVocabulary updateAssetVocabulary(
437                    AssetVocabulary assetVocabulary) {
438                    return assetVocabularyPersistence.update(assetVocabulary);
439            }
440    
441            /**
442             * Returns the asset vocabulary local service.
443             *
444             * @return the asset vocabulary local service
445             */
446            public AssetVocabularyLocalService getAssetVocabularyLocalService() {
447                    return assetVocabularyLocalService;
448            }
449    
450            /**
451             * Sets the asset vocabulary local service.
452             *
453             * @param assetVocabularyLocalService the asset vocabulary local service
454             */
455            public void setAssetVocabularyLocalService(
456                    AssetVocabularyLocalService assetVocabularyLocalService) {
457                    this.assetVocabularyLocalService = assetVocabularyLocalService;
458            }
459    
460            /**
461             * Returns the asset vocabulary persistence.
462             *
463             * @return the asset vocabulary persistence
464             */
465            public AssetVocabularyPersistence getAssetVocabularyPersistence() {
466                    return assetVocabularyPersistence;
467            }
468    
469            /**
470             * Sets the asset vocabulary persistence.
471             *
472             * @param assetVocabularyPersistence the asset vocabulary persistence
473             */
474            public void setAssetVocabularyPersistence(
475                    AssetVocabularyPersistence assetVocabularyPersistence) {
476                    this.assetVocabularyPersistence = assetVocabularyPersistence;
477            }
478    
479            /**
480             * Returns the asset vocabulary finder.
481             *
482             * @return the asset vocabulary finder
483             */
484            public AssetVocabularyFinder getAssetVocabularyFinder() {
485                    return assetVocabularyFinder;
486            }
487    
488            /**
489             * Sets the asset vocabulary finder.
490             *
491             * @param assetVocabularyFinder the asset vocabulary finder
492             */
493            public void setAssetVocabularyFinder(
494                    AssetVocabularyFinder assetVocabularyFinder) {
495                    this.assetVocabularyFinder = assetVocabularyFinder;
496            }
497    
498            /**
499             * Returns the counter local service.
500             *
501             * @return the counter local service
502             */
503            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
504                    return counterLocalService;
505            }
506    
507            /**
508             * Sets the counter local service.
509             *
510             * @param counterLocalService the counter local service
511             */
512            public void setCounterLocalService(
513                    com.liferay.counter.service.CounterLocalService counterLocalService) {
514                    this.counterLocalService = counterLocalService;
515            }
516    
517            /**
518             * Returns the class name local service.
519             *
520             * @return the class name local service
521             */
522            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
523                    return classNameLocalService;
524            }
525    
526            /**
527             * Sets the class name local service.
528             *
529             * @param classNameLocalService the class name local service
530             */
531            public void setClassNameLocalService(
532                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
533                    this.classNameLocalService = classNameLocalService;
534            }
535    
536            /**
537             * Returns the class name persistence.
538             *
539             * @return the class name persistence
540             */
541            public ClassNamePersistence getClassNamePersistence() {
542                    return classNamePersistence;
543            }
544    
545            /**
546             * Sets the class name persistence.
547             *
548             * @param classNamePersistence the class name persistence
549             */
550            public void setClassNamePersistence(
551                    ClassNamePersistence classNamePersistence) {
552                    this.classNamePersistence = classNamePersistence;
553            }
554    
555            /**
556             * Returns the group local service.
557             *
558             * @return the group local service
559             */
560            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
561                    return groupLocalService;
562            }
563    
564            /**
565             * Sets the group local service.
566             *
567             * @param groupLocalService the group local service
568             */
569            public void setGroupLocalService(
570                    com.liferay.portal.service.GroupLocalService groupLocalService) {
571                    this.groupLocalService = groupLocalService;
572            }
573    
574            /**
575             * Returns the group persistence.
576             *
577             * @return the group persistence
578             */
579            public GroupPersistence getGroupPersistence() {
580                    return groupPersistence;
581            }
582    
583            /**
584             * Sets the group persistence.
585             *
586             * @param groupPersistence the group persistence
587             */
588            public void setGroupPersistence(GroupPersistence groupPersistence) {
589                    this.groupPersistence = groupPersistence;
590            }
591    
592            /**
593             * Returns the group finder.
594             *
595             * @return the group finder
596             */
597            public GroupFinder getGroupFinder() {
598                    return groupFinder;
599            }
600    
601            /**
602             * Sets the group finder.
603             *
604             * @param groupFinder the group finder
605             */
606            public void setGroupFinder(GroupFinder groupFinder) {
607                    this.groupFinder = groupFinder;
608            }
609    
610            /**
611             * Returns the resource local service.
612             *
613             * @return the resource local service
614             */
615            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
616                    return resourceLocalService;
617            }
618    
619            /**
620             * Sets the resource local service.
621             *
622             * @param resourceLocalService the resource local service
623             */
624            public void setResourceLocalService(
625                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
626                    this.resourceLocalService = resourceLocalService;
627            }
628    
629            /**
630             * Returns the user local service.
631             *
632             * @return the user local service
633             */
634            public com.liferay.portal.service.UserLocalService getUserLocalService() {
635                    return userLocalService;
636            }
637    
638            /**
639             * Sets the user local service.
640             *
641             * @param userLocalService the user local service
642             */
643            public void setUserLocalService(
644                    com.liferay.portal.service.UserLocalService userLocalService) {
645                    this.userLocalService = userLocalService;
646            }
647    
648            /**
649             * Returns the user persistence.
650             *
651             * @return the user persistence
652             */
653            public UserPersistence getUserPersistence() {
654                    return userPersistence;
655            }
656    
657            /**
658             * Sets the user persistence.
659             *
660             * @param userPersistence the user persistence
661             */
662            public void setUserPersistence(UserPersistence userPersistence) {
663                    this.userPersistence = userPersistence;
664            }
665    
666            /**
667             * Returns the user finder.
668             *
669             * @return the user finder
670             */
671            public UserFinder getUserFinder() {
672                    return userFinder;
673            }
674    
675            /**
676             * Sets the user finder.
677             *
678             * @param userFinder the user finder
679             */
680            public void setUserFinder(UserFinder userFinder) {
681                    this.userFinder = userFinder;
682            }
683    
684            /**
685             * Returns the asset category local service.
686             *
687             * @return the asset category local service
688             */
689            public com.liferay.portlet.asset.service.AssetCategoryLocalService getAssetCategoryLocalService() {
690                    return assetCategoryLocalService;
691            }
692    
693            /**
694             * Sets the asset category local service.
695             *
696             * @param assetCategoryLocalService the asset category local service
697             */
698            public void setAssetCategoryLocalService(
699                    com.liferay.portlet.asset.service.AssetCategoryLocalService assetCategoryLocalService) {
700                    this.assetCategoryLocalService = assetCategoryLocalService;
701            }
702    
703            /**
704             * Returns the asset category persistence.
705             *
706             * @return the asset category persistence
707             */
708            public AssetCategoryPersistence getAssetCategoryPersistence() {
709                    return assetCategoryPersistence;
710            }
711    
712            /**
713             * Sets the asset category persistence.
714             *
715             * @param assetCategoryPersistence the asset category persistence
716             */
717            public void setAssetCategoryPersistence(
718                    AssetCategoryPersistence assetCategoryPersistence) {
719                    this.assetCategoryPersistence = assetCategoryPersistence;
720            }
721    
722            /**
723             * Returns the asset category finder.
724             *
725             * @return the asset category finder
726             */
727            public AssetCategoryFinder getAssetCategoryFinder() {
728                    return assetCategoryFinder;
729            }
730    
731            /**
732             * Sets the asset category finder.
733             *
734             * @param assetCategoryFinder the asset category finder
735             */
736            public void setAssetCategoryFinder(AssetCategoryFinder assetCategoryFinder) {
737                    this.assetCategoryFinder = assetCategoryFinder;
738            }
739    
740            public void afterPropertiesSet() {
741                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.asset.model.AssetVocabulary",
742                            assetVocabularyLocalService);
743            }
744    
745            public void destroy() {
746                    persistedModelLocalServiceRegistry.unregister(
747                            "com.liferay.portlet.asset.model.AssetVocabulary");
748            }
749    
750            /**
751             * Returns the OSGi service identifier.
752             *
753             * @return the OSGi service identifier
754             */
755            @Override
756            public String getOSGiServiceIdentifier() {
757                    return AssetVocabularyLocalService.class.getName();
758            }
759    
760            protected Class<?> getModelClass() {
761                    return AssetVocabulary.class;
762            }
763    
764            protected String getModelClassName() {
765                    return AssetVocabulary.class.getName();
766            }
767    
768            /**
769             * Performs a SQL query.
770             *
771             * @param sql the sql query
772             */
773            protected void runSQL(String sql) {
774                    try {
775                            DataSource dataSource = assetVocabularyPersistence.getDataSource();
776    
777                            DB db = DBManagerUtil.getDB();
778    
779                            sql = db.buildSQL(sql);
780                            sql = PortalUtil.transformSQL(sql);
781    
782                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
783                                            sql, new int[0]);
784    
785                            sqlUpdate.update();
786                    }
787                    catch (Exception e) {
788                            throw new SystemException(e);
789                    }
790            }
791    
792            @BeanReference(type = com.liferay.portlet.asset.service.AssetVocabularyLocalService.class)
793            protected AssetVocabularyLocalService assetVocabularyLocalService;
794            @BeanReference(type = AssetVocabularyPersistence.class)
795            protected AssetVocabularyPersistence assetVocabularyPersistence;
796            @BeanReference(type = AssetVocabularyFinder.class)
797            protected AssetVocabularyFinder assetVocabularyFinder;
798            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
799            protected com.liferay.counter.service.CounterLocalService counterLocalService;
800            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
801            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
802            @BeanReference(type = ClassNamePersistence.class)
803            protected ClassNamePersistence classNamePersistence;
804            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
805            protected com.liferay.portal.service.GroupLocalService groupLocalService;
806            @BeanReference(type = GroupPersistence.class)
807            protected GroupPersistence groupPersistence;
808            @BeanReference(type = GroupFinder.class)
809            protected GroupFinder groupFinder;
810            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
811            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
812            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
813            protected com.liferay.portal.service.UserLocalService userLocalService;
814            @BeanReference(type = UserPersistence.class)
815            protected UserPersistence userPersistence;
816            @BeanReference(type = UserFinder.class)
817            protected UserFinder userFinder;
818            @BeanReference(type = com.liferay.portlet.asset.service.AssetCategoryLocalService.class)
819            protected com.liferay.portlet.asset.service.AssetCategoryLocalService assetCategoryLocalService;
820            @BeanReference(type = AssetCategoryPersistence.class)
821            protected AssetCategoryPersistence assetCategoryPersistence;
822            @BeanReference(type = AssetCategoryFinder.class)
823            protected AssetCategoryFinder assetCategoryFinder;
824            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
825            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
826    }