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