001
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.dao.orm.DynamicQueryFactoryUtil;
025 import com.liferay.portal.kernel.exception.PortalException;
026 import com.liferay.portal.kernel.exception.SystemException;
027 import com.liferay.portal.kernel.search.Indexable;
028 import com.liferay.portal.kernel.search.IndexableType;
029 import com.liferay.portal.kernel.util.OrderByComparator;
030 import com.liferay.portal.model.PersistedModel;
031 import com.liferay.portal.service.BaseLocalServiceImpl;
032 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
033 import com.liferay.portal.service.ResourceLocalService;
034 import com.liferay.portal.service.ResourceService;
035 import com.liferay.portal.service.UserLocalService;
036 import com.liferay.portal.service.UserService;
037 import com.liferay.portal.service.persistence.ResourceFinder;
038 import com.liferay.portal.service.persistence.ResourcePersistence;
039 import com.liferay.portal.service.persistence.UserFinder;
040 import com.liferay.portal.service.persistence.UserPersistence;
041
042 import com.liferay.portlet.social.model.SocialRelation;
043 import com.liferay.portlet.social.service.SocialActivityAchievementLocalService;
044 import com.liferay.portlet.social.service.SocialActivityCounterLocalService;
045 import com.liferay.portlet.social.service.SocialActivityInterpreterLocalService;
046 import com.liferay.portlet.social.service.SocialActivityLimitLocalService;
047 import com.liferay.portlet.social.service.SocialActivityLocalService;
048 import com.liferay.portlet.social.service.SocialActivitySettingLocalService;
049 import com.liferay.portlet.social.service.SocialActivitySettingService;
050 import com.liferay.portlet.social.service.SocialRelationLocalService;
051 import com.liferay.portlet.social.service.SocialRequestInterpreterLocalService;
052 import com.liferay.portlet.social.service.SocialRequestLocalService;
053 import com.liferay.portlet.social.service.persistence.SocialActivityAchievementPersistence;
054 import com.liferay.portlet.social.service.persistence.SocialActivityCounterFinder;
055 import com.liferay.portlet.social.service.persistence.SocialActivityCounterPersistence;
056 import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
057 import com.liferay.portlet.social.service.persistence.SocialActivityLimitPersistence;
058 import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
059 import com.liferay.portlet.social.service.persistence.SocialActivitySettingPersistence;
060 import com.liferay.portlet.social.service.persistence.SocialRelationPersistence;
061 import com.liferay.portlet.social.service.persistence.SocialRequestPersistence;
062
063 import java.io.Serializable;
064
065 import java.util.List;
066
067 import javax.sql.DataSource;
068
069
081 public abstract class SocialRelationLocalServiceBaseImpl
082 extends BaseLocalServiceImpl implements SocialRelationLocalService,
083 IdentifiableBean {
084
089
090
097 @Indexable(type = IndexableType.REINDEX)
098 public SocialRelation addSocialRelation(SocialRelation socialRelation)
099 throws SystemException {
100 socialRelation.setNew(true);
101
102 return socialRelationPersistence.update(socialRelation, false);
103 }
104
105
111 public SocialRelation createSocialRelation(long relationId) {
112 return socialRelationPersistence.create(relationId);
113 }
114
115
123 @Indexable(type = IndexableType.DELETE)
124 public SocialRelation deleteSocialRelation(long relationId)
125 throws PortalException, SystemException {
126 return socialRelationPersistence.remove(relationId);
127 }
128
129
136 @Indexable(type = IndexableType.DELETE)
137 public SocialRelation deleteSocialRelation(SocialRelation socialRelation)
138 throws SystemException {
139 return socialRelationPersistence.remove(socialRelation);
140 }
141
142 public DynamicQuery dynamicQuery() {
143 Class<?> clazz = getClass();
144
145 return DynamicQueryFactoryUtil.forClass(SocialRelation.class,
146 clazz.getClassLoader());
147 }
148
149
156 @SuppressWarnings("rawtypes")
157 public List dynamicQuery(DynamicQuery dynamicQuery)
158 throws SystemException {
159 return socialRelationPersistence.findWithDynamicQuery(dynamicQuery);
160 }
161
162
175 @SuppressWarnings("rawtypes")
176 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
177 throws SystemException {
178 return socialRelationPersistence.findWithDynamicQuery(dynamicQuery,
179 start, end);
180 }
181
182
196 @SuppressWarnings("rawtypes")
197 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
198 OrderByComparator orderByComparator) throws SystemException {
199 return socialRelationPersistence.findWithDynamicQuery(dynamicQuery,
200 start, end, orderByComparator);
201 }
202
203
210 public long dynamicQueryCount(DynamicQuery dynamicQuery)
211 throws SystemException {
212 return socialRelationPersistence.countWithDynamicQuery(dynamicQuery);
213 }
214
215 public SocialRelation fetchSocialRelation(long relationId)
216 throws SystemException {
217 return socialRelationPersistence.fetchByPrimaryKey(relationId);
218 }
219
220
228 public SocialRelation getSocialRelation(long relationId)
229 throws PortalException, SystemException {
230 return socialRelationPersistence.findByPrimaryKey(relationId);
231 }
232
233 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
234 throws PortalException, SystemException {
235 return socialRelationPersistence.findByPrimaryKey(primaryKeyObj);
236 }
237
238
250 public List<SocialRelation> getSocialRelations(int start, int end)
251 throws SystemException {
252 return socialRelationPersistence.findAll(start, end);
253 }
254
255
261 public int getSocialRelationsCount() throws SystemException {
262 return socialRelationPersistence.countAll();
263 }
264
265
272 @Indexable(type = IndexableType.REINDEX)
273 public SocialRelation updateSocialRelation(SocialRelation socialRelation)
274 throws SystemException {
275 return updateSocialRelation(socialRelation, true);
276 }
277
278
286 @Indexable(type = IndexableType.REINDEX)
287 public SocialRelation updateSocialRelation(SocialRelation socialRelation,
288 boolean merge) throws SystemException {
289 socialRelation.setNew(false);
290
291 return socialRelationPersistence.update(socialRelation, merge);
292 }
293
294
299 public SocialActivityLocalService getSocialActivityLocalService() {
300 return socialActivityLocalService;
301 }
302
303
308 public void setSocialActivityLocalService(
309 SocialActivityLocalService socialActivityLocalService) {
310 this.socialActivityLocalService = socialActivityLocalService;
311 }
312
313
318 public SocialActivityPersistence getSocialActivityPersistence() {
319 return socialActivityPersistence;
320 }
321
322
327 public void setSocialActivityPersistence(
328 SocialActivityPersistence socialActivityPersistence) {
329 this.socialActivityPersistence = socialActivityPersistence;
330 }
331
332
337 public SocialActivityFinder getSocialActivityFinder() {
338 return socialActivityFinder;
339 }
340
341
346 public void setSocialActivityFinder(
347 SocialActivityFinder socialActivityFinder) {
348 this.socialActivityFinder = socialActivityFinder;
349 }
350
351
356 public SocialActivityAchievementLocalService getSocialActivityAchievementLocalService() {
357 return socialActivityAchievementLocalService;
358 }
359
360
365 public void setSocialActivityAchievementLocalService(
366 SocialActivityAchievementLocalService socialActivityAchievementLocalService) {
367 this.socialActivityAchievementLocalService = socialActivityAchievementLocalService;
368 }
369
370
375 public SocialActivityAchievementPersistence getSocialActivityAchievementPersistence() {
376 return socialActivityAchievementPersistence;
377 }
378
379
384 public void setSocialActivityAchievementPersistence(
385 SocialActivityAchievementPersistence socialActivityAchievementPersistence) {
386 this.socialActivityAchievementPersistence = socialActivityAchievementPersistence;
387 }
388
389
394 public SocialActivityCounterLocalService getSocialActivityCounterLocalService() {
395 return socialActivityCounterLocalService;
396 }
397
398
403 public void setSocialActivityCounterLocalService(
404 SocialActivityCounterLocalService socialActivityCounterLocalService) {
405 this.socialActivityCounterLocalService = socialActivityCounterLocalService;
406 }
407
408
413 public SocialActivityCounterPersistence getSocialActivityCounterPersistence() {
414 return socialActivityCounterPersistence;
415 }
416
417
422 public void setSocialActivityCounterPersistence(
423 SocialActivityCounterPersistence socialActivityCounterPersistence) {
424 this.socialActivityCounterPersistence = socialActivityCounterPersistence;
425 }
426
427
432 public SocialActivityCounterFinder getSocialActivityCounterFinder() {
433 return socialActivityCounterFinder;
434 }
435
436
441 public void setSocialActivityCounterFinder(
442 SocialActivityCounterFinder socialActivityCounterFinder) {
443 this.socialActivityCounterFinder = socialActivityCounterFinder;
444 }
445
446
451 public SocialActivityInterpreterLocalService getSocialActivityInterpreterLocalService() {
452 return socialActivityInterpreterLocalService;
453 }
454
455
460 public void setSocialActivityInterpreterLocalService(
461 SocialActivityInterpreterLocalService socialActivityInterpreterLocalService) {
462 this.socialActivityInterpreterLocalService = socialActivityInterpreterLocalService;
463 }
464
465
470 public SocialActivityLimitLocalService getSocialActivityLimitLocalService() {
471 return socialActivityLimitLocalService;
472 }
473
474
479 public void setSocialActivityLimitLocalService(
480 SocialActivityLimitLocalService socialActivityLimitLocalService) {
481 this.socialActivityLimitLocalService = socialActivityLimitLocalService;
482 }
483
484
489 public SocialActivityLimitPersistence getSocialActivityLimitPersistence() {
490 return socialActivityLimitPersistence;
491 }
492
493
498 public void setSocialActivityLimitPersistence(
499 SocialActivityLimitPersistence socialActivityLimitPersistence) {
500 this.socialActivityLimitPersistence = socialActivityLimitPersistence;
501 }
502
503
508 public SocialActivitySettingLocalService getSocialActivitySettingLocalService() {
509 return socialActivitySettingLocalService;
510 }
511
512
517 public void setSocialActivitySettingLocalService(
518 SocialActivitySettingLocalService socialActivitySettingLocalService) {
519 this.socialActivitySettingLocalService = socialActivitySettingLocalService;
520 }
521
522
527 public SocialActivitySettingService getSocialActivitySettingService() {
528 return socialActivitySettingService;
529 }
530
531
536 public void setSocialActivitySettingService(
537 SocialActivitySettingService socialActivitySettingService) {
538 this.socialActivitySettingService = socialActivitySettingService;
539 }
540
541
546 public SocialActivitySettingPersistence getSocialActivitySettingPersistence() {
547 return socialActivitySettingPersistence;
548 }
549
550
555 public void setSocialActivitySettingPersistence(
556 SocialActivitySettingPersistence socialActivitySettingPersistence) {
557 this.socialActivitySettingPersistence = socialActivitySettingPersistence;
558 }
559
560
565 public SocialRelationLocalService getSocialRelationLocalService() {
566 return socialRelationLocalService;
567 }
568
569
574 public void setSocialRelationLocalService(
575 SocialRelationLocalService socialRelationLocalService) {
576 this.socialRelationLocalService = socialRelationLocalService;
577 }
578
579
584 public SocialRelationPersistence getSocialRelationPersistence() {
585 return socialRelationPersistence;
586 }
587
588
593 public void setSocialRelationPersistence(
594 SocialRelationPersistence socialRelationPersistence) {
595 this.socialRelationPersistence = socialRelationPersistence;
596 }
597
598
603 public SocialRequestLocalService getSocialRequestLocalService() {
604 return socialRequestLocalService;
605 }
606
607
612 public void setSocialRequestLocalService(
613 SocialRequestLocalService socialRequestLocalService) {
614 this.socialRequestLocalService = socialRequestLocalService;
615 }
616
617
622 public SocialRequestPersistence getSocialRequestPersistence() {
623 return socialRequestPersistence;
624 }
625
626
631 public void setSocialRequestPersistence(
632 SocialRequestPersistence socialRequestPersistence) {
633 this.socialRequestPersistence = socialRequestPersistence;
634 }
635
636
641 public SocialRequestInterpreterLocalService getSocialRequestInterpreterLocalService() {
642 return socialRequestInterpreterLocalService;
643 }
644
645
650 public void setSocialRequestInterpreterLocalService(
651 SocialRequestInterpreterLocalService socialRequestInterpreterLocalService) {
652 this.socialRequestInterpreterLocalService = socialRequestInterpreterLocalService;
653 }
654
655
660 public CounterLocalService getCounterLocalService() {
661 return counterLocalService;
662 }
663
664
669 public void setCounterLocalService(CounterLocalService counterLocalService) {
670 this.counterLocalService = counterLocalService;
671 }
672
673
678 public ResourceLocalService getResourceLocalService() {
679 return resourceLocalService;
680 }
681
682
687 public void setResourceLocalService(
688 ResourceLocalService resourceLocalService) {
689 this.resourceLocalService = resourceLocalService;
690 }
691
692
697 public ResourceService getResourceService() {
698 return resourceService;
699 }
700
701
706 public void setResourceService(ResourceService resourceService) {
707 this.resourceService = resourceService;
708 }
709
710
715 public ResourcePersistence getResourcePersistence() {
716 return resourcePersistence;
717 }
718
719
724 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
725 this.resourcePersistence = resourcePersistence;
726 }
727
728
733 public ResourceFinder getResourceFinder() {
734 return resourceFinder;
735 }
736
737
742 public void setResourceFinder(ResourceFinder resourceFinder) {
743 this.resourceFinder = resourceFinder;
744 }
745
746
751 public UserLocalService getUserLocalService() {
752 return userLocalService;
753 }
754
755
760 public void setUserLocalService(UserLocalService userLocalService) {
761 this.userLocalService = userLocalService;
762 }
763
764
769 public UserService getUserService() {
770 return userService;
771 }
772
773
778 public void setUserService(UserService userService) {
779 this.userService = userService;
780 }
781
782
787 public UserPersistence getUserPersistence() {
788 return userPersistence;
789 }
790
791
796 public void setUserPersistence(UserPersistence userPersistence) {
797 this.userPersistence = userPersistence;
798 }
799
800
805 public UserFinder getUserFinder() {
806 return userFinder;
807 }
808
809
814 public void setUserFinder(UserFinder userFinder) {
815 this.userFinder = userFinder;
816 }
817
818 public void afterPropertiesSet() {
819 persistedModelLocalServiceRegistry.register("com.liferay.portlet.social.model.SocialRelation",
820 socialRelationLocalService);
821 }
822
823 public void destroy() {
824 persistedModelLocalServiceRegistry.unregister(
825 "com.liferay.portlet.social.model.SocialRelation");
826 }
827
828
833 public String getBeanIdentifier() {
834 return _beanIdentifier;
835 }
836
837
842 public void setBeanIdentifier(String beanIdentifier) {
843 _beanIdentifier = beanIdentifier;
844 }
845
846 protected Class<?> getModelClass() {
847 return SocialRelation.class;
848 }
849
850 protected String getModelClassName() {
851 return SocialRelation.class.getName();
852 }
853
854
859 protected void runSQL(String sql) throws SystemException {
860 try {
861 DataSource dataSource = socialRelationPersistence.getDataSource();
862
863 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
864 sql, new int[0]);
865
866 sqlUpdate.update();
867 }
868 catch (Exception e) {
869 throw new SystemException(e);
870 }
871 }
872
873 @BeanReference(type = SocialActivityLocalService.class)
874 protected SocialActivityLocalService socialActivityLocalService;
875 @BeanReference(type = SocialActivityPersistence.class)
876 protected SocialActivityPersistence socialActivityPersistence;
877 @BeanReference(type = SocialActivityFinder.class)
878 protected SocialActivityFinder socialActivityFinder;
879 @BeanReference(type = SocialActivityAchievementLocalService.class)
880 protected SocialActivityAchievementLocalService socialActivityAchievementLocalService;
881 @BeanReference(type = SocialActivityAchievementPersistence.class)
882 protected SocialActivityAchievementPersistence socialActivityAchievementPersistence;
883 @BeanReference(type = SocialActivityCounterLocalService.class)
884 protected SocialActivityCounterLocalService socialActivityCounterLocalService;
885 @BeanReference(type = SocialActivityCounterPersistence.class)
886 protected SocialActivityCounterPersistence socialActivityCounterPersistence;
887 @BeanReference(type = SocialActivityCounterFinder.class)
888 protected SocialActivityCounterFinder socialActivityCounterFinder;
889 @BeanReference(type = SocialActivityInterpreterLocalService.class)
890 protected SocialActivityInterpreterLocalService socialActivityInterpreterLocalService;
891 @BeanReference(type = SocialActivityLimitLocalService.class)
892 protected SocialActivityLimitLocalService socialActivityLimitLocalService;
893 @BeanReference(type = SocialActivityLimitPersistence.class)
894 protected SocialActivityLimitPersistence socialActivityLimitPersistence;
895 @BeanReference(type = SocialActivitySettingLocalService.class)
896 protected SocialActivitySettingLocalService socialActivitySettingLocalService;
897 @BeanReference(type = SocialActivitySettingService.class)
898 protected SocialActivitySettingService socialActivitySettingService;
899 @BeanReference(type = SocialActivitySettingPersistence.class)
900 protected SocialActivitySettingPersistence socialActivitySettingPersistence;
901 @BeanReference(type = SocialRelationLocalService.class)
902 protected SocialRelationLocalService socialRelationLocalService;
903 @BeanReference(type = SocialRelationPersistence.class)
904 protected SocialRelationPersistence socialRelationPersistence;
905 @BeanReference(type = SocialRequestLocalService.class)
906 protected SocialRequestLocalService socialRequestLocalService;
907 @BeanReference(type = SocialRequestPersistence.class)
908 protected SocialRequestPersistence socialRequestPersistence;
909 @BeanReference(type = SocialRequestInterpreterLocalService.class)
910 protected SocialRequestInterpreterLocalService socialRequestInterpreterLocalService;
911 @BeanReference(type = CounterLocalService.class)
912 protected CounterLocalService counterLocalService;
913 @BeanReference(type = ResourceLocalService.class)
914 protected ResourceLocalService resourceLocalService;
915 @BeanReference(type = ResourceService.class)
916 protected ResourceService resourceService;
917 @BeanReference(type = ResourcePersistence.class)
918 protected ResourcePersistence resourcePersistence;
919 @BeanReference(type = ResourceFinder.class)
920 protected ResourceFinder resourceFinder;
921 @BeanReference(type = UserLocalService.class)
922 protected UserLocalService userLocalService;
923 @BeanReference(type = UserService.class)
924 protected UserService userService;
925 @BeanReference(type = UserPersistence.class)
926 protected UserPersistence userPersistence;
927 @BeanReference(type = UserFinder.class)
928 protected UserFinder userFinder;
929 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
930 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
931 private String _beanIdentifier;
932 }