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