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.AssetCategory;
020    import com.liferay.asset.kernel.service.AssetCategoryLocalService;
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.AssetCategoryPropertyFinder;
024    import com.liferay.asset.kernel.service.persistence.AssetCategoryPropertyPersistence;
025    import com.liferay.asset.kernel.service.persistence.AssetEntryFinder;
026    import com.liferay.asset.kernel.service.persistence.AssetEntryPersistence;
027    import com.liferay.asset.kernel.service.persistence.AssetTagFinder;
028    import com.liferay.asset.kernel.service.persistence.AssetTagPersistence;
029    import com.liferay.asset.kernel.service.persistence.AssetVocabularyFinder;
030    import com.liferay.asset.kernel.service.persistence.AssetVocabularyPersistence;
031    
032    import com.liferay.exportimport.kernel.lar.ExportImportHelperUtil;
033    import com.liferay.exportimport.kernel.lar.ManifestSummary;
034    import com.liferay.exportimport.kernel.lar.PortletDataContext;
035    import com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil;
036    import com.liferay.exportimport.kernel.lar.StagedModelType;
037    
038    import com.liferay.portal.kernel.bean.BeanReference;
039    import com.liferay.portal.kernel.dao.db.DB;
040    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
041    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
042    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
043    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
044    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
045    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
046    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
047    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
048    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
049    import com.liferay.portal.kernel.dao.orm.Projection;
050    import com.liferay.portal.kernel.exception.PortalException;
051    import com.liferay.portal.kernel.exception.SystemException;
052    import com.liferay.portal.kernel.model.PersistedModel;
053    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
054    import com.liferay.portal.kernel.search.Indexable;
055    import com.liferay.portal.kernel.search.IndexableType;
056    import com.liferay.portal.kernel.service.BaseLocalServiceImpl;
057    import com.liferay.portal.kernel.service.PersistedModelLocalServiceRegistry;
058    import com.liferay.portal.kernel.service.persistence.ClassNamePersistence;
059    import com.liferay.portal.kernel.service.persistence.UserFinder;
060    import com.liferay.portal.kernel.service.persistence.UserPersistence;
061    import com.liferay.portal.kernel.util.OrderByComparator;
062    import com.liferay.portal.kernel.util.PortalUtil;
063    
064    import java.io.Serializable;
065    
066    import java.util.List;
067    
068    import javax.sql.DataSource;
069    
070    /**
071     * Provides the base implementation for the asset category local service.
072     *
073     * <p>
074     * 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.AssetCategoryLocalServiceImpl}.
075     * </p>
076     *
077     * @author Brian Wing Shun Chan
078     * @see com.liferay.portlet.asset.service.impl.AssetCategoryLocalServiceImpl
079     * @see com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil
080     * @generated
081     */
082    @ProviderType
083    public abstract class AssetCategoryLocalServiceBaseImpl
084            extends BaseLocalServiceImpl implements AssetCategoryLocalService,
085                    IdentifiableOSGiService {
086            /*
087             * NOTE FOR DEVELOPERS:
088             *
089             * Never modify or reference this class directly. Always use {@link com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil} to access the asset category local service.
090             */
091    
092            /**
093             * Adds the asset category to the database. Also notifies the appropriate model listeners.
094             *
095             * @param assetCategory the asset category
096             * @return the asset category that was added
097             */
098            @Indexable(type = IndexableType.REINDEX)
099            @Override
100            public AssetCategory addAssetCategory(AssetCategory assetCategory) {
101                    assetCategory.setNew(true);
102    
103                    return assetCategoryPersistence.update(assetCategory);
104            }
105    
106            /**
107             * Creates a new asset category with the primary key. Does not add the asset category to the database.
108             *
109             * @param categoryId the primary key for the new asset category
110             * @return the new asset category
111             */
112            @Override
113            public AssetCategory createAssetCategory(long categoryId) {
114                    return assetCategoryPersistence.create(categoryId);
115            }
116    
117            /**
118             * Deletes the asset category with the primary key from the database. Also notifies the appropriate model listeners.
119             *
120             * @param categoryId the primary key of the asset category
121             * @return the asset category that was removed
122             * @throws PortalException if a asset category with the primary key could not be found
123             */
124            @Indexable(type = IndexableType.DELETE)
125            @Override
126            public AssetCategory deleteAssetCategory(long categoryId)
127                    throws PortalException {
128                    return assetCategoryPersistence.remove(categoryId);
129            }
130    
131            /**
132             * Deletes the asset category from the database. Also notifies the appropriate model listeners.
133             *
134             * @param assetCategory the asset category
135             * @return the asset category that was removed
136             */
137            @Indexable(type = IndexableType.DELETE)
138            @Override
139            public AssetCategory deleteAssetCategory(AssetCategory assetCategory) {
140                    return assetCategoryPersistence.remove(assetCategory);
141            }
142    
143            @Override
144            public DynamicQuery dynamicQuery() {
145                    Class<?> clazz = getClass();
146    
147                    return DynamicQueryFactoryUtil.forClass(AssetCategory.class,
148                            clazz.getClassLoader());
149            }
150    
151            /**
152             * Performs a dynamic query on the database and returns the matching rows.
153             *
154             * @param dynamicQuery the dynamic query
155             * @return the matching rows
156             */
157            @Override
158            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
159                    return assetCategoryPersistence.findWithDynamicQuery(dynamicQuery);
160            }
161    
162            /**
163             * Performs a dynamic query on the database and returns a range of the matching rows.
164             *
165             * <p>
166             * 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.AssetCategoryModelImpl}. 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.
167             * </p>
168             *
169             * @param dynamicQuery the dynamic query
170             * @param start the lower bound of the range of model instances
171             * @param end the upper bound of the range of model instances (not inclusive)
172             * @return the range of matching rows
173             */
174            @Override
175            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
176                    int end) {
177                    return assetCategoryPersistence.findWithDynamicQuery(dynamicQuery,
178                            start, end);
179            }
180    
181            /**
182             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
183             *
184             * <p>
185             * 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.AssetCategoryModelImpl}. 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.
186             * </p>
187             *
188             * @param dynamicQuery the dynamic query
189             * @param start the lower bound of the range of model instances
190             * @param end the upper bound of the range of model instances (not inclusive)
191             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
192             * @return the ordered range of matching rows
193             */
194            @Override
195            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
196                    int end, OrderByComparator<T> orderByComparator) {
197                    return assetCategoryPersistence.findWithDynamicQuery(dynamicQuery,
198                            start, end, orderByComparator);
199            }
200    
201            /**
202             * Returns the number of rows matching the dynamic query.
203             *
204             * @param dynamicQuery the dynamic query
205             * @return the number of rows matching the dynamic query
206             */
207            @Override
208            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
209                    return assetCategoryPersistence.countWithDynamicQuery(dynamicQuery);
210            }
211    
212            /**
213             * Returns the number of rows matching the dynamic query.
214             *
215             * @param dynamicQuery the dynamic query
216             * @param projection the projection to apply to the query
217             * @return the number of rows matching the dynamic query
218             */
219            @Override
220            public long dynamicQueryCount(DynamicQuery dynamicQuery,
221                    Projection projection) {
222                    return assetCategoryPersistence.countWithDynamicQuery(dynamicQuery,
223                            projection);
224            }
225    
226            @Override
227            public AssetCategory fetchAssetCategory(long categoryId) {
228                    return assetCategoryPersistence.fetchByPrimaryKey(categoryId);
229            }
230    
231            /**
232             * Returns the asset category matching the UUID and group.
233             *
234             * @param uuid the asset category's UUID
235             * @param groupId the primary key of the group
236             * @return the matching asset category, or <code>null</code> if a matching asset category could not be found
237             */
238            @Override
239            public AssetCategory fetchAssetCategoryByUuidAndGroupId(String uuid,
240                    long groupId) {
241                    return assetCategoryPersistence.fetchByUUID_G(uuid, groupId);
242            }
243    
244            /**
245             * Returns the asset category with the primary key.
246             *
247             * @param categoryId the primary key of the asset category
248             * @return the asset category
249             * @throws PortalException if a asset category with the primary key could not be found
250             */
251            @Override
252            public AssetCategory getAssetCategory(long categoryId)
253                    throws PortalException {
254                    return assetCategoryPersistence.findByPrimaryKey(categoryId);
255            }
256    
257            @Override
258            public ActionableDynamicQuery getActionableDynamicQuery() {
259                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
260    
261                    actionableDynamicQuery.setBaseLocalService(com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil.getService());
262                    actionableDynamicQuery.setClassLoader(getClassLoader());
263                    actionableDynamicQuery.setModelClass(AssetCategory.class);
264    
265                    actionableDynamicQuery.setPrimaryKeyPropertyName("categoryId");
266    
267                    return actionableDynamicQuery;
268            }
269    
270            @Override
271            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
272                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
273    
274                    indexableActionableDynamicQuery.setBaseLocalService(com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil.getService());
275                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
276                    indexableActionableDynamicQuery.setModelClass(AssetCategory.class);
277    
278                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("categoryId");
279    
280                    return indexableActionableDynamicQuery;
281            }
282    
283            protected void initActionableDynamicQuery(
284                    ActionableDynamicQuery actionableDynamicQuery) {
285                    actionableDynamicQuery.setBaseLocalService(com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil.getService());
286                    actionableDynamicQuery.setClassLoader(getClassLoader());
287                    actionableDynamicQuery.setModelClass(AssetCategory.class);
288    
289                    actionableDynamicQuery.setPrimaryKeyPropertyName("categoryId");
290            }
291    
292            @Override
293            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
294                    final PortletDataContext portletDataContext) {
295                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
296                                    @Override
297                                    public long performCount() throws PortalException {
298                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
299    
300                                            StagedModelType stagedModelType = getStagedModelType();
301    
302                                            long modelAdditionCount = super.performCount();
303    
304                                            manifestSummary.addModelAdditionCount(stagedModelType,
305                                                    modelAdditionCount);
306    
307                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
308                                                            stagedModelType);
309    
310                                            manifestSummary.addModelDeletionCount(stagedModelType,
311                                                    modelDeletionCount);
312    
313                                            return modelAdditionCount;
314                                    }
315                            };
316    
317                    initActionableDynamicQuery(exportActionableDynamicQuery);
318    
319                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
320                                    @Override
321                                    public void addCriteria(DynamicQuery dynamicQuery) {
322                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
323                                                    "modifiedDate");
324                                    }
325                            });
326    
327                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
328    
329                    exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
330    
331                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<AssetCategory>() {
332                                    @Override
333                                    public void performAction(AssetCategory assetCategory)
334                                            throws PortalException {
335                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
336                                                    assetCategory);
337                                    }
338                            });
339                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
340                                    PortalUtil.getClassNameId(AssetCategory.class.getName())));
341    
342                    return exportActionableDynamicQuery;
343            }
344    
345            /**
346             * @throws PortalException
347             */
348            @Override
349            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
350                    throws PortalException {
351                    return assetCategoryLocalService.deleteAssetCategory((AssetCategory)persistedModel);
352            }
353    
354            @Override
355            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
356                    throws PortalException {
357                    return assetCategoryPersistence.findByPrimaryKey(primaryKeyObj);
358            }
359    
360            /**
361             * Returns all the asset categories matching the UUID and company.
362             *
363             * @param uuid the UUID of the asset categories
364             * @param companyId the primary key of the company
365             * @return the matching asset categories, or an empty list if no matches were found
366             */
367            @Override
368            public List<AssetCategory> getAssetCategoriesByUuidAndCompanyId(
369                    String uuid, long companyId) {
370                    return assetCategoryPersistence.findByUuid_C(uuid, companyId);
371            }
372    
373            /**
374             * Returns a range of asset categories matching the UUID and company.
375             *
376             * @param uuid the UUID of the asset categories
377             * @param companyId the primary key of the company
378             * @param start the lower bound of the range of asset categories
379             * @param end the upper bound of the range of asset categories (not inclusive)
380             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
381             * @return the range of matching asset categories, or an empty list if no matches were found
382             */
383            @Override
384            public List<AssetCategory> getAssetCategoriesByUuidAndCompanyId(
385                    String uuid, long companyId, int start, int end,
386                    OrderByComparator<AssetCategory> orderByComparator) {
387                    return assetCategoryPersistence.findByUuid_C(uuid, companyId, start,
388                            end, orderByComparator);
389            }
390    
391            /**
392             * Returns the asset category matching the UUID and group.
393             *
394             * @param uuid the asset category's UUID
395             * @param groupId the primary key of the group
396             * @return the matching asset category
397             * @throws PortalException if a matching asset category could not be found
398             */
399            @Override
400            public AssetCategory getAssetCategoryByUuidAndGroupId(String uuid,
401                    long groupId) throws PortalException {
402                    return assetCategoryPersistence.findByUUID_G(uuid, groupId);
403            }
404    
405            /**
406             * Returns a range of all the asset categories.
407             *
408             * <p>
409             * 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.AssetCategoryModelImpl}. 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.
410             * </p>
411             *
412             * @param start the lower bound of the range of asset categories
413             * @param end the upper bound of the range of asset categories (not inclusive)
414             * @return the range of asset categories
415             */
416            @Override
417            public List<AssetCategory> getAssetCategories(int start, int end) {
418                    return assetCategoryPersistence.findAll(start, end);
419            }
420    
421            /**
422             * Returns the number of asset categories.
423             *
424             * @return the number of asset categories
425             */
426            @Override
427            public int getAssetCategoriesCount() {
428                    return assetCategoryPersistence.countAll();
429            }
430    
431            /**
432             * Updates the asset category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
433             *
434             * @param assetCategory the asset category
435             * @return the asset category that was updated
436             */
437            @Indexable(type = IndexableType.REINDEX)
438            @Override
439            public AssetCategory updateAssetCategory(AssetCategory assetCategory) {
440                    return assetCategoryPersistence.update(assetCategory);
441            }
442    
443            /**
444             */
445            @Override
446            public void addAssetEntryAssetCategory(long entryId, long categoryId) {
447                    assetEntryPersistence.addAssetCategory(entryId, categoryId);
448            }
449    
450            /**
451             */
452            @Override
453            public void addAssetEntryAssetCategory(long entryId,
454                    AssetCategory assetCategory) {
455                    assetEntryPersistence.addAssetCategory(entryId, assetCategory);
456            }
457    
458            /**
459             */
460            @Override
461            public void addAssetEntryAssetCategories(long entryId, long[] categoryIds) {
462                    assetEntryPersistence.addAssetCategories(entryId, categoryIds);
463            }
464    
465            /**
466             */
467            @Override
468            public void addAssetEntryAssetCategories(long entryId,
469                    List<AssetCategory> AssetCategories) {
470                    assetEntryPersistence.addAssetCategories(entryId, AssetCategories);
471            }
472    
473            /**
474             */
475            @Override
476            public void clearAssetEntryAssetCategories(long entryId) {
477                    assetEntryPersistence.clearAssetCategories(entryId);
478            }
479    
480            /**
481             */
482            @Override
483            public void deleteAssetEntryAssetCategory(long entryId, long categoryId) {
484                    assetEntryPersistence.removeAssetCategory(entryId, categoryId);
485            }
486    
487            /**
488             */
489            @Override
490            public void deleteAssetEntryAssetCategory(long entryId,
491                    AssetCategory assetCategory) {
492                    assetEntryPersistence.removeAssetCategory(entryId, assetCategory);
493            }
494    
495            /**
496             */
497            @Override
498            public void deleteAssetEntryAssetCategories(long entryId, long[] categoryIds) {
499                    assetEntryPersistence.removeAssetCategories(entryId, categoryIds);
500            }
501    
502            /**
503             */
504            @Override
505            public void deleteAssetEntryAssetCategories(long entryId,
506                    List<AssetCategory> AssetCategories) {
507                    assetEntryPersistence.removeAssetCategories(entryId, AssetCategories);
508            }
509    
510            /**
511             * Returns the entryIds of the asset entries associated with the asset category.
512             *
513             * @param categoryId the categoryId of the asset category
514             * @return long[] the entryIds of asset entries associated with the asset category
515             */
516            @Override
517            public long[] getAssetEntryPrimaryKeys(long categoryId) {
518                    return assetCategoryPersistence.getAssetEntryPrimaryKeys(categoryId);
519            }
520    
521            /**
522             */
523            @Override
524            public List<AssetCategory> getAssetEntryAssetCategories(long entryId) {
525                    return assetEntryPersistence.getAssetCategories(entryId);
526            }
527    
528            /**
529             */
530            @Override
531            public List<AssetCategory> getAssetEntryAssetCategories(long entryId,
532                    int start, int end) {
533                    return assetEntryPersistence.getAssetCategories(entryId, start, end);
534            }
535    
536            /**
537             */
538            @Override
539            public List<AssetCategory> getAssetEntryAssetCategories(long entryId,
540                    int start, int end, OrderByComparator<AssetCategory> orderByComparator) {
541                    return assetEntryPersistence.getAssetCategories(entryId, start, end,
542                            orderByComparator);
543            }
544    
545            /**
546             */
547            @Override
548            public int getAssetEntryAssetCategoriesCount(long entryId) {
549                    return assetEntryPersistence.getAssetCategoriesSize(entryId);
550            }
551    
552            /**
553             */
554            @Override
555            public boolean hasAssetEntryAssetCategory(long entryId, long categoryId) {
556                    return assetEntryPersistence.containsAssetCategory(entryId, categoryId);
557            }
558    
559            /**
560             */
561            @Override
562            public boolean hasAssetEntryAssetCategories(long entryId) {
563                    return assetEntryPersistence.containsAssetCategories(entryId);
564            }
565    
566            /**
567             */
568            @Override
569            public void setAssetEntryAssetCategories(long entryId, long[] categoryIds) {
570                    assetEntryPersistence.setAssetCategories(entryId, categoryIds);
571            }
572    
573            /**
574             * Returns the asset category local service.
575             *
576             * @return the asset category local service
577             */
578            public AssetCategoryLocalService getAssetCategoryLocalService() {
579                    return assetCategoryLocalService;
580            }
581    
582            /**
583             * Sets the asset category local service.
584             *
585             * @param assetCategoryLocalService the asset category local service
586             */
587            public void setAssetCategoryLocalService(
588                    AssetCategoryLocalService assetCategoryLocalService) {
589                    this.assetCategoryLocalService = assetCategoryLocalService;
590            }
591    
592            /**
593             * Returns the asset category persistence.
594             *
595             * @return the asset category persistence
596             */
597            public AssetCategoryPersistence getAssetCategoryPersistence() {
598                    return assetCategoryPersistence;
599            }
600    
601            /**
602             * Sets the asset category persistence.
603             *
604             * @param assetCategoryPersistence the asset category persistence
605             */
606            public void setAssetCategoryPersistence(
607                    AssetCategoryPersistence assetCategoryPersistence) {
608                    this.assetCategoryPersistence = assetCategoryPersistence;
609            }
610    
611            /**
612             * Returns the asset category finder.
613             *
614             * @return the asset category finder
615             */
616            public AssetCategoryFinder getAssetCategoryFinder() {
617                    return assetCategoryFinder;
618            }
619    
620            /**
621             * Sets the asset category finder.
622             *
623             * @param assetCategoryFinder the asset category finder
624             */
625            public void setAssetCategoryFinder(AssetCategoryFinder assetCategoryFinder) {
626                    this.assetCategoryFinder = assetCategoryFinder;
627            }
628    
629            /**
630             * Returns the counter local service.
631             *
632             * @return the counter local service
633             */
634            public com.liferay.counter.kernel.service.CounterLocalService getCounterLocalService() {
635                    return counterLocalService;
636            }
637    
638            /**
639             * Sets the counter local service.
640             *
641             * @param counterLocalService the counter local service
642             */
643            public void setCounterLocalService(
644                    com.liferay.counter.kernel.service.CounterLocalService counterLocalService) {
645                    this.counterLocalService = counterLocalService;
646            }
647    
648            /**
649             * Returns the class name local service.
650             *
651             * @return the class name local service
652             */
653            public com.liferay.portal.kernel.service.ClassNameLocalService getClassNameLocalService() {
654                    return classNameLocalService;
655            }
656    
657            /**
658             * Sets the class name local service.
659             *
660             * @param classNameLocalService the class name local service
661             */
662            public void setClassNameLocalService(
663                    com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService) {
664                    this.classNameLocalService = classNameLocalService;
665            }
666    
667            /**
668             * Returns the class name persistence.
669             *
670             * @return the class name persistence
671             */
672            public ClassNamePersistence getClassNamePersistence() {
673                    return classNamePersistence;
674            }
675    
676            /**
677             * Sets the class name persistence.
678             *
679             * @param classNamePersistence the class name persistence
680             */
681            public void setClassNamePersistence(
682                    ClassNamePersistence classNamePersistence) {
683                    this.classNamePersistence = classNamePersistence;
684            }
685    
686            /**
687             * Returns the resource local service.
688             *
689             * @return the resource local service
690             */
691            public com.liferay.portal.kernel.service.ResourceLocalService getResourceLocalService() {
692                    return resourceLocalService;
693            }
694    
695            /**
696             * Sets the resource local service.
697             *
698             * @param resourceLocalService the resource local service
699             */
700            public void setResourceLocalService(
701                    com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService) {
702                    this.resourceLocalService = resourceLocalService;
703            }
704    
705            /**
706             * Returns the user local service.
707             *
708             * @return the user local service
709             */
710            public com.liferay.portal.kernel.service.UserLocalService getUserLocalService() {
711                    return userLocalService;
712            }
713    
714            /**
715             * Sets the user local service.
716             *
717             * @param userLocalService the user local service
718             */
719            public void setUserLocalService(
720                    com.liferay.portal.kernel.service.UserLocalService userLocalService) {
721                    this.userLocalService = userLocalService;
722            }
723    
724            /**
725             * Returns the user persistence.
726             *
727             * @return the user persistence
728             */
729            public UserPersistence getUserPersistence() {
730                    return userPersistence;
731            }
732    
733            /**
734             * Sets the user persistence.
735             *
736             * @param userPersistence the user persistence
737             */
738            public void setUserPersistence(UserPersistence userPersistence) {
739                    this.userPersistence = userPersistence;
740            }
741    
742            /**
743             * Returns the user finder.
744             *
745             * @return the user finder
746             */
747            public UserFinder getUserFinder() {
748                    return userFinder;
749            }
750    
751            /**
752             * Sets the user finder.
753             *
754             * @param userFinder the user finder
755             */
756            public void setUserFinder(UserFinder userFinder) {
757                    this.userFinder = userFinder;
758            }
759    
760            /**
761             * Returns the asset category property local service.
762             *
763             * @return the asset category property local service
764             */
765            public com.liferay.asset.kernel.service.AssetCategoryPropertyLocalService getAssetCategoryPropertyLocalService() {
766                    return assetCategoryPropertyLocalService;
767            }
768    
769            /**
770             * Sets the asset category property local service.
771             *
772             * @param assetCategoryPropertyLocalService the asset category property local service
773             */
774            public void setAssetCategoryPropertyLocalService(
775                    com.liferay.asset.kernel.service.AssetCategoryPropertyLocalService assetCategoryPropertyLocalService) {
776                    this.assetCategoryPropertyLocalService = assetCategoryPropertyLocalService;
777            }
778    
779            /**
780             * Returns the asset category property persistence.
781             *
782             * @return the asset category property persistence
783             */
784            public AssetCategoryPropertyPersistence getAssetCategoryPropertyPersistence() {
785                    return assetCategoryPropertyPersistence;
786            }
787    
788            /**
789             * Sets the asset category property persistence.
790             *
791             * @param assetCategoryPropertyPersistence the asset category property persistence
792             */
793            public void setAssetCategoryPropertyPersistence(
794                    AssetCategoryPropertyPersistence assetCategoryPropertyPersistence) {
795                    this.assetCategoryPropertyPersistence = assetCategoryPropertyPersistence;
796            }
797    
798            /**
799             * Returns the asset category property finder.
800             *
801             * @return the asset category property finder
802             */
803            public AssetCategoryPropertyFinder getAssetCategoryPropertyFinder() {
804                    return assetCategoryPropertyFinder;
805            }
806    
807            /**
808             * Sets the asset category property finder.
809             *
810             * @param assetCategoryPropertyFinder the asset category property finder
811             */
812            public void setAssetCategoryPropertyFinder(
813                    AssetCategoryPropertyFinder assetCategoryPropertyFinder) {
814                    this.assetCategoryPropertyFinder = assetCategoryPropertyFinder;
815            }
816    
817            /**
818             * Returns the asset entry local service.
819             *
820             * @return the asset entry local service
821             */
822            public com.liferay.asset.kernel.service.AssetEntryLocalService getAssetEntryLocalService() {
823                    return assetEntryLocalService;
824            }
825    
826            /**
827             * Sets the asset entry local service.
828             *
829             * @param assetEntryLocalService the asset entry local service
830             */
831            public void setAssetEntryLocalService(
832                    com.liferay.asset.kernel.service.AssetEntryLocalService assetEntryLocalService) {
833                    this.assetEntryLocalService = assetEntryLocalService;
834            }
835    
836            /**
837             * Returns the asset entry persistence.
838             *
839             * @return the asset entry persistence
840             */
841            public AssetEntryPersistence getAssetEntryPersistence() {
842                    return assetEntryPersistence;
843            }
844    
845            /**
846             * Sets the asset entry persistence.
847             *
848             * @param assetEntryPersistence the asset entry persistence
849             */
850            public void setAssetEntryPersistence(
851                    AssetEntryPersistence assetEntryPersistence) {
852                    this.assetEntryPersistence = assetEntryPersistence;
853            }
854    
855            /**
856             * Returns the asset entry finder.
857             *
858             * @return the asset entry finder
859             */
860            public AssetEntryFinder getAssetEntryFinder() {
861                    return assetEntryFinder;
862            }
863    
864            /**
865             * Sets the asset entry finder.
866             *
867             * @param assetEntryFinder the asset entry finder
868             */
869            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
870                    this.assetEntryFinder = assetEntryFinder;
871            }
872    
873            /**
874             * Returns the asset tag local service.
875             *
876             * @return the asset tag local service
877             */
878            public com.liferay.asset.kernel.service.AssetTagLocalService getAssetTagLocalService() {
879                    return assetTagLocalService;
880            }
881    
882            /**
883             * Sets the asset tag local service.
884             *
885             * @param assetTagLocalService the asset tag local service
886             */
887            public void setAssetTagLocalService(
888                    com.liferay.asset.kernel.service.AssetTagLocalService assetTagLocalService) {
889                    this.assetTagLocalService = assetTagLocalService;
890            }
891    
892            /**
893             * Returns the asset tag persistence.
894             *
895             * @return the asset tag persistence
896             */
897            public AssetTagPersistence getAssetTagPersistence() {
898                    return assetTagPersistence;
899            }
900    
901            /**
902             * Sets the asset tag persistence.
903             *
904             * @param assetTagPersistence the asset tag persistence
905             */
906            public void setAssetTagPersistence(AssetTagPersistence assetTagPersistence) {
907                    this.assetTagPersistence = assetTagPersistence;
908            }
909    
910            /**
911             * Returns the asset tag finder.
912             *
913             * @return the asset tag finder
914             */
915            public AssetTagFinder getAssetTagFinder() {
916                    return assetTagFinder;
917            }
918    
919            /**
920             * Sets the asset tag finder.
921             *
922             * @param assetTagFinder the asset tag finder
923             */
924            public void setAssetTagFinder(AssetTagFinder assetTagFinder) {
925                    this.assetTagFinder = assetTagFinder;
926            }
927    
928            /**
929             * Returns the asset vocabulary local service.
930             *
931             * @return the asset vocabulary local service
932             */
933            public com.liferay.asset.kernel.service.AssetVocabularyLocalService getAssetVocabularyLocalService() {
934                    return assetVocabularyLocalService;
935            }
936    
937            /**
938             * Sets the asset vocabulary local service.
939             *
940             * @param assetVocabularyLocalService the asset vocabulary local service
941             */
942            public void setAssetVocabularyLocalService(
943                    com.liferay.asset.kernel.service.AssetVocabularyLocalService assetVocabularyLocalService) {
944                    this.assetVocabularyLocalService = assetVocabularyLocalService;
945            }
946    
947            /**
948             * Returns the asset vocabulary persistence.
949             *
950             * @return the asset vocabulary persistence
951             */
952            public AssetVocabularyPersistence getAssetVocabularyPersistence() {
953                    return assetVocabularyPersistence;
954            }
955    
956            /**
957             * Sets the asset vocabulary persistence.
958             *
959             * @param assetVocabularyPersistence the asset vocabulary persistence
960             */
961            public void setAssetVocabularyPersistence(
962                    AssetVocabularyPersistence assetVocabularyPersistence) {
963                    this.assetVocabularyPersistence = assetVocabularyPersistence;
964            }
965    
966            /**
967             * Returns the asset vocabulary finder.
968             *
969             * @return the asset vocabulary finder
970             */
971            public AssetVocabularyFinder getAssetVocabularyFinder() {
972                    return assetVocabularyFinder;
973            }
974    
975            /**
976             * Sets the asset vocabulary finder.
977             *
978             * @param assetVocabularyFinder the asset vocabulary finder
979             */
980            public void setAssetVocabularyFinder(
981                    AssetVocabularyFinder assetVocabularyFinder) {
982                    this.assetVocabularyFinder = assetVocabularyFinder;
983            }
984    
985            public void afterPropertiesSet() {
986                    persistedModelLocalServiceRegistry.register("com.liferay.asset.kernel.model.AssetCategory",
987                            assetCategoryLocalService);
988            }
989    
990            public void destroy() {
991                    persistedModelLocalServiceRegistry.unregister(
992                            "com.liferay.asset.kernel.model.AssetCategory");
993            }
994    
995            /**
996             * Returns the OSGi service identifier.
997             *
998             * @return the OSGi service identifier
999             */
1000            @Override
1001            public String getOSGiServiceIdentifier() {
1002                    return AssetCategoryLocalService.class.getName();
1003            }
1004    
1005            protected Class<?> getModelClass() {
1006                    return AssetCategory.class;
1007            }
1008    
1009            protected String getModelClassName() {
1010                    return AssetCategory.class.getName();
1011            }
1012    
1013            /**
1014             * Performs a SQL query.
1015             *
1016             * @param sql the sql query
1017             */
1018            protected void runSQL(String sql) {
1019                    try {
1020                            DataSource dataSource = assetCategoryPersistence.getDataSource();
1021    
1022                            DB db = DBManagerUtil.getDB();
1023    
1024                            sql = db.buildSQL(sql);
1025                            sql = PortalUtil.transformSQL(sql);
1026    
1027                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1028                                            sql, new int[0]);
1029    
1030                            sqlUpdate.update();
1031                    }
1032                    catch (Exception e) {
1033                            throw new SystemException(e);
1034                    }
1035            }
1036    
1037            @BeanReference(type = com.liferay.asset.kernel.service.AssetCategoryLocalService.class)
1038            protected AssetCategoryLocalService assetCategoryLocalService;
1039            @BeanReference(type = AssetCategoryPersistence.class)
1040            protected AssetCategoryPersistence assetCategoryPersistence;
1041            @BeanReference(type = AssetCategoryFinder.class)
1042            protected AssetCategoryFinder assetCategoryFinder;
1043            @BeanReference(type = com.liferay.counter.kernel.service.CounterLocalService.class)
1044            protected com.liferay.counter.kernel.service.CounterLocalService counterLocalService;
1045            @BeanReference(type = com.liferay.portal.kernel.service.ClassNameLocalService.class)
1046            protected com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService;
1047            @BeanReference(type = ClassNamePersistence.class)
1048            protected ClassNamePersistence classNamePersistence;
1049            @BeanReference(type = com.liferay.portal.kernel.service.ResourceLocalService.class)
1050            protected com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService;
1051            @BeanReference(type = com.liferay.portal.kernel.service.UserLocalService.class)
1052            protected com.liferay.portal.kernel.service.UserLocalService userLocalService;
1053            @BeanReference(type = UserPersistence.class)
1054            protected UserPersistence userPersistence;
1055            @BeanReference(type = UserFinder.class)
1056            protected UserFinder userFinder;
1057            @BeanReference(type = com.liferay.asset.kernel.service.AssetCategoryPropertyLocalService.class)
1058            protected com.liferay.asset.kernel.service.AssetCategoryPropertyLocalService assetCategoryPropertyLocalService;
1059            @BeanReference(type = AssetCategoryPropertyPersistence.class)
1060            protected AssetCategoryPropertyPersistence assetCategoryPropertyPersistence;
1061            @BeanReference(type = AssetCategoryPropertyFinder.class)
1062            protected AssetCategoryPropertyFinder assetCategoryPropertyFinder;
1063            @BeanReference(type = com.liferay.asset.kernel.service.AssetEntryLocalService.class)
1064            protected com.liferay.asset.kernel.service.AssetEntryLocalService assetEntryLocalService;
1065            @BeanReference(type = AssetEntryPersistence.class)
1066            protected AssetEntryPersistence assetEntryPersistence;
1067            @BeanReference(type = AssetEntryFinder.class)
1068            protected AssetEntryFinder assetEntryFinder;
1069            @BeanReference(type = com.liferay.asset.kernel.service.AssetTagLocalService.class)
1070            protected com.liferay.asset.kernel.service.AssetTagLocalService assetTagLocalService;
1071            @BeanReference(type = AssetTagPersistence.class)
1072            protected AssetTagPersistence assetTagPersistence;
1073            @BeanReference(type = AssetTagFinder.class)
1074            protected AssetTagFinder assetTagFinder;
1075            @BeanReference(type = com.liferay.asset.kernel.service.AssetVocabularyLocalService.class)
1076            protected com.liferay.asset.kernel.service.AssetVocabularyLocalService assetVocabularyLocalService;
1077            @BeanReference(type = AssetVocabularyPersistence.class)
1078            protected AssetVocabularyPersistence assetVocabularyPersistence;
1079            @BeanReference(type = AssetVocabularyFinder.class)
1080            protected AssetVocabularyFinder assetVocabularyFinder;
1081            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1082            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1083    }