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.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.messageboards.model.MBDiscussion;
043 import com.liferay.portlet.messageboards.service.MBBanLocalService;
044 import com.liferay.portlet.messageboards.service.MBBanService;
045 import com.liferay.portlet.messageboards.service.MBCategoryLocalService;
046 import com.liferay.portlet.messageboards.service.MBCategoryService;
047 import com.liferay.portlet.messageboards.service.MBDiscussionLocalService;
048 import com.liferay.portlet.messageboards.service.MBMailingListLocalService;
049 import com.liferay.portlet.messageboards.service.MBMessageLocalService;
050 import com.liferay.portlet.messageboards.service.MBMessageService;
051 import com.liferay.portlet.messageboards.service.MBStatsUserLocalService;
052 import com.liferay.portlet.messageboards.service.MBThreadFlagLocalService;
053 import com.liferay.portlet.messageboards.service.MBThreadLocalService;
054 import com.liferay.portlet.messageboards.service.MBThreadService;
055 import com.liferay.portlet.messageboards.service.persistence.MBBanPersistence;
056 import com.liferay.portlet.messageboards.service.persistence.MBCategoryFinder;
057 import com.liferay.portlet.messageboards.service.persistence.MBCategoryPersistence;
058 import com.liferay.portlet.messageboards.service.persistence.MBDiscussionPersistence;
059 import com.liferay.portlet.messageboards.service.persistence.MBMailingListPersistence;
060 import com.liferay.portlet.messageboards.service.persistence.MBMessageFinder;
061 import com.liferay.portlet.messageboards.service.persistence.MBMessagePersistence;
062 import com.liferay.portlet.messageboards.service.persistence.MBStatsUserPersistence;
063 import com.liferay.portlet.messageboards.service.persistence.MBThreadFinder;
064 import com.liferay.portlet.messageboards.service.persistence.MBThreadFlagPersistence;
065 import com.liferay.portlet.messageboards.service.persistence.MBThreadPersistence;
066
067 import java.io.Serializable;
068
069 import java.util.List;
070
071 import javax.sql.DataSource;
072
073
085 public abstract class MBDiscussionLocalServiceBaseImpl
086 extends BaseLocalServiceImpl implements MBDiscussionLocalService,
087 IdentifiableBean {
088
093
094
101 @Indexable(type = IndexableType.REINDEX)
102 public MBDiscussion addMBDiscussion(MBDiscussion mbDiscussion)
103 throws SystemException {
104 mbDiscussion.setNew(true);
105
106 return mbDiscussionPersistence.update(mbDiscussion, false);
107 }
108
109
115 public MBDiscussion createMBDiscussion(long discussionId) {
116 return mbDiscussionPersistence.create(discussionId);
117 }
118
119
127 @Indexable(type = IndexableType.DELETE)
128 public MBDiscussion deleteMBDiscussion(long discussionId)
129 throws PortalException, SystemException {
130 return mbDiscussionPersistence.remove(discussionId);
131 }
132
133
140 @Indexable(type = IndexableType.DELETE)
141 public MBDiscussion deleteMBDiscussion(MBDiscussion mbDiscussion)
142 throws SystemException {
143 return mbDiscussionPersistence.remove(mbDiscussion);
144 }
145
146 public DynamicQuery dynamicQuery() {
147 Class<?> clazz = getClass();
148
149 return DynamicQueryFactoryUtil.forClass(MBDiscussion.class,
150 clazz.getClassLoader());
151 }
152
153
160 @SuppressWarnings("rawtypes")
161 public List dynamicQuery(DynamicQuery dynamicQuery)
162 throws SystemException {
163 return mbDiscussionPersistence.findWithDynamicQuery(dynamicQuery);
164 }
165
166
179 @SuppressWarnings("rawtypes")
180 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
181 throws SystemException {
182 return mbDiscussionPersistence.findWithDynamicQuery(dynamicQuery,
183 start, end);
184 }
185
186
200 @SuppressWarnings("rawtypes")
201 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
202 OrderByComparator orderByComparator) throws SystemException {
203 return mbDiscussionPersistence.findWithDynamicQuery(dynamicQuery,
204 start, end, orderByComparator);
205 }
206
207
214 public long dynamicQueryCount(DynamicQuery dynamicQuery)
215 throws SystemException {
216 return mbDiscussionPersistence.countWithDynamicQuery(dynamicQuery);
217 }
218
219 public MBDiscussion fetchMBDiscussion(long discussionId)
220 throws SystemException {
221 return mbDiscussionPersistence.fetchByPrimaryKey(discussionId);
222 }
223
224
232 public MBDiscussion getMBDiscussion(long discussionId)
233 throws PortalException, SystemException {
234 return mbDiscussionPersistence.findByPrimaryKey(discussionId);
235 }
236
237 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
238 throws PortalException, SystemException {
239 return mbDiscussionPersistence.findByPrimaryKey(primaryKeyObj);
240 }
241
242
254 public List<MBDiscussion> getMBDiscussions(int start, int end)
255 throws SystemException {
256 return mbDiscussionPersistence.findAll(start, end);
257 }
258
259
265 public int getMBDiscussionsCount() throws SystemException {
266 return mbDiscussionPersistence.countAll();
267 }
268
269
276 @Indexable(type = IndexableType.REINDEX)
277 public MBDiscussion updateMBDiscussion(MBDiscussion mbDiscussion)
278 throws SystemException {
279 return updateMBDiscussion(mbDiscussion, true);
280 }
281
282
290 @Indexable(type = IndexableType.REINDEX)
291 public MBDiscussion updateMBDiscussion(MBDiscussion mbDiscussion,
292 boolean merge) throws SystemException {
293 mbDiscussion.setNew(false);
294
295 return mbDiscussionPersistence.update(mbDiscussion, merge);
296 }
297
298
303 public MBBanLocalService getMBBanLocalService() {
304 return mbBanLocalService;
305 }
306
307
312 public void setMBBanLocalService(MBBanLocalService mbBanLocalService) {
313 this.mbBanLocalService = mbBanLocalService;
314 }
315
316
321 public MBBanService getMBBanService() {
322 return mbBanService;
323 }
324
325
330 public void setMBBanService(MBBanService mbBanService) {
331 this.mbBanService = mbBanService;
332 }
333
334
339 public MBBanPersistence getMBBanPersistence() {
340 return mbBanPersistence;
341 }
342
343
348 public void setMBBanPersistence(MBBanPersistence mbBanPersistence) {
349 this.mbBanPersistence = mbBanPersistence;
350 }
351
352
357 public MBCategoryLocalService getMBCategoryLocalService() {
358 return mbCategoryLocalService;
359 }
360
361
366 public void setMBCategoryLocalService(
367 MBCategoryLocalService mbCategoryLocalService) {
368 this.mbCategoryLocalService = mbCategoryLocalService;
369 }
370
371
376 public MBCategoryService getMBCategoryService() {
377 return mbCategoryService;
378 }
379
380
385 public void setMBCategoryService(MBCategoryService mbCategoryService) {
386 this.mbCategoryService = mbCategoryService;
387 }
388
389
394 public MBCategoryPersistence getMBCategoryPersistence() {
395 return mbCategoryPersistence;
396 }
397
398
403 public void setMBCategoryPersistence(
404 MBCategoryPersistence mbCategoryPersistence) {
405 this.mbCategoryPersistence = mbCategoryPersistence;
406 }
407
408
413 public MBCategoryFinder getMBCategoryFinder() {
414 return mbCategoryFinder;
415 }
416
417
422 public void setMBCategoryFinder(MBCategoryFinder mbCategoryFinder) {
423 this.mbCategoryFinder = mbCategoryFinder;
424 }
425
426
431 public MBDiscussionLocalService getMBDiscussionLocalService() {
432 return mbDiscussionLocalService;
433 }
434
435
440 public void setMBDiscussionLocalService(
441 MBDiscussionLocalService mbDiscussionLocalService) {
442 this.mbDiscussionLocalService = mbDiscussionLocalService;
443 }
444
445
450 public MBDiscussionPersistence getMBDiscussionPersistence() {
451 return mbDiscussionPersistence;
452 }
453
454
459 public void setMBDiscussionPersistence(
460 MBDiscussionPersistence mbDiscussionPersistence) {
461 this.mbDiscussionPersistence = mbDiscussionPersistence;
462 }
463
464
469 public MBMailingListLocalService getMBMailingListLocalService() {
470 return mbMailingListLocalService;
471 }
472
473
478 public void setMBMailingListLocalService(
479 MBMailingListLocalService mbMailingListLocalService) {
480 this.mbMailingListLocalService = mbMailingListLocalService;
481 }
482
483
488 public MBMailingListPersistence getMBMailingListPersistence() {
489 return mbMailingListPersistence;
490 }
491
492
497 public void setMBMailingListPersistence(
498 MBMailingListPersistence mbMailingListPersistence) {
499 this.mbMailingListPersistence = mbMailingListPersistence;
500 }
501
502
507 public MBMessageLocalService getMBMessageLocalService() {
508 return mbMessageLocalService;
509 }
510
511
516 public void setMBMessageLocalService(
517 MBMessageLocalService mbMessageLocalService) {
518 this.mbMessageLocalService = mbMessageLocalService;
519 }
520
521
526 public MBMessageService getMBMessageService() {
527 return mbMessageService;
528 }
529
530
535 public void setMBMessageService(MBMessageService mbMessageService) {
536 this.mbMessageService = mbMessageService;
537 }
538
539
544 public MBMessagePersistence getMBMessagePersistence() {
545 return mbMessagePersistence;
546 }
547
548
553 public void setMBMessagePersistence(
554 MBMessagePersistence mbMessagePersistence) {
555 this.mbMessagePersistence = mbMessagePersistence;
556 }
557
558
563 public MBMessageFinder getMBMessageFinder() {
564 return mbMessageFinder;
565 }
566
567
572 public void setMBMessageFinder(MBMessageFinder mbMessageFinder) {
573 this.mbMessageFinder = mbMessageFinder;
574 }
575
576
581 public MBStatsUserLocalService getMBStatsUserLocalService() {
582 return mbStatsUserLocalService;
583 }
584
585
590 public void setMBStatsUserLocalService(
591 MBStatsUserLocalService mbStatsUserLocalService) {
592 this.mbStatsUserLocalService = mbStatsUserLocalService;
593 }
594
595
600 public MBStatsUserPersistence getMBStatsUserPersistence() {
601 return mbStatsUserPersistence;
602 }
603
604
609 public void setMBStatsUserPersistence(
610 MBStatsUserPersistence mbStatsUserPersistence) {
611 this.mbStatsUserPersistence = mbStatsUserPersistence;
612 }
613
614
619 public MBThreadLocalService getMBThreadLocalService() {
620 return mbThreadLocalService;
621 }
622
623
628 public void setMBThreadLocalService(
629 MBThreadLocalService mbThreadLocalService) {
630 this.mbThreadLocalService = mbThreadLocalService;
631 }
632
633
638 public MBThreadService getMBThreadService() {
639 return mbThreadService;
640 }
641
642
647 public void setMBThreadService(MBThreadService mbThreadService) {
648 this.mbThreadService = mbThreadService;
649 }
650
651
656 public MBThreadPersistence getMBThreadPersistence() {
657 return mbThreadPersistence;
658 }
659
660
665 public void setMBThreadPersistence(MBThreadPersistence mbThreadPersistence) {
666 this.mbThreadPersistence = mbThreadPersistence;
667 }
668
669
674 public MBThreadFinder getMBThreadFinder() {
675 return mbThreadFinder;
676 }
677
678
683 public void setMBThreadFinder(MBThreadFinder mbThreadFinder) {
684 this.mbThreadFinder = mbThreadFinder;
685 }
686
687
692 public MBThreadFlagLocalService getMBThreadFlagLocalService() {
693 return mbThreadFlagLocalService;
694 }
695
696
701 public void setMBThreadFlagLocalService(
702 MBThreadFlagLocalService mbThreadFlagLocalService) {
703 this.mbThreadFlagLocalService = mbThreadFlagLocalService;
704 }
705
706
711 public MBThreadFlagPersistence getMBThreadFlagPersistence() {
712 return mbThreadFlagPersistence;
713 }
714
715
720 public void setMBThreadFlagPersistence(
721 MBThreadFlagPersistence mbThreadFlagPersistence) {
722 this.mbThreadFlagPersistence = mbThreadFlagPersistence;
723 }
724
725
730 public CounterLocalService getCounterLocalService() {
731 return counterLocalService;
732 }
733
734
739 public void setCounterLocalService(CounterLocalService counterLocalService) {
740 this.counterLocalService = counterLocalService;
741 }
742
743
748 public ResourceLocalService getResourceLocalService() {
749 return resourceLocalService;
750 }
751
752
757 public void setResourceLocalService(
758 ResourceLocalService resourceLocalService) {
759 this.resourceLocalService = resourceLocalService;
760 }
761
762
767 public ResourceService getResourceService() {
768 return resourceService;
769 }
770
771
776 public void setResourceService(ResourceService resourceService) {
777 this.resourceService = resourceService;
778 }
779
780
785 public ResourcePersistence getResourcePersistence() {
786 return resourcePersistence;
787 }
788
789
794 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
795 this.resourcePersistence = resourcePersistence;
796 }
797
798
803 public ResourceFinder getResourceFinder() {
804 return resourceFinder;
805 }
806
807
812 public void setResourceFinder(ResourceFinder resourceFinder) {
813 this.resourceFinder = resourceFinder;
814 }
815
816
821 public UserLocalService getUserLocalService() {
822 return userLocalService;
823 }
824
825
830 public void setUserLocalService(UserLocalService userLocalService) {
831 this.userLocalService = userLocalService;
832 }
833
834
839 public UserService getUserService() {
840 return userService;
841 }
842
843
848 public void setUserService(UserService userService) {
849 this.userService = userService;
850 }
851
852
857 public UserPersistence getUserPersistence() {
858 return userPersistence;
859 }
860
861
866 public void setUserPersistence(UserPersistence userPersistence) {
867 this.userPersistence = userPersistence;
868 }
869
870
875 public UserFinder getUserFinder() {
876 return userFinder;
877 }
878
879
884 public void setUserFinder(UserFinder userFinder) {
885 this.userFinder = userFinder;
886 }
887
888 public void afterPropertiesSet() {
889 persistedModelLocalServiceRegistry.register("com.liferay.portlet.messageboards.model.MBDiscussion",
890 mbDiscussionLocalService);
891 }
892
893 public void destroy() {
894 persistedModelLocalServiceRegistry.unregister(
895 "com.liferay.portlet.messageboards.model.MBDiscussion");
896 }
897
898
903 public String getBeanIdentifier() {
904 return _beanIdentifier;
905 }
906
907
912 public void setBeanIdentifier(String beanIdentifier) {
913 _beanIdentifier = beanIdentifier;
914 }
915
916 protected Class<?> getModelClass() {
917 return MBDiscussion.class;
918 }
919
920 protected String getModelClassName() {
921 return MBDiscussion.class.getName();
922 }
923
924
929 protected void runSQL(String sql) throws SystemException {
930 try {
931 DataSource dataSource = mbDiscussionPersistence.getDataSource();
932
933 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
934 sql, new int[0]);
935
936 sqlUpdate.update();
937 }
938 catch (Exception e) {
939 throw new SystemException(e);
940 }
941 }
942
943 @BeanReference(type = MBBanLocalService.class)
944 protected MBBanLocalService mbBanLocalService;
945 @BeanReference(type = MBBanService.class)
946 protected MBBanService mbBanService;
947 @BeanReference(type = MBBanPersistence.class)
948 protected MBBanPersistence mbBanPersistence;
949 @BeanReference(type = MBCategoryLocalService.class)
950 protected MBCategoryLocalService mbCategoryLocalService;
951 @BeanReference(type = MBCategoryService.class)
952 protected MBCategoryService mbCategoryService;
953 @BeanReference(type = MBCategoryPersistence.class)
954 protected MBCategoryPersistence mbCategoryPersistence;
955 @BeanReference(type = MBCategoryFinder.class)
956 protected MBCategoryFinder mbCategoryFinder;
957 @BeanReference(type = MBDiscussionLocalService.class)
958 protected MBDiscussionLocalService mbDiscussionLocalService;
959 @BeanReference(type = MBDiscussionPersistence.class)
960 protected MBDiscussionPersistence mbDiscussionPersistence;
961 @BeanReference(type = MBMailingListLocalService.class)
962 protected MBMailingListLocalService mbMailingListLocalService;
963 @BeanReference(type = MBMailingListPersistence.class)
964 protected MBMailingListPersistence mbMailingListPersistence;
965 @BeanReference(type = MBMessageLocalService.class)
966 protected MBMessageLocalService mbMessageLocalService;
967 @BeanReference(type = MBMessageService.class)
968 protected MBMessageService mbMessageService;
969 @BeanReference(type = MBMessagePersistence.class)
970 protected MBMessagePersistence mbMessagePersistence;
971 @BeanReference(type = MBMessageFinder.class)
972 protected MBMessageFinder mbMessageFinder;
973 @BeanReference(type = MBStatsUserLocalService.class)
974 protected MBStatsUserLocalService mbStatsUserLocalService;
975 @BeanReference(type = MBStatsUserPersistence.class)
976 protected MBStatsUserPersistence mbStatsUserPersistence;
977 @BeanReference(type = MBThreadLocalService.class)
978 protected MBThreadLocalService mbThreadLocalService;
979 @BeanReference(type = MBThreadService.class)
980 protected MBThreadService mbThreadService;
981 @BeanReference(type = MBThreadPersistence.class)
982 protected MBThreadPersistence mbThreadPersistence;
983 @BeanReference(type = MBThreadFinder.class)
984 protected MBThreadFinder mbThreadFinder;
985 @BeanReference(type = MBThreadFlagLocalService.class)
986 protected MBThreadFlagLocalService mbThreadFlagLocalService;
987 @BeanReference(type = MBThreadFlagPersistence.class)
988 protected MBThreadFlagPersistence mbThreadFlagPersistence;
989 @BeanReference(type = CounterLocalService.class)
990 protected CounterLocalService counterLocalService;
991 @BeanReference(type = ResourceLocalService.class)
992 protected ResourceLocalService resourceLocalService;
993 @BeanReference(type = ResourceService.class)
994 protected ResourceService resourceService;
995 @BeanReference(type = ResourcePersistence.class)
996 protected ResourcePersistence resourcePersistence;
997 @BeanReference(type = ResourceFinder.class)
998 protected ResourceFinder resourceFinder;
999 @BeanReference(type = UserLocalService.class)
1000 protected UserLocalService userLocalService;
1001 @BeanReference(type = UserService.class)
1002 protected UserService userService;
1003 @BeanReference(type = UserPersistence.class)
1004 protected UserPersistence userPersistence;
1005 @BeanReference(type = UserFinder.class)
1006 protected UserFinder userFinder;
1007 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1008 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1009 private String _beanIdentifier;
1010 }