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