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