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