001
014
015 package com.liferay.portlet.messageboards.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.GroupLocalService;
034 import com.liferay.portal.service.GroupService;
035 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
036 import com.liferay.portal.service.ResourceLocalService;
037 import com.liferay.portal.service.ResourceService;
038 import com.liferay.portal.service.UserLocalService;
039 import com.liferay.portal.service.UserService;
040 import com.liferay.portal.service.persistence.GroupFinder;
041 import com.liferay.portal.service.persistence.GroupPersistence;
042 import com.liferay.portal.service.persistence.ResourceFinder;
043 import com.liferay.portal.service.persistence.ResourcePersistence;
044 import com.liferay.portal.service.persistence.UserFinder;
045 import com.liferay.portal.service.persistence.UserPersistence;
046
047 import com.liferay.portlet.messageboards.model.MBStatsUser;
048 import com.liferay.portlet.messageboards.service.MBBanLocalService;
049 import com.liferay.portlet.messageboards.service.MBBanService;
050 import com.liferay.portlet.messageboards.service.MBCategoryLocalService;
051 import com.liferay.portlet.messageboards.service.MBCategoryService;
052 import com.liferay.portlet.messageboards.service.MBDiscussionLocalService;
053 import com.liferay.portlet.messageboards.service.MBMailingListLocalService;
054 import com.liferay.portlet.messageboards.service.MBMessageLocalService;
055 import com.liferay.portlet.messageboards.service.MBMessageService;
056 import com.liferay.portlet.messageboards.service.MBStatsUserLocalService;
057 import com.liferay.portlet.messageboards.service.MBThreadFlagLocalService;
058 import com.liferay.portlet.messageboards.service.MBThreadLocalService;
059 import com.liferay.portlet.messageboards.service.MBThreadService;
060 import com.liferay.portlet.messageboards.service.persistence.MBBanPersistence;
061 import com.liferay.portlet.messageboards.service.persistence.MBCategoryFinder;
062 import com.liferay.portlet.messageboards.service.persistence.MBCategoryPersistence;
063 import com.liferay.portlet.messageboards.service.persistence.MBDiscussionPersistence;
064 import com.liferay.portlet.messageboards.service.persistence.MBMailingListPersistence;
065 import com.liferay.portlet.messageboards.service.persistence.MBMessageFinder;
066 import com.liferay.portlet.messageboards.service.persistence.MBMessagePersistence;
067 import com.liferay.portlet.messageboards.service.persistence.MBStatsUserPersistence;
068 import com.liferay.portlet.messageboards.service.persistence.MBThreadFinder;
069 import com.liferay.portlet.messageboards.service.persistence.MBThreadFlagPersistence;
070 import com.liferay.portlet.messageboards.service.persistence.MBThreadPersistence;
071
072 import java.io.Serializable;
073
074 import java.util.List;
075
076 import javax.sql.DataSource;
077
078
090 public abstract class MBStatsUserLocalServiceBaseImpl
091 implements MBStatsUserLocalService, IdentifiableBean {
092
097
098
105 public MBStatsUser addMBStatsUser(MBStatsUser mbStatsUser)
106 throws SystemException {
107 mbStatsUser.setNew(true);
108
109 mbStatsUser = mbStatsUserPersistence.update(mbStatsUser, false);
110
111 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
112
113 if (indexer != null) {
114 try {
115 indexer.reindex(mbStatsUser);
116 }
117 catch (SearchException se) {
118 if (_log.isWarnEnabled()) {
119 _log.warn(se, se);
120 }
121 }
122 }
123
124 return mbStatsUser;
125 }
126
127
133 public MBStatsUser createMBStatsUser(long statsUserId) {
134 return mbStatsUserPersistence.create(statsUserId);
135 }
136
137
144 public void deleteMBStatsUser(long statsUserId)
145 throws PortalException, SystemException {
146 MBStatsUser mbStatsUser = mbStatsUserPersistence.remove(statsUserId);
147
148 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
149
150 if (indexer != null) {
151 try {
152 indexer.delete(mbStatsUser);
153 }
154 catch (SearchException se) {
155 if (_log.isWarnEnabled()) {
156 _log.warn(se, se);
157 }
158 }
159 }
160 }
161
162
168 public void deleteMBStatsUser(MBStatsUser mbStatsUser)
169 throws SystemException {
170 mbStatsUserPersistence.remove(mbStatsUser);
171
172 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
173
174 if (indexer != null) {
175 try {
176 indexer.delete(mbStatsUser);
177 }
178 catch (SearchException se) {
179 if (_log.isWarnEnabled()) {
180 _log.warn(se, se);
181 }
182 }
183 }
184 }
185
186
193 @SuppressWarnings("rawtypes")
194 public List dynamicQuery(DynamicQuery dynamicQuery)
195 throws SystemException {
196 return mbStatsUserPersistence.findWithDynamicQuery(dynamicQuery);
197 }
198
199
212 @SuppressWarnings("rawtypes")
213 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
214 throws SystemException {
215 return mbStatsUserPersistence.findWithDynamicQuery(dynamicQuery, start,
216 end);
217 }
218
219
233 @SuppressWarnings("rawtypes")
234 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
235 OrderByComparator orderByComparator) throws SystemException {
236 return mbStatsUserPersistence.findWithDynamicQuery(dynamicQuery, start,
237 end, orderByComparator);
238 }
239
240
247 public long dynamicQueryCount(DynamicQuery dynamicQuery)
248 throws SystemException {
249 return mbStatsUserPersistence.countWithDynamicQuery(dynamicQuery);
250 }
251
252 public MBStatsUser fetchMBStatsUser(long statsUserId)
253 throws SystemException {
254 return mbStatsUserPersistence.fetchByPrimaryKey(statsUserId);
255 }
256
257
265 public MBStatsUser getMBStatsUser(long statsUserId)
266 throws PortalException, SystemException {
267 return mbStatsUserPersistence.findByPrimaryKey(statsUserId);
268 }
269
270 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
271 throws PortalException, SystemException {
272 return mbStatsUserPersistence.findByPrimaryKey(primaryKeyObj);
273 }
274
275
287 public List<MBStatsUser> getMBStatsUsers(int start, int end)
288 throws SystemException {
289 return mbStatsUserPersistence.findAll(start, end);
290 }
291
292
298 public int getMBStatsUsersCount() throws SystemException {
299 return mbStatsUserPersistence.countAll();
300 }
301
302
309 public MBStatsUser updateMBStatsUser(MBStatsUser mbStatsUser)
310 throws SystemException {
311 return updateMBStatsUser(mbStatsUser, true);
312 }
313
314
322 public MBStatsUser updateMBStatsUser(MBStatsUser mbStatsUser, boolean merge)
323 throws SystemException {
324 mbStatsUser.setNew(false);
325
326 mbStatsUser = mbStatsUserPersistence.update(mbStatsUser, merge);
327
328 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
329
330 if (indexer != null) {
331 try {
332 indexer.reindex(mbStatsUser);
333 }
334 catch (SearchException se) {
335 if (_log.isWarnEnabled()) {
336 _log.warn(se, se);
337 }
338 }
339 }
340
341 return mbStatsUser;
342 }
343
344
349 public MBBanLocalService getMBBanLocalService() {
350 return mbBanLocalService;
351 }
352
353
358 public void setMBBanLocalService(MBBanLocalService mbBanLocalService) {
359 this.mbBanLocalService = mbBanLocalService;
360 }
361
362
367 public MBBanService getMBBanService() {
368 return mbBanService;
369 }
370
371
376 public void setMBBanService(MBBanService mbBanService) {
377 this.mbBanService = mbBanService;
378 }
379
380
385 public MBBanPersistence getMBBanPersistence() {
386 return mbBanPersistence;
387 }
388
389
394 public void setMBBanPersistence(MBBanPersistence mbBanPersistence) {
395 this.mbBanPersistence = mbBanPersistence;
396 }
397
398
403 public MBCategoryLocalService getMBCategoryLocalService() {
404 return mbCategoryLocalService;
405 }
406
407
412 public void setMBCategoryLocalService(
413 MBCategoryLocalService mbCategoryLocalService) {
414 this.mbCategoryLocalService = mbCategoryLocalService;
415 }
416
417
422 public MBCategoryService getMBCategoryService() {
423 return mbCategoryService;
424 }
425
426
431 public void setMBCategoryService(MBCategoryService mbCategoryService) {
432 this.mbCategoryService = mbCategoryService;
433 }
434
435
440 public MBCategoryPersistence getMBCategoryPersistence() {
441 return mbCategoryPersistence;
442 }
443
444
449 public void setMBCategoryPersistence(
450 MBCategoryPersistence mbCategoryPersistence) {
451 this.mbCategoryPersistence = mbCategoryPersistence;
452 }
453
454
459 public MBCategoryFinder getMBCategoryFinder() {
460 return mbCategoryFinder;
461 }
462
463
468 public void setMBCategoryFinder(MBCategoryFinder mbCategoryFinder) {
469 this.mbCategoryFinder = mbCategoryFinder;
470 }
471
472
477 public MBDiscussionLocalService getMBDiscussionLocalService() {
478 return mbDiscussionLocalService;
479 }
480
481
486 public void setMBDiscussionLocalService(
487 MBDiscussionLocalService mbDiscussionLocalService) {
488 this.mbDiscussionLocalService = mbDiscussionLocalService;
489 }
490
491
496 public MBDiscussionPersistence getMBDiscussionPersistence() {
497 return mbDiscussionPersistence;
498 }
499
500
505 public void setMBDiscussionPersistence(
506 MBDiscussionPersistence mbDiscussionPersistence) {
507 this.mbDiscussionPersistence = mbDiscussionPersistence;
508 }
509
510
515 public MBMailingListLocalService getMBMailingListLocalService() {
516 return mbMailingListLocalService;
517 }
518
519
524 public void setMBMailingListLocalService(
525 MBMailingListLocalService mbMailingListLocalService) {
526 this.mbMailingListLocalService = mbMailingListLocalService;
527 }
528
529
534 public MBMailingListPersistence getMBMailingListPersistence() {
535 return mbMailingListPersistence;
536 }
537
538
543 public void setMBMailingListPersistence(
544 MBMailingListPersistence mbMailingListPersistence) {
545 this.mbMailingListPersistence = mbMailingListPersistence;
546 }
547
548
553 public MBMessageLocalService getMBMessageLocalService() {
554 return mbMessageLocalService;
555 }
556
557
562 public void setMBMessageLocalService(
563 MBMessageLocalService mbMessageLocalService) {
564 this.mbMessageLocalService = mbMessageLocalService;
565 }
566
567
572 public MBMessageService getMBMessageService() {
573 return mbMessageService;
574 }
575
576
581 public void setMBMessageService(MBMessageService mbMessageService) {
582 this.mbMessageService = mbMessageService;
583 }
584
585
590 public MBMessagePersistence getMBMessagePersistence() {
591 return mbMessagePersistence;
592 }
593
594
599 public void setMBMessagePersistence(
600 MBMessagePersistence mbMessagePersistence) {
601 this.mbMessagePersistence = mbMessagePersistence;
602 }
603
604
609 public MBMessageFinder getMBMessageFinder() {
610 return mbMessageFinder;
611 }
612
613
618 public void setMBMessageFinder(MBMessageFinder mbMessageFinder) {
619 this.mbMessageFinder = mbMessageFinder;
620 }
621
622
627 public MBStatsUserLocalService getMBStatsUserLocalService() {
628 return mbStatsUserLocalService;
629 }
630
631
636 public void setMBStatsUserLocalService(
637 MBStatsUserLocalService mbStatsUserLocalService) {
638 this.mbStatsUserLocalService = mbStatsUserLocalService;
639 }
640
641
646 public MBStatsUserPersistence getMBStatsUserPersistence() {
647 return mbStatsUserPersistence;
648 }
649
650
655 public void setMBStatsUserPersistence(
656 MBStatsUserPersistence mbStatsUserPersistence) {
657 this.mbStatsUserPersistence = mbStatsUserPersistence;
658 }
659
660
665 public MBThreadLocalService getMBThreadLocalService() {
666 return mbThreadLocalService;
667 }
668
669
674 public void setMBThreadLocalService(
675 MBThreadLocalService mbThreadLocalService) {
676 this.mbThreadLocalService = mbThreadLocalService;
677 }
678
679
684 public MBThreadService getMBThreadService() {
685 return mbThreadService;
686 }
687
688
693 public void setMBThreadService(MBThreadService mbThreadService) {
694 this.mbThreadService = mbThreadService;
695 }
696
697
702 public MBThreadPersistence getMBThreadPersistence() {
703 return mbThreadPersistence;
704 }
705
706
711 public void setMBThreadPersistence(MBThreadPersistence mbThreadPersistence) {
712 this.mbThreadPersistence = mbThreadPersistence;
713 }
714
715
720 public MBThreadFinder getMBThreadFinder() {
721 return mbThreadFinder;
722 }
723
724
729 public void setMBThreadFinder(MBThreadFinder mbThreadFinder) {
730 this.mbThreadFinder = mbThreadFinder;
731 }
732
733
738 public MBThreadFlagLocalService getMBThreadFlagLocalService() {
739 return mbThreadFlagLocalService;
740 }
741
742
747 public void setMBThreadFlagLocalService(
748 MBThreadFlagLocalService mbThreadFlagLocalService) {
749 this.mbThreadFlagLocalService = mbThreadFlagLocalService;
750 }
751
752
757 public MBThreadFlagPersistence getMBThreadFlagPersistence() {
758 return mbThreadFlagPersistence;
759 }
760
761
766 public void setMBThreadFlagPersistence(
767 MBThreadFlagPersistence mbThreadFlagPersistence) {
768 this.mbThreadFlagPersistence = mbThreadFlagPersistence;
769 }
770
771
776 public CounterLocalService getCounterLocalService() {
777 return counterLocalService;
778 }
779
780
785 public void setCounterLocalService(CounterLocalService counterLocalService) {
786 this.counterLocalService = counterLocalService;
787 }
788
789
794 public GroupLocalService getGroupLocalService() {
795 return groupLocalService;
796 }
797
798
803 public void setGroupLocalService(GroupLocalService groupLocalService) {
804 this.groupLocalService = groupLocalService;
805 }
806
807
812 public GroupService getGroupService() {
813 return groupService;
814 }
815
816
821 public void setGroupService(GroupService groupService) {
822 this.groupService = groupService;
823 }
824
825
830 public GroupPersistence getGroupPersistence() {
831 return groupPersistence;
832 }
833
834
839 public void setGroupPersistence(GroupPersistence groupPersistence) {
840 this.groupPersistence = groupPersistence;
841 }
842
843
848 public GroupFinder getGroupFinder() {
849 return groupFinder;
850 }
851
852
857 public void setGroupFinder(GroupFinder groupFinder) {
858 this.groupFinder = groupFinder;
859 }
860
861
866 public ResourceLocalService getResourceLocalService() {
867 return resourceLocalService;
868 }
869
870
875 public void setResourceLocalService(
876 ResourceLocalService resourceLocalService) {
877 this.resourceLocalService = resourceLocalService;
878 }
879
880
885 public ResourceService getResourceService() {
886 return resourceService;
887 }
888
889
894 public void setResourceService(ResourceService resourceService) {
895 this.resourceService = resourceService;
896 }
897
898
903 public ResourcePersistence getResourcePersistence() {
904 return resourcePersistence;
905 }
906
907
912 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
913 this.resourcePersistence = resourcePersistence;
914 }
915
916
921 public ResourceFinder getResourceFinder() {
922 return resourceFinder;
923 }
924
925
930 public void setResourceFinder(ResourceFinder resourceFinder) {
931 this.resourceFinder = resourceFinder;
932 }
933
934
939 public UserLocalService getUserLocalService() {
940 return userLocalService;
941 }
942
943
948 public void setUserLocalService(UserLocalService userLocalService) {
949 this.userLocalService = userLocalService;
950 }
951
952
957 public UserService getUserService() {
958 return userService;
959 }
960
961
966 public void setUserService(UserService userService) {
967 this.userService = userService;
968 }
969
970
975 public UserPersistence getUserPersistence() {
976 return userPersistence;
977 }
978
979
984 public void setUserPersistence(UserPersistence userPersistence) {
985 this.userPersistence = userPersistence;
986 }
987
988
993 public UserFinder getUserFinder() {
994 return userFinder;
995 }
996
997
1002 public void setUserFinder(UserFinder userFinder) {
1003 this.userFinder = userFinder;
1004 }
1005
1006 public void afterPropertiesSet() {
1007 persistedModelLocalServiceRegistry.register("com.liferay.portlet.messageboards.model.MBStatsUser",
1008 mbStatsUserLocalService);
1009 }
1010
1011 public void destroy() {
1012 persistedModelLocalServiceRegistry.unregister(
1013 "com.liferay.portlet.messageboards.model.MBStatsUser");
1014 }
1015
1016
1021 public String getBeanIdentifier() {
1022 return _beanIdentifier;
1023 }
1024
1025
1030 public void setBeanIdentifier(String beanIdentifier) {
1031 _beanIdentifier = beanIdentifier;
1032 }
1033
1034 protected ClassLoader getClassLoader() {
1035 Class<?> clazz = getClass();
1036
1037 return clazz.getClassLoader();
1038 }
1039
1040 protected Class<?> getModelClass() {
1041 return MBStatsUser.class;
1042 }
1043
1044 protected String getModelClassName() {
1045 return MBStatsUser.class.getName();
1046 }
1047
1048
1053 protected void runSQL(String sql) throws SystemException {
1054 try {
1055 DataSource dataSource = mbStatsUserPersistence.getDataSource();
1056
1057 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1058 sql, new int[0]);
1059
1060 sqlUpdate.update();
1061 }
1062 catch (Exception e) {
1063 throw new SystemException(e);
1064 }
1065 }
1066
1067 @BeanReference(type = MBBanLocalService.class)
1068 protected MBBanLocalService mbBanLocalService;
1069 @BeanReference(type = MBBanService.class)
1070 protected MBBanService mbBanService;
1071 @BeanReference(type = MBBanPersistence.class)
1072 protected MBBanPersistence mbBanPersistence;
1073 @BeanReference(type = MBCategoryLocalService.class)
1074 protected MBCategoryLocalService mbCategoryLocalService;
1075 @BeanReference(type = MBCategoryService.class)
1076 protected MBCategoryService mbCategoryService;
1077 @BeanReference(type = MBCategoryPersistence.class)
1078 protected MBCategoryPersistence mbCategoryPersistence;
1079 @BeanReference(type = MBCategoryFinder.class)
1080 protected MBCategoryFinder mbCategoryFinder;
1081 @BeanReference(type = MBDiscussionLocalService.class)
1082 protected MBDiscussionLocalService mbDiscussionLocalService;
1083 @BeanReference(type = MBDiscussionPersistence.class)
1084 protected MBDiscussionPersistence mbDiscussionPersistence;
1085 @BeanReference(type = MBMailingListLocalService.class)
1086 protected MBMailingListLocalService mbMailingListLocalService;
1087 @BeanReference(type = MBMailingListPersistence.class)
1088 protected MBMailingListPersistence mbMailingListPersistence;
1089 @BeanReference(type = MBMessageLocalService.class)
1090 protected MBMessageLocalService mbMessageLocalService;
1091 @BeanReference(type = MBMessageService.class)
1092 protected MBMessageService mbMessageService;
1093 @BeanReference(type = MBMessagePersistence.class)
1094 protected MBMessagePersistence mbMessagePersistence;
1095 @BeanReference(type = MBMessageFinder.class)
1096 protected MBMessageFinder mbMessageFinder;
1097 @BeanReference(type = MBStatsUserLocalService.class)
1098 protected MBStatsUserLocalService mbStatsUserLocalService;
1099 @BeanReference(type = MBStatsUserPersistence.class)
1100 protected MBStatsUserPersistence mbStatsUserPersistence;
1101 @BeanReference(type = MBThreadLocalService.class)
1102 protected MBThreadLocalService mbThreadLocalService;
1103 @BeanReference(type = MBThreadService.class)
1104 protected MBThreadService mbThreadService;
1105 @BeanReference(type = MBThreadPersistence.class)
1106 protected MBThreadPersistence mbThreadPersistence;
1107 @BeanReference(type = MBThreadFinder.class)
1108 protected MBThreadFinder mbThreadFinder;
1109 @BeanReference(type = MBThreadFlagLocalService.class)
1110 protected MBThreadFlagLocalService mbThreadFlagLocalService;
1111 @BeanReference(type = MBThreadFlagPersistence.class)
1112 protected MBThreadFlagPersistence mbThreadFlagPersistence;
1113 @BeanReference(type = CounterLocalService.class)
1114 protected CounterLocalService counterLocalService;
1115 @BeanReference(type = GroupLocalService.class)
1116 protected GroupLocalService groupLocalService;
1117 @BeanReference(type = GroupService.class)
1118 protected GroupService groupService;
1119 @BeanReference(type = GroupPersistence.class)
1120 protected GroupPersistence groupPersistence;
1121 @BeanReference(type = GroupFinder.class)
1122 protected GroupFinder groupFinder;
1123 @BeanReference(type = ResourceLocalService.class)
1124 protected ResourceLocalService resourceLocalService;
1125 @BeanReference(type = ResourceService.class)
1126 protected ResourceService resourceService;
1127 @BeanReference(type = ResourcePersistence.class)
1128 protected ResourcePersistence resourcePersistence;
1129 @BeanReference(type = ResourceFinder.class)
1130 protected ResourceFinder resourceFinder;
1131 @BeanReference(type = UserLocalService.class)
1132 protected UserLocalService userLocalService;
1133 @BeanReference(type = UserService.class)
1134 protected UserService userService;
1135 @BeanReference(type = UserPersistence.class)
1136 protected UserPersistence userPersistence;
1137 @BeanReference(type = UserFinder.class)
1138 protected UserFinder userFinder;
1139 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1140 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1141 private static Log _log = LogFactoryUtil.getLog(MBStatsUserLocalServiceBaseImpl.class);
1142 private String _beanIdentifier;
1143 }