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