001    /**
002     * Copyright (c) 2000-2012 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 com.liferay.counter.service.CounterLocalService;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.bean.IdentifiableBean;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
024    import com.liferay.portal.kernel.exception.PortalException;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.log.Log;
027    import com.liferay.portal.kernel.log.LogFactoryUtil;
028    import com.liferay.portal.kernel.search.Indexer;
029    import com.liferay.portal.kernel.search.IndexerRegistryUtil;
030    import com.liferay.portal.kernel.search.SearchException;
031    import com.liferay.portal.kernel.util.OrderByComparator;
032    import com.liferay.portal.model.PersistedModel;
033    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
034    import com.liferay.portal.service.ResourceLocalService;
035    import com.liferay.portal.service.ResourceService;
036    import com.liferay.portal.service.UserLocalService;
037    import com.liferay.portal.service.UserService;
038    import com.liferay.portal.service.persistence.ResourceFinder;
039    import com.liferay.portal.service.persistence.ResourcePersistence;
040    import com.liferay.portal.service.persistence.UserFinder;
041    import com.liferay.portal.service.persistence.UserPersistence;
042    
043    import com.liferay.portlet.social.model.SocialRelation;
044    import com.liferay.portlet.social.service.SocialActivityAchievementLocalService;
045    import com.liferay.portlet.social.service.SocialActivityCounterLocalService;
046    import com.liferay.portlet.social.service.SocialActivityInterpreterLocalService;
047    import com.liferay.portlet.social.service.SocialActivityLimitLocalService;
048    import com.liferay.portlet.social.service.SocialActivityLocalService;
049    import com.liferay.portlet.social.service.SocialActivitySettingLocalService;
050    import com.liferay.portlet.social.service.SocialActivitySettingService;
051    import com.liferay.portlet.social.service.SocialRelationLocalService;
052    import com.liferay.portlet.social.service.SocialRequestInterpreterLocalService;
053    import com.liferay.portlet.social.service.SocialRequestLocalService;
054    import com.liferay.portlet.social.service.persistence.SocialActivityAchievementPersistence;
055    import com.liferay.portlet.social.service.persistence.SocialActivityCounterFinder;
056    import com.liferay.portlet.social.service.persistence.SocialActivityCounterPersistence;
057    import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
058    import com.liferay.portlet.social.service.persistence.SocialActivityLimitPersistence;
059    import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
060    import com.liferay.portlet.social.service.persistence.SocialActivitySettingPersistence;
061    import com.liferay.portlet.social.service.persistence.SocialRelationPersistence;
062    import com.liferay.portlet.social.service.persistence.SocialRequestPersistence;
063    
064    import java.io.Serializable;
065    
066    import java.util.List;
067    
068    import javax.sql.DataSource;
069    
070    /**
071     * The base implementation of the social relation local service.
072     *
073     * <p>
074     * 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.SocialRelationLocalServiceImpl}.
075     * </p>
076     *
077     * @author Brian Wing Shun Chan
078     * @see com.liferay.portlet.social.service.impl.SocialRelationLocalServiceImpl
079     * @see com.liferay.portlet.social.service.SocialRelationLocalServiceUtil
080     * @generated
081     */
082    public abstract class SocialRelationLocalServiceBaseImpl
083            implements SocialRelationLocalService, IdentifiableBean {
084            /*
085             * NOTE FOR DEVELOPERS:
086             *
087             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.social.service.SocialRelationLocalServiceUtil} to access the social relation local service.
088             */
089    
090            /**
091             * Adds the social relation to the database. Also notifies the appropriate model listeners.
092             *
093             * @param socialRelation the social relation
094             * @return the social relation that was added
095             * @throws SystemException if a system exception occurred
096             */
097            public SocialRelation addSocialRelation(SocialRelation socialRelation)
098                    throws SystemException {
099                    socialRelation.setNew(true);
100    
101                    socialRelation = socialRelationPersistence.update(socialRelation, false);
102    
103                    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
104    
105                    if (indexer != null) {
106                            try {
107                                    indexer.reindex(socialRelation);
108                            }
109                            catch (SearchException se) {
110                                    if (_log.isWarnEnabled()) {
111                                            _log.warn(se, se);
112                                    }
113                            }
114                    }
115    
116                    return socialRelation;
117            }
118    
119            /**
120             * Creates a new social relation with the primary key. Does not add the social relation to the database.
121             *
122             * @param relationId the primary key for the new social relation
123             * @return the new social relation
124             */
125            public SocialRelation createSocialRelation(long relationId) {
126                    return socialRelationPersistence.create(relationId);
127            }
128    
129            /**
130             * Deletes the social relation with the primary key from the database. Also notifies the appropriate model listeners.
131             *
132             * @param relationId the primary key of the social relation
133             * @throws PortalException if a social relation with the primary key could not be found
134             * @throws SystemException if a system exception occurred
135             */
136            public void deleteSocialRelation(long relationId)
137                    throws PortalException, SystemException {
138                    SocialRelation socialRelation = socialRelationPersistence.remove(relationId);
139    
140                    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
141    
142                    if (indexer != null) {
143                            try {
144                                    indexer.delete(socialRelation);
145                            }
146                            catch (SearchException se) {
147                                    if (_log.isWarnEnabled()) {
148                                            _log.warn(se, se);
149                                    }
150                            }
151                    }
152            }
153    
154            /**
155             * Deletes the social relation from the database. Also notifies the appropriate model listeners.
156             *
157             * @param socialRelation the social relation
158             * @throws SystemException if a system exception occurred
159             */
160            public void deleteSocialRelation(SocialRelation socialRelation)
161                    throws SystemException {
162                    socialRelationPersistence.remove(socialRelation);
163    
164                    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
165    
166                    if (indexer != null) {
167                            try {
168                                    indexer.delete(socialRelation);
169                            }
170                            catch (SearchException se) {
171                                    if (_log.isWarnEnabled()) {
172                                            _log.warn(se, se);
173                                    }
174                            }
175                    }
176            }
177    
178            /**
179             * Performs a dynamic query on the database and returns the matching rows.
180             *
181             * @param dynamicQuery the dynamic query
182             * @return the matching rows
183             * @throws SystemException if a system exception occurred
184             */
185            @SuppressWarnings("rawtypes")
186            public List dynamicQuery(DynamicQuery dynamicQuery)
187                    throws SystemException {
188                    return socialRelationPersistence.findWithDynamicQuery(dynamicQuery);
189            }
190    
191            /**
192             * Performs a dynamic query on the database and returns a range of the matching rows.
193             *
194             * <p>
195             * 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.
196             * </p>
197             *
198             * @param dynamicQuery the dynamic query
199             * @param start the lower bound of the range of model instances
200             * @param end the upper bound of the range of model instances (not inclusive)
201             * @return the range of matching rows
202             * @throws SystemException if a system exception occurred
203             */
204            @SuppressWarnings("rawtypes")
205            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
206                    throws SystemException {
207                    return socialRelationPersistence.findWithDynamicQuery(dynamicQuery,
208                            start, end);
209            }
210    
211            /**
212             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
213             *
214             * <p>
215             * 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.
216             * </p>
217             *
218             * @param dynamicQuery the dynamic query
219             * @param start the lower bound of the range of model instances
220             * @param end the upper bound of the range of model instances (not inclusive)
221             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
222             * @return the ordered range of matching rows
223             * @throws SystemException if a system exception occurred
224             */
225            @SuppressWarnings("rawtypes")
226            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
227                    OrderByComparator orderByComparator) throws SystemException {
228                    return socialRelationPersistence.findWithDynamicQuery(dynamicQuery,
229                            start, end, orderByComparator);
230            }
231    
232            /**
233             * Returns the number of rows that match the dynamic query.
234             *
235             * @param dynamicQuery the dynamic query
236             * @return the number of rows that match the dynamic query
237             * @throws SystemException if a system exception occurred
238             */
239            public long dynamicQueryCount(DynamicQuery dynamicQuery)
240                    throws SystemException {
241                    return socialRelationPersistence.countWithDynamicQuery(dynamicQuery);
242            }
243    
244            public SocialRelation fetchSocialRelation(long relationId)
245                    throws SystemException {
246                    return socialRelationPersistence.fetchByPrimaryKey(relationId);
247            }
248    
249            /**
250             * Returns the social relation with the primary key.
251             *
252             * @param relationId the primary key of the social relation
253             * @return the social relation
254             * @throws PortalException if a social relation with the primary key could not be found
255             * @throws SystemException if a system exception occurred
256             */
257            public SocialRelation getSocialRelation(long relationId)
258                    throws PortalException, SystemException {
259                    return socialRelationPersistence.findByPrimaryKey(relationId);
260            }
261    
262            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
263                    throws PortalException, SystemException {
264                    return socialRelationPersistence.findByPrimaryKey(primaryKeyObj);
265            }
266    
267            /**
268             * Returns a range of all the social relations.
269             *
270             * <p>
271             * 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.
272             * </p>
273             *
274             * @param start the lower bound of the range of social relations
275             * @param end the upper bound of the range of social relations (not inclusive)
276             * @return the range of social relations
277             * @throws SystemException if a system exception occurred
278             */
279            public List<SocialRelation> getSocialRelations(int start, int end)
280                    throws SystemException {
281                    return socialRelationPersistence.findAll(start, end);
282            }
283    
284            /**
285             * Returns the number of social relations.
286             *
287             * @return the number of social relations
288             * @throws SystemException if a system exception occurred
289             */
290            public int getSocialRelationsCount() throws SystemException {
291                    return socialRelationPersistence.countAll();
292            }
293    
294            /**
295             * Updates the social relation in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
296             *
297             * @param socialRelation the social relation
298             * @return the social relation that was updated
299             * @throws SystemException if a system exception occurred
300             */
301            public SocialRelation updateSocialRelation(SocialRelation socialRelation)
302                    throws SystemException {
303                    return updateSocialRelation(socialRelation, true);
304            }
305    
306            /**
307             * Updates the social relation in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
308             *
309             * @param socialRelation the social relation
310             * @param merge whether to merge the social relation with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
311             * @return the social relation that was updated
312             * @throws SystemException if a system exception occurred
313             */
314            public SocialRelation updateSocialRelation(SocialRelation socialRelation,
315                    boolean merge) throws SystemException {
316                    socialRelation.setNew(false);
317    
318                    socialRelation = socialRelationPersistence.update(socialRelation, merge);
319    
320                    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
321    
322                    if (indexer != null) {
323                            try {
324                                    indexer.reindex(socialRelation);
325                            }
326                            catch (SearchException se) {
327                                    if (_log.isWarnEnabled()) {
328                                            _log.warn(se, se);
329                                    }
330                            }
331                    }
332    
333                    return socialRelation;
334            }
335    
336            /**
337             * Returns the social activity local service.
338             *
339             * @return the social activity local service
340             */
341            public SocialActivityLocalService getSocialActivityLocalService() {
342                    return socialActivityLocalService;
343            }
344    
345            /**
346             * Sets the social activity local service.
347             *
348             * @param socialActivityLocalService the social activity local service
349             */
350            public void setSocialActivityLocalService(
351                    SocialActivityLocalService socialActivityLocalService) {
352                    this.socialActivityLocalService = socialActivityLocalService;
353            }
354    
355            /**
356             * Returns the social activity persistence.
357             *
358             * @return the social activity persistence
359             */
360            public SocialActivityPersistence getSocialActivityPersistence() {
361                    return socialActivityPersistence;
362            }
363    
364            /**
365             * Sets the social activity persistence.
366             *
367             * @param socialActivityPersistence the social activity persistence
368             */
369            public void setSocialActivityPersistence(
370                    SocialActivityPersistence socialActivityPersistence) {
371                    this.socialActivityPersistence = socialActivityPersistence;
372            }
373    
374            /**
375             * Returns the social activity finder.
376             *
377             * @return the social activity finder
378             */
379            public SocialActivityFinder getSocialActivityFinder() {
380                    return socialActivityFinder;
381            }
382    
383            /**
384             * Sets the social activity finder.
385             *
386             * @param socialActivityFinder the social activity finder
387             */
388            public void setSocialActivityFinder(
389                    SocialActivityFinder socialActivityFinder) {
390                    this.socialActivityFinder = socialActivityFinder;
391            }
392    
393            /**
394             * Returns the social activity achievement local service.
395             *
396             * @return the social activity achievement local service
397             */
398            public SocialActivityAchievementLocalService getSocialActivityAchievementLocalService() {
399                    return socialActivityAchievementLocalService;
400            }
401    
402            /**
403             * Sets the social activity achievement local service.
404             *
405             * @param socialActivityAchievementLocalService the social activity achievement local service
406             */
407            public void setSocialActivityAchievementLocalService(
408                    SocialActivityAchievementLocalService socialActivityAchievementLocalService) {
409                    this.socialActivityAchievementLocalService = socialActivityAchievementLocalService;
410            }
411    
412            /**
413             * Returns the social activity achievement persistence.
414             *
415             * @return the social activity achievement persistence
416             */
417            public SocialActivityAchievementPersistence getSocialActivityAchievementPersistence() {
418                    return socialActivityAchievementPersistence;
419            }
420    
421            /**
422             * Sets the social activity achievement persistence.
423             *
424             * @param socialActivityAchievementPersistence the social activity achievement persistence
425             */
426            public void setSocialActivityAchievementPersistence(
427                    SocialActivityAchievementPersistence socialActivityAchievementPersistence) {
428                    this.socialActivityAchievementPersistence = socialActivityAchievementPersistence;
429            }
430    
431            /**
432             * Returns the social activity counter local service.
433             *
434             * @return the social activity counter local service
435             */
436            public SocialActivityCounterLocalService getSocialActivityCounterLocalService() {
437                    return socialActivityCounterLocalService;
438            }
439    
440            /**
441             * Sets the social activity counter local service.
442             *
443             * @param socialActivityCounterLocalService the social activity counter local service
444             */
445            public void setSocialActivityCounterLocalService(
446                    SocialActivityCounterLocalService socialActivityCounterLocalService) {
447                    this.socialActivityCounterLocalService = socialActivityCounterLocalService;
448            }
449    
450            /**
451             * Returns the social activity counter persistence.
452             *
453             * @return the social activity counter persistence
454             */
455            public SocialActivityCounterPersistence getSocialActivityCounterPersistence() {
456                    return socialActivityCounterPersistence;
457            }
458    
459            /**
460             * Sets the social activity counter persistence.
461             *
462             * @param socialActivityCounterPersistence the social activity counter persistence
463             */
464            public void setSocialActivityCounterPersistence(
465                    SocialActivityCounterPersistence socialActivityCounterPersistence) {
466                    this.socialActivityCounterPersistence = socialActivityCounterPersistence;
467            }
468    
469            /**
470             * Returns the social activity counter finder.
471             *
472             * @return the social activity counter finder
473             */
474            public SocialActivityCounterFinder getSocialActivityCounterFinder() {
475                    return socialActivityCounterFinder;
476            }
477    
478            /**
479             * Sets the social activity counter finder.
480             *
481             * @param socialActivityCounterFinder the social activity counter finder
482             */
483            public void setSocialActivityCounterFinder(
484                    SocialActivityCounterFinder socialActivityCounterFinder) {
485                    this.socialActivityCounterFinder = socialActivityCounterFinder;
486            }
487    
488            /**
489             * Returns the social activity interpreter local service.
490             *
491             * @return the social activity interpreter local service
492             */
493            public SocialActivityInterpreterLocalService getSocialActivityInterpreterLocalService() {
494                    return socialActivityInterpreterLocalService;
495            }
496    
497            /**
498             * Sets the social activity interpreter local service.
499             *
500             * @param socialActivityInterpreterLocalService the social activity interpreter local service
501             */
502            public void setSocialActivityInterpreterLocalService(
503                    SocialActivityInterpreterLocalService socialActivityInterpreterLocalService) {
504                    this.socialActivityInterpreterLocalService = socialActivityInterpreterLocalService;
505            }
506    
507            /**
508             * Returns the social activity limit local service.
509             *
510             * @return the social activity limit local service
511             */
512            public SocialActivityLimitLocalService getSocialActivityLimitLocalService() {
513                    return socialActivityLimitLocalService;
514            }
515    
516            /**
517             * Sets the social activity limit local service.
518             *
519             * @param socialActivityLimitLocalService the social activity limit local service
520             */
521            public void setSocialActivityLimitLocalService(
522                    SocialActivityLimitLocalService socialActivityLimitLocalService) {
523                    this.socialActivityLimitLocalService = socialActivityLimitLocalService;
524            }
525    
526            /**
527             * Returns the social activity limit persistence.
528             *
529             * @return the social activity limit persistence
530             */
531            public SocialActivityLimitPersistence getSocialActivityLimitPersistence() {
532                    return socialActivityLimitPersistence;
533            }
534    
535            /**
536             * Sets the social activity limit persistence.
537             *
538             * @param socialActivityLimitPersistence the social activity limit persistence
539             */
540            public void setSocialActivityLimitPersistence(
541                    SocialActivityLimitPersistence socialActivityLimitPersistence) {
542                    this.socialActivityLimitPersistence = socialActivityLimitPersistence;
543            }
544    
545            /**
546             * Returns the social activity setting local service.
547             *
548             * @return the social activity setting local service
549             */
550            public SocialActivitySettingLocalService getSocialActivitySettingLocalService() {
551                    return socialActivitySettingLocalService;
552            }
553    
554            /**
555             * Sets the social activity setting local service.
556             *
557             * @param socialActivitySettingLocalService the social activity setting local service
558             */
559            public void setSocialActivitySettingLocalService(
560                    SocialActivitySettingLocalService socialActivitySettingLocalService) {
561                    this.socialActivitySettingLocalService = socialActivitySettingLocalService;
562            }
563    
564            /**
565             * Returns the social activity setting remote service.
566             *
567             * @return the social activity setting remote service
568             */
569            public SocialActivitySettingService getSocialActivitySettingService() {
570                    return socialActivitySettingService;
571            }
572    
573            /**
574             * Sets the social activity setting remote service.
575             *
576             * @param socialActivitySettingService the social activity setting remote service
577             */
578            public void setSocialActivitySettingService(
579                    SocialActivitySettingService socialActivitySettingService) {
580                    this.socialActivitySettingService = socialActivitySettingService;
581            }
582    
583            /**
584             * Returns the social activity setting persistence.
585             *
586             * @return the social activity setting persistence
587             */
588            public SocialActivitySettingPersistence getSocialActivitySettingPersistence() {
589                    return socialActivitySettingPersistence;
590            }
591    
592            /**
593             * Sets the social activity setting persistence.
594             *
595             * @param socialActivitySettingPersistence the social activity setting persistence
596             */
597            public void setSocialActivitySettingPersistence(
598                    SocialActivitySettingPersistence socialActivitySettingPersistence) {
599                    this.socialActivitySettingPersistence = socialActivitySettingPersistence;
600            }
601    
602            /**
603             * Returns the social relation local service.
604             *
605             * @return the social relation local service
606             */
607            public SocialRelationLocalService getSocialRelationLocalService() {
608                    return socialRelationLocalService;
609            }
610    
611            /**
612             * Sets the social relation local service.
613             *
614             * @param socialRelationLocalService the social relation local service
615             */
616            public void setSocialRelationLocalService(
617                    SocialRelationLocalService socialRelationLocalService) {
618                    this.socialRelationLocalService = socialRelationLocalService;
619            }
620    
621            /**
622             * Returns the social relation persistence.
623             *
624             * @return the social relation persistence
625             */
626            public SocialRelationPersistence getSocialRelationPersistence() {
627                    return socialRelationPersistence;
628            }
629    
630            /**
631             * Sets the social relation persistence.
632             *
633             * @param socialRelationPersistence the social relation persistence
634             */
635            public void setSocialRelationPersistence(
636                    SocialRelationPersistence socialRelationPersistence) {
637                    this.socialRelationPersistence = socialRelationPersistence;
638            }
639    
640            /**
641             * Returns the social request local service.
642             *
643             * @return the social request local service
644             */
645            public SocialRequestLocalService getSocialRequestLocalService() {
646                    return socialRequestLocalService;
647            }
648    
649            /**
650             * Sets the social request local service.
651             *
652             * @param socialRequestLocalService the social request local service
653             */
654            public void setSocialRequestLocalService(
655                    SocialRequestLocalService socialRequestLocalService) {
656                    this.socialRequestLocalService = socialRequestLocalService;
657            }
658    
659            /**
660             * Returns the social request persistence.
661             *
662             * @return the social request persistence
663             */
664            public SocialRequestPersistence getSocialRequestPersistence() {
665                    return socialRequestPersistence;
666            }
667    
668            /**
669             * Sets the social request persistence.
670             *
671             * @param socialRequestPersistence the social request persistence
672             */
673            public void setSocialRequestPersistence(
674                    SocialRequestPersistence socialRequestPersistence) {
675                    this.socialRequestPersistence = socialRequestPersistence;
676            }
677    
678            /**
679             * Returns the social request interpreter local service.
680             *
681             * @return the social request interpreter local service
682             */
683            public SocialRequestInterpreterLocalService getSocialRequestInterpreterLocalService() {
684                    return socialRequestInterpreterLocalService;
685            }
686    
687            /**
688             * Sets the social request interpreter local service.
689             *
690             * @param socialRequestInterpreterLocalService the social request interpreter local service
691             */
692            public void setSocialRequestInterpreterLocalService(
693                    SocialRequestInterpreterLocalService socialRequestInterpreterLocalService) {
694                    this.socialRequestInterpreterLocalService = socialRequestInterpreterLocalService;
695            }
696    
697            /**
698             * Returns the counter local service.
699             *
700             * @return the counter local service
701             */
702            public CounterLocalService getCounterLocalService() {
703                    return counterLocalService;
704            }
705    
706            /**
707             * Sets the counter local service.
708             *
709             * @param counterLocalService the counter local service
710             */
711            public void setCounterLocalService(CounterLocalService counterLocalService) {
712                    this.counterLocalService = counterLocalService;
713            }
714    
715            /**
716             * Returns the resource local service.
717             *
718             * @return the resource local service
719             */
720            public ResourceLocalService getResourceLocalService() {
721                    return resourceLocalService;
722            }
723    
724            /**
725             * Sets the resource local service.
726             *
727             * @param resourceLocalService the resource local service
728             */
729            public void setResourceLocalService(
730                    ResourceLocalService resourceLocalService) {
731                    this.resourceLocalService = resourceLocalService;
732            }
733    
734            /**
735             * Returns the resource remote service.
736             *
737             * @return the resource remote service
738             */
739            public ResourceService getResourceService() {
740                    return resourceService;
741            }
742    
743            /**
744             * Sets the resource remote service.
745             *
746             * @param resourceService the resource remote service
747             */
748            public void setResourceService(ResourceService resourceService) {
749                    this.resourceService = resourceService;
750            }
751    
752            /**
753             * Returns the resource persistence.
754             *
755             * @return the resource persistence
756             */
757            public ResourcePersistence getResourcePersistence() {
758                    return resourcePersistence;
759            }
760    
761            /**
762             * Sets the resource persistence.
763             *
764             * @param resourcePersistence the resource persistence
765             */
766            public void setResourcePersistence(ResourcePersistence resourcePersistence) {
767                    this.resourcePersistence = resourcePersistence;
768            }
769    
770            /**
771             * Returns the resource finder.
772             *
773             * @return the resource finder
774             */
775            public ResourceFinder getResourceFinder() {
776                    return resourceFinder;
777            }
778    
779            /**
780             * Sets the resource finder.
781             *
782             * @param resourceFinder the resource finder
783             */
784            public void setResourceFinder(ResourceFinder resourceFinder) {
785                    this.resourceFinder = resourceFinder;
786            }
787    
788            /**
789             * Returns the user local service.
790             *
791             * @return the user local service
792             */
793            public UserLocalService getUserLocalService() {
794                    return userLocalService;
795            }
796    
797            /**
798             * Sets the user local service.
799             *
800             * @param userLocalService the user local service
801             */
802            public void setUserLocalService(UserLocalService userLocalService) {
803                    this.userLocalService = userLocalService;
804            }
805    
806            /**
807             * Returns the user remote service.
808             *
809             * @return the user remote service
810             */
811            public UserService getUserService() {
812                    return userService;
813            }
814    
815            /**
816             * Sets the user remote service.
817             *
818             * @param userService the user remote service
819             */
820            public void setUserService(UserService userService) {
821                    this.userService = userService;
822            }
823    
824            /**
825             * Returns the user persistence.
826             *
827             * @return the user persistence
828             */
829            public UserPersistence getUserPersistence() {
830                    return userPersistence;
831            }
832    
833            /**
834             * Sets the user persistence.
835             *
836             * @param userPersistence the user persistence
837             */
838            public void setUserPersistence(UserPersistence userPersistence) {
839                    this.userPersistence = userPersistence;
840            }
841    
842            /**
843             * Returns the user finder.
844             *
845             * @return the user finder
846             */
847            public UserFinder getUserFinder() {
848                    return userFinder;
849            }
850    
851            /**
852             * Sets the user finder.
853             *
854             * @param userFinder the user finder
855             */
856            public void setUserFinder(UserFinder userFinder) {
857                    this.userFinder = userFinder;
858            }
859    
860            public void afterPropertiesSet() {
861                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.social.model.SocialRelation",
862                            socialRelationLocalService);
863            }
864    
865            public void destroy() {
866                    persistedModelLocalServiceRegistry.unregister(
867                            "com.liferay.portlet.social.model.SocialRelation");
868            }
869    
870            /**
871             * Returns the Spring bean ID for this bean.
872             *
873             * @return the Spring bean ID for this bean
874             */
875            public String getBeanIdentifier() {
876                    return _beanIdentifier;
877            }
878    
879            /**
880             * Sets the Spring bean ID for this bean.
881             *
882             * @param beanIdentifier the Spring bean ID for this bean
883             */
884            public void setBeanIdentifier(String beanIdentifier) {
885                    _beanIdentifier = beanIdentifier;
886            }
887    
888            protected ClassLoader getClassLoader() {
889                    Class<?> clazz = getClass();
890    
891                    return clazz.getClassLoader();
892            }
893    
894            protected Class<?> getModelClass() {
895                    return SocialRelation.class;
896            }
897    
898            protected String getModelClassName() {
899                    return SocialRelation.class.getName();
900            }
901    
902            /**
903             * Performs an SQL query.
904             *
905             * @param sql the sql query
906             */
907            protected void runSQL(String sql) throws SystemException {
908                    try {
909                            DataSource dataSource = socialRelationPersistence.getDataSource();
910    
911                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
912                                            sql, new int[0]);
913    
914                            sqlUpdate.update();
915                    }
916                    catch (Exception e) {
917                            throw new SystemException(e);
918                    }
919            }
920    
921            @BeanReference(type = SocialActivityLocalService.class)
922            protected SocialActivityLocalService socialActivityLocalService;
923            @BeanReference(type = SocialActivityPersistence.class)
924            protected SocialActivityPersistence socialActivityPersistence;
925            @BeanReference(type = SocialActivityFinder.class)
926            protected SocialActivityFinder socialActivityFinder;
927            @BeanReference(type = SocialActivityAchievementLocalService.class)
928            protected SocialActivityAchievementLocalService socialActivityAchievementLocalService;
929            @BeanReference(type = SocialActivityAchievementPersistence.class)
930            protected SocialActivityAchievementPersistence socialActivityAchievementPersistence;
931            @BeanReference(type = SocialActivityCounterLocalService.class)
932            protected SocialActivityCounterLocalService socialActivityCounterLocalService;
933            @BeanReference(type = SocialActivityCounterPersistence.class)
934            protected SocialActivityCounterPersistence socialActivityCounterPersistence;
935            @BeanReference(type = SocialActivityCounterFinder.class)
936            protected SocialActivityCounterFinder socialActivityCounterFinder;
937            @BeanReference(type = SocialActivityInterpreterLocalService.class)
938            protected SocialActivityInterpreterLocalService socialActivityInterpreterLocalService;
939            @BeanReference(type = SocialActivityLimitLocalService.class)
940            protected SocialActivityLimitLocalService socialActivityLimitLocalService;
941            @BeanReference(type = SocialActivityLimitPersistence.class)
942            protected SocialActivityLimitPersistence socialActivityLimitPersistence;
943            @BeanReference(type = SocialActivitySettingLocalService.class)
944            protected SocialActivitySettingLocalService socialActivitySettingLocalService;
945            @BeanReference(type = SocialActivitySettingService.class)
946            protected SocialActivitySettingService socialActivitySettingService;
947            @BeanReference(type = SocialActivitySettingPersistence.class)
948            protected SocialActivitySettingPersistence socialActivitySettingPersistence;
949            @BeanReference(type = SocialRelationLocalService.class)
950            protected SocialRelationLocalService socialRelationLocalService;
951            @BeanReference(type = SocialRelationPersistence.class)
952            protected SocialRelationPersistence socialRelationPersistence;
953            @BeanReference(type = SocialRequestLocalService.class)
954            protected SocialRequestLocalService socialRequestLocalService;
955            @BeanReference(type = SocialRequestPersistence.class)
956            protected SocialRequestPersistence socialRequestPersistence;
957            @BeanReference(type = SocialRequestInterpreterLocalService.class)
958            protected SocialRequestInterpreterLocalService socialRequestInterpreterLocalService;
959            @BeanReference(type = CounterLocalService.class)
960            protected CounterLocalService counterLocalService;
961            @BeanReference(type = ResourceLocalService.class)
962            protected ResourceLocalService resourceLocalService;
963            @BeanReference(type = ResourceService.class)
964            protected ResourceService resourceService;
965            @BeanReference(type = ResourcePersistence.class)
966            protected ResourcePersistence resourcePersistence;
967            @BeanReference(type = ResourceFinder.class)
968            protected ResourceFinder resourceFinder;
969            @BeanReference(type = UserLocalService.class)
970            protected UserLocalService userLocalService;
971            @BeanReference(type = UserService.class)
972            protected UserService userService;
973            @BeanReference(type = UserPersistence.class)
974            protected UserPersistence userPersistence;
975            @BeanReference(type = UserFinder.class)
976            protected UserFinder userFinder;
977            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
978            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
979            private static Log _log = LogFactoryUtil.getLog(SocialRelationLocalServiceBaseImpl.class);
980            private String _beanIdentifier;
981    }