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