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.social.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.dao.db.DB;
021    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
028    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
029    import com.liferay.portal.kernel.dao.orm.Projection;
030    import com.liferay.portal.kernel.exception.PortalException;
031    import com.liferay.portal.kernel.exception.SystemException;
032    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
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.service.persistence.AssetEntryFinder;
047    import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
048    import com.liferay.portlet.social.model.SocialActivityCounter;
049    import com.liferay.portlet.social.service.SocialActivityCounterLocalService;
050    import com.liferay.portlet.social.service.persistence.SocialActivityCounterFinder;
051    import com.liferay.portlet.social.service.persistence.SocialActivityCounterPersistence;
052    import com.liferay.portlet.social.service.persistence.SocialActivityLimitPersistence;
053    import com.liferay.portlet.social.service.persistence.SocialActivitySettingPersistence;
054    
055    import java.io.Serializable;
056    
057    import java.util.List;
058    
059    import javax.sql.DataSource;
060    
061    /**
062     * Provides the base implementation for the social activity counter local service.
063     *
064     * <p>
065     * 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.social.service.impl.SocialActivityCounterLocalServiceImpl}.
066     * </p>
067     *
068     * @author Brian Wing Shun Chan
069     * @see com.liferay.portlet.social.service.impl.SocialActivityCounterLocalServiceImpl
070     * @see com.liferay.portlet.social.service.SocialActivityCounterLocalServiceUtil
071     * @generated
072     */
073    @ProviderType
074    public abstract class SocialActivityCounterLocalServiceBaseImpl
075            extends BaseLocalServiceImpl implements SocialActivityCounterLocalService,
076                    IdentifiableOSGiService {
077            /*
078             * NOTE FOR DEVELOPERS:
079             *
080             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.social.service.SocialActivityCounterLocalServiceUtil} to access the social activity counter local service.
081             */
082    
083            /**
084             * Adds the social activity counter to the database. Also notifies the appropriate model listeners.
085             *
086             * @param socialActivityCounter the social activity counter
087             * @return the social activity counter that was added
088             */
089            @Indexable(type = IndexableType.REINDEX)
090            @Override
091            public SocialActivityCounter addSocialActivityCounter(
092                    SocialActivityCounter socialActivityCounter) {
093                    socialActivityCounter.setNew(true);
094    
095                    return socialActivityCounterPersistence.update(socialActivityCounter);
096            }
097    
098            /**
099             * Creates a new social activity counter with the primary key. Does not add the social activity counter to the database.
100             *
101             * @param activityCounterId the primary key for the new social activity counter
102             * @return the new social activity counter
103             */
104            @Override
105            public SocialActivityCounter createSocialActivityCounter(
106                    long activityCounterId) {
107                    return socialActivityCounterPersistence.create(activityCounterId);
108            }
109    
110            /**
111             * Deletes the social activity counter with the primary key from the database. Also notifies the appropriate model listeners.
112             *
113             * @param activityCounterId the primary key of the social activity counter
114             * @return the social activity counter that was removed
115             * @throws PortalException if a social activity counter with the primary key could not be found
116             */
117            @Indexable(type = IndexableType.DELETE)
118            @Override
119            public SocialActivityCounter deleteSocialActivityCounter(
120                    long activityCounterId) throws PortalException {
121                    return socialActivityCounterPersistence.remove(activityCounterId);
122            }
123    
124            /**
125             * Deletes the social activity counter from the database. Also notifies the appropriate model listeners.
126             *
127             * @param socialActivityCounter the social activity counter
128             * @return the social activity counter that was removed
129             */
130            @Indexable(type = IndexableType.DELETE)
131            @Override
132            public SocialActivityCounter deleteSocialActivityCounter(
133                    SocialActivityCounter socialActivityCounter) {
134                    return socialActivityCounterPersistence.remove(socialActivityCounter);
135            }
136    
137            @Override
138            public DynamicQuery dynamicQuery() {
139                    Class<?> clazz = getClass();
140    
141                    return DynamicQueryFactoryUtil.forClass(SocialActivityCounter.class,
142                            clazz.getClassLoader());
143            }
144    
145            /**
146             * Performs a dynamic query on the database and returns the matching rows.
147             *
148             * @param dynamicQuery the dynamic query
149             * @return the matching rows
150             */
151            @Override
152            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
153                    return socialActivityCounterPersistence.findWithDynamicQuery(dynamicQuery);
154            }
155    
156            /**
157             * Performs a dynamic query on the database and returns a range of the matching rows.
158             *
159             * <p>
160             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.social.model.impl.SocialActivityCounterModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
161             * </p>
162             *
163             * @param dynamicQuery the dynamic query
164             * @param start the lower bound of the range of model instances
165             * @param end the upper bound of the range of model instances (not inclusive)
166             * @return the range of matching rows
167             */
168            @Override
169            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
170                    int end) {
171                    return socialActivityCounterPersistence.findWithDynamicQuery(dynamicQuery,
172                            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.social.model.impl.SocialActivityCounterModelImpl}. 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 socialActivityCounterPersistence.findWithDynamicQuery(dynamicQuery,
192                            start, 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 socialActivityCounterPersistence.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 socialActivityCounterPersistence.countWithDynamicQuery(dynamicQuery,
217                            projection);
218            }
219    
220            @Override
221            public SocialActivityCounter fetchSocialActivityCounter(
222                    long activityCounterId) {
223                    return socialActivityCounterPersistence.fetchByPrimaryKey(activityCounterId);
224            }
225    
226            /**
227             * Returns the social activity counter with the primary key.
228             *
229             * @param activityCounterId the primary key of the social activity counter
230             * @return the social activity counter
231             * @throws PortalException if a social activity counter with the primary key could not be found
232             */
233            @Override
234            public SocialActivityCounter getSocialActivityCounter(
235                    long activityCounterId) throws PortalException {
236                    return socialActivityCounterPersistence.findByPrimaryKey(activityCounterId);
237            }
238    
239            @Override
240            public ActionableDynamicQuery getActionableDynamicQuery() {
241                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
242    
243                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.social.service.SocialActivityCounterLocalServiceUtil.getService());
244                    actionableDynamicQuery.setClassLoader(getClassLoader());
245                    actionableDynamicQuery.setModelClass(SocialActivityCounter.class);
246    
247                    actionableDynamicQuery.setPrimaryKeyPropertyName("activityCounterId");
248    
249                    return actionableDynamicQuery;
250            }
251    
252            @Override
253            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
254                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
255    
256                    indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portlet.social.service.SocialActivityCounterLocalServiceUtil.getService());
257                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
258                    indexableActionableDynamicQuery.setModelClass(SocialActivityCounter.class);
259    
260                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName(
261                            "activityCounterId");
262    
263                    return indexableActionableDynamicQuery;
264            }
265    
266            protected void initActionableDynamicQuery(
267                    ActionableDynamicQuery actionableDynamicQuery) {
268                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.social.service.SocialActivityCounterLocalServiceUtil.getService());
269                    actionableDynamicQuery.setClassLoader(getClassLoader());
270                    actionableDynamicQuery.setModelClass(SocialActivityCounter.class);
271    
272                    actionableDynamicQuery.setPrimaryKeyPropertyName("activityCounterId");
273            }
274    
275            /**
276             * @throws PortalException
277             */
278            @Override
279            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
280                    throws PortalException {
281                    return socialActivityCounterLocalService.deleteSocialActivityCounter((SocialActivityCounter)persistedModel);
282            }
283    
284            @Override
285            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
286                    throws PortalException {
287                    return socialActivityCounterPersistence.findByPrimaryKey(primaryKeyObj);
288            }
289    
290            /**
291             * Returns a range of all the social activity counters.
292             *
293             * <p>
294             * 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.social.model.impl.SocialActivityCounterModelImpl}. 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.
295             * </p>
296             *
297             * @param start the lower bound of the range of social activity counters
298             * @param end the upper bound of the range of social activity counters (not inclusive)
299             * @return the range of social activity counters
300             */
301            @Override
302            public List<SocialActivityCounter> getSocialActivityCounters(int start,
303                    int end) {
304                    return socialActivityCounterPersistence.findAll(start, end);
305            }
306    
307            /**
308             * Returns the number of social activity counters.
309             *
310             * @return the number of social activity counters
311             */
312            @Override
313            public int getSocialActivityCountersCount() {
314                    return socialActivityCounterPersistence.countAll();
315            }
316    
317            /**
318             * Updates the social activity counter in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
319             *
320             * @param socialActivityCounter the social activity counter
321             * @return the social activity counter that was updated
322             */
323            @Indexable(type = IndexableType.REINDEX)
324            @Override
325            public SocialActivityCounter updateSocialActivityCounter(
326                    SocialActivityCounter socialActivityCounter) {
327                    return socialActivityCounterPersistence.update(socialActivityCounter);
328            }
329    
330            /**
331             * Returns the social activity counter local service.
332             *
333             * @return the social activity counter local service
334             */
335            public SocialActivityCounterLocalService getSocialActivityCounterLocalService() {
336                    return socialActivityCounterLocalService;
337            }
338    
339            /**
340             * Sets the social activity counter local service.
341             *
342             * @param socialActivityCounterLocalService the social activity counter local service
343             */
344            public void setSocialActivityCounterLocalService(
345                    SocialActivityCounterLocalService socialActivityCounterLocalService) {
346                    this.socialActivityCounterLocalService = socialActivityCounterLocalService;
347            }
348    
349            /**
350             * Returns the social activity counter persistence.
351             *
352             * @return the social activity counter persistence
353             */
354            public SocialActivityCounterPersistence getSocialActivityCounterPersistence() {
355                    return socialActivityCounterPersistence;
356            }
357    
358            /**
359             * Sets the social activity counter persistence.
360             *
361             * @param socialActivityCounterPersistence the social activity counter persistence
362             */
363            public void setSocialActivityCounterPersistence(
364                    SocialActivityCounterPersistence socialActivityCounterPersistence) {
365                    this.socialActivityCounterPersistence = socialActivityCounterPersistence;
366            }
367    
368            /**
369             * Returns the social activity counter finder.
370             *
371             * @return the social activity counter finder
372             */
373            public SocialActivityCounterFinder getSocialActivityCounterFinder() {
374                    return socialActivityCounterFinder;
375            }
376    
377            /**
378             * Sets the social activity counter finder.
379             *
380             * @param socialActivityCounterFinder the social activity counter finder
381             */
382            public void setSocialActivityCounterFinder(
383                    SocialActivityCounterFinder socialActivityCounterFinder) {
384                    this.socialActivityCounterFinder = socialActivityCounterFinder;
385            }
386    
387            /**
388             * Returns the counter local service.
389             *
390             * @return the counter local service
391             */
392            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
393                    return counterLocalService;
394            }
395    
396            /**
397             * Sets the counter local service.
398             *
399             * @param counterLocalService the counter local service
400             */
401            public void setCounterLocalService(
402                    com.liferay.counter.service.CounterLocalService counterLocalService) {
403                    this.counterLocalService = counterLocalService;
404            }
405    
406            /**
407             * Returns the class name local service.
408             *
409             * @return the class name local service
410             */
411            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
412                    return classNameLocalService;
413            }
414    
415            /**
416             * Sets the class name local service.
417             *
418             * @param classNameLocalService the class name local service
419             */
420            public void setClassNameLocalService(
421                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
422                    this.classNameLocalService = classNameLocalService;
423            }
424    
425            /**
426             * Returns the class name persistence.
427             *
428             * @return the class name persistence
429             */
430            public ClassNamePersistence getClassNamePersistence() {
431                    return classNamePersistence;
432            }
433    
434            /**
435             * Sets the class name persistence.
436             *
437             * @param classNamePersistence the class name persistence
438             */
439            public void setClassNamePersistence(
440                    ClassNamePersistence classNamePersistence) {
441                    this.classNamePersistence = classNamePersistence;
442            }
443    
444            /**
445             * Returns the group local service.
446             *
447             * @return the group local service
448             */
449            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
450                    return groupLocalService;
451            }
452    
453            /**
454             * Sets the group local service.
455             *
456             * @param groupLocalService the group local service
457             */
458            public void setGroupLocalService(
459                    com.liferay.portal.service.GroupLocalService groupLocalService) {
460                    this.groupLocalService = groupLocalService;
461            }
462    
463            /**
464             * Returns the group persistence.
465             *
466             * @return the group persistence
467             */
468            public GroupPersistence getGroupPersistence() {
469                    return groupPersistence;
470            }
471    
472            /**
473             * Sets the group persistence.
474             *
475             * @param groupPersistence the group persistence
476             */
477            public void setGroupPersistence(GroupPersistence groupPersistence) {
478                    this.groupPersistence = groupPersistence;
479            }
480    
481            /**
482             * Returns the group finder.
483             *
484             * @return the group finder
485             */
486            public GroupFinder getGroupFinder() {
487                    return groupFinder;
488            }
489    
490            /**
491             * Sets the group finder.
492             *
493             * @param groupFinder the group finder
494             */
495            public void setGroupFinder(GroupFinder groupFinder) {
496                    this.groupFinder = groupFinder;
497            }
498    
499            /**
500             * Returns the user local service.
501             *
502             * @return the user local service
503             */
504            public com.liferay.portal.service.UserLocalService getUserLocalService() {
505                    return userLocalService;
506            }
507    
508            /**
509             * Sets the user local service.
510             *
511             * @param userLocalService the user local service
512             */
513            public void setUserLocalService(
514                    com.liferay.portal.service.UserLocalService userLocalService) {
515                    this.userLocalService = userLocalService;
516            }
517    
518            /**
519             * Returns the user persistence.
520             *
521             * @return the user persistence
522             */
523            public UserPersistence getUserPersistence() {
524                    return userPersistence;
525            }
526    
527            /**
528             * Sets the user persistence.
529             *
530             * @param userPersistence the user persistence
531             */
532            public void setUserPersistence(UserPersistence userPersistence) {
533                    this.userPersistence = userPersistence;
534            }
535    
536            /**
537             * Returns the user finder.
538             *
539             * @return the user finder
540             */
541            public UserFinder getUserFinder() {
542                    return userFinder;
543            }
544    
545            /**
546             * Sets the user finder.
547             *
548             * @param userFinder the user finder
549             */
550            public void setUserFinder(UserFinder userFinder) {
551                    this.userFinder = userFinder;
552            }
553    
554            /**
555             * Returns the asset entry local service.
556             *
557             * @return the asset entry local service
558             */
559            public com.liferay.portlet.asset.service.AssetEntryLocalService getAssetEntryLocalService() {
560                    return assetEntryLocalService;
561            }
562    
563            /**
564             * Sets the asset entry local service.
565             *
566             * @param assetEntryLocalService the asset entry local service
567             */
568            public void setAssetEntryLocalService(
569                    com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService) {
570                    this.assetEntryLocalService = assetEntryLocalService;
571            }
572    
573            /**
574             * Returns the asset entry persistence.
575             *
576             * @return the asset entry persistence
577             */
578            public AssetEntryPersistence getAssetEntryPersistence() {
579                    return assetEntryPersistence;
580            }
581    
582            /**
583             * Sets the asset entry persistence.
584             *
585             * @param assetEntryPersistence the asset entry persistence
586             */
587            public void setAssetEntryPersistence(
588                    AssetEntryPersistence assetEntryPersistence) {
589                    this.assetEntryPersistence = assetEntryPersistence;
590            }
591    
592            /**
593             * Returns the asset entry finder.
594             *
595             * @return the asset entry finder
596             */
597            public AssetEntryFinder getAssetEntryFinder() {
598                    return assetEntryFinder;
599            }
600    
601            /**
602             * Sets the asset entry finder.
603             *
604             * @param assetEntryFinder the asset entry finder
605             */
606            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
607                    this.assetEntryFinder = assetEntryFinder;
608            }
609    
610            /**
611             * Returns the social activity limit local service.
612             *
613             * @return the social activity limit local service
614             */
615            public com.liferay.portlet.social.service.SocialActivityLimitLocalService getSocialActivityLimitLocalService() {
616                    return socialActivityLimitLocalService;
617            }
618    
619            /**
620             * Sets the social activity limit local service.
621             *
622             * @param socialActivityLimitLocalService the social activity limit local service
623             */
624            public void setSocialActivityLimitLocalService(
625                    com.liferay.portlet.social.service.SocialActivityLimitLocalService socialActivityLimitLocalService) {
626                    this.socialActivityLimitLocalService = socialActivityLimitLocalService;
627            }
628    
629            /**
630             * Returns the social activity limit persistence.
631             *
632             * @return the social activity limit persistence
633             */
634            public SocialActivityLimitPersistence getSocialActivityLimitPersistence() {
635                    return socialActivityLimitPersistence;
636            }
637    
638            /**
639             * Sets the social activity limit persistence.
640             *
641             * @param socialActivityLimitPersistence the social activity limit persistence
642             */
643            public void setSocialActivityLimitPersistence(
644                    SocialActivityLimitPersistence socialActivityLimitPersistence) {
645                    this.socialActivityLimitPersistence = socialActivityLimitPersistence;
646            }
647    
648            /**
649             * Returns the social activity setting local service.
650             *
651             * @return the social activity setting local service
652             */
653            public com.liferay.portlet.social.service.SocialActivitySettingLocalService getSocialActivitySettingLocalService() {
654                    return socialActivitySettingLocalService;
655            }
656    
657            /**
658             * Sets the social activity setting local service.
659             *
660             * @param socialActivitySettingLocalService the social activity setting local service
661             */
662            public void setSocialActivitySettingLocalService(
663                    com.liferay.portlet.social.service.SocialActivitySettingLocalService socialActivitySettingLocalService) {
664                    this.socialActivitySettingLocalService = socialActivitySettingLocalService;
665            }
666    
667            /**
668             * Returns the social activity setting persistence.
669             *
670             * @return the social activity setting persistence
671             */
672            public SocialActivitySettingPersistence getSocialActivitySettingPersistence() {
673                    return socialActivitySettingPersistence;
674            }
675    
676            /**
677             * Sets the social activity setting persistence.
678             *
679             * @param socialActivitySettingPersistence the social activity setting persistence
680             */
681            public void setSocialActivitySettingPersistence(
682                    SocialActivitySettingPersistence socialActivitySettingPersistence) {
683                    this.socialActivitySettingPersistence = socialActivitySettingPersistence;
684            }
685    
686            public void afterPropertiesSet() {
687                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.social.model.SocialActivityCounter",
688                            socialActivityCounterLocalService);
689            }
690    
691            public void destroy() {
692                    persistedModelLocalServiceRegistry.unregister(
693                            "com.liferay.portlet.social.model.SocialActivityCounter");
694            }
695    
696            /**
697             * Returns the OSGi service identifier.
698             *
699             * @return the OSGi service identifier
700             */
701            @Override
702            public String getOSGiServiceIdentifier() {
703                    return SocialActivityCounterLocalService.class.getName();
704            }
705    
706            protected Class<?> getModelClass() {
707                    return SocialActivityCounter.class;
708            }
709    
710            protected String getModelClassName() {
711                    return SocialActivityCounter.class.getName();
712            }
713    
714            /**
715             * Performs a SQL query.
716             *
717             * @param sql the sql query
718             */
719            protected void runSQL(String sql) {
720                    try {
721                            DataSource dataSource = socialActivityCounterPersistence.getDataSource();
722    
723                            DB db = DBManagerUtil.getDB();
724    
725                            sql = db.buildSQL(sql);
726                            sql = PortalUtil.transformSQL(sql);
727    
728                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
729                                            sql, new int[0]);
730    
731                            sqlUpdate.update();
732                    }
733                    catch (Exception e) {
734                            throw new SystemException(e);
735                    }
736            }
737    
738            @BeanReference(type = com.liferay.portlet.social.service.SocialActivityCounterLocalService.class)
739            protected SocialActivityCounterLocalService socialActivityCounterLocalService;
740            @BeanReference(type = SocialActivityCounterPersistence.class)
741            protected SocialActivityCounterPersistence socialActivityCounterPersistence;
742            @BeanReference(type = SocialActivityCounterFinder.class)
743            protected SocialActivityCounterFinder socialActivityCounterFinder;
744            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
745            protected com.liferay.counter.service.CounterLocalService counterLocalService;
746            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
747            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
748            @BeanReference(type = ClassNamePersistence.class)
749            protected ClassNamePersistence classNamePersistence;
750            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
751            protected com.liferay.portal.service.GroupLocalService groupLocalService;
752            @BeanReference(type = GroupPersistence.class)
753            protected GroupPersistence groupPersistence;
754            @BeanReference(type = GroupFinder.class)
755            protected GroupFinder groupFinder;
756            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
757            protected com.liferay.portal.service.UserLocalService userLocalService;
758            @BeanReference(type = UserPersistence.class)
759            protected UserPersistence userPersistence;
760            @BeanReference(type = UserFinder.class)
761            protected UserFinder userFinder;
762            @BeanReference(type = com.liferay.portlet.asset.service.AssetEntryLocalService.class)
763            protected com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService;
764            @BeanReference(type = AssetEntryPersistence.class)
765            protected AssetEntryPersistence assetEntryPersistence;
766            @BeanReference(type = AssetEntryFinder.class)
767            protected AssetEntryFinder assetEntryFinder;
768            @BeanReference(type = com.liferay.portlet.social.service.SocialActivityLimitLocalService.class)
769            protected com.liferay.portlet.social.service.SocialActivityLimitLocalService socialActivityLimitLocalService;
770            @BeanReference(type = SocialActivityLimitPersistence.class)
771            protected SocialActivityLimitPersistence socialActivityLimitPersistence;
772            @BeanReference(type = com.liferay.portlet.social.service.SocialActivitySettingLocalService.class)
773            protected com.liferay.portlet.social.service.SocialActivitySettingLocalService socialActivitySettingLocalService;
774            @BeanReference(type = SocialActivitySettingPersistence.class)
775            protected SocialActivitySettingPersistence socialActivitySettingPersistence;
776            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
777            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
778    }