001
014
015 package com.liferay.portlet.messageboards.service.base;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.bean.BeanReference;
020 import com.liferay.portal.kernel.dao.db.DB;
021 import com.liferay.portal.kernel.dao.db.DBManagerUtil;
022 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025 import com.liferay.portal.kernel.dao.orm.Criterion;
026 import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
027 import com.liferay.portal.kernel.dao.orm.Disjunction;
028 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
029 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
030 import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
031 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
032 import com.liferay.portal.kernel.dao.orm.Projection;
033 import com.liferay.portal.kernel.dao.orm.Property;
034 import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
035 import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil;
036 import com.liferay.portal.kernel.exception.PortalException;
037 import com.liferay.portal.kernel.exception.SystemException;
038 import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
039 import com.liferay.portal.kernel.search.Indexable;
040 import com.liferay.portal.kernel.search.IndexableType;
041 import com.liferay.portal.kernel.util.OrderByComparator;
042 import com.liferay.portal.kernel.workflow.WorkflowConstants;
043 import com.liferay.portal.model.PersistedModel;
044 import com.liferay.portal.service.BaseLocalServiceImpl;
045 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
046 import com.liferay.portal.service.persistence.GroupFinder;
047 import com.liferay.portal.service.persistence.GroupPersistence;
048 import com.liferay.portal.service.persistence.SubscriptionPersistence;
049 import com.liferay.portal.service.persistence.UserFinder;
050 import com.liferay.portal.service.persistence.UserPersistence;
051 import com.liferay.portal.service.persistence.WorkflowInstanceLinkPersistence;
052 import com.liferay.portal.util.PortalUtil;
053
054 import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
055 import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
056 import com.liferay.portlet.exportimport.lar.ExportImportHelperUtil;
057 import com.liferay.portlet.exportimport.lar.ManifestSummary;
058 import com.liferay.portlet.exportimport.lar.PortletDataContext;
059 import com.liferay.portlet.exportimport.lar.StagedModelDataHandler;
060 import com.liferay.portlet.exportimport.lar.StagedModelDataHandlerRegistryUtil;
061 import com.liferay.portlet.exportimport.lar.StagedModelDataHandlerUtil;
062 import com.liferay.portlet.exportimport.lar.StagedModelType;
063 import com.liferay.portlet.messageboards.model.MBThread;
064 import com.liferay.portlet.messageboards.service.MBThreadLocalService;
065 import com.liferay.portlet.messageboards.service.persistence.MBCategoryFinder;
066 import com.liferay.portlet.messageboards.service.persistence.MBCategoryPersistence;
067 import com.liferay.portlet.messageboards.service.persistence.MBMessageFinder;
068 import com.liferay.portlet.messageboards.service.persistence.MBMessagePersistence;
069 import com.liferay.portlet.messageboards.service.persistence.MBStatsUserPersistence;
070 import com.liferay.portlet.messageboards.service.persistence.MBThreadFinder;
071 import com.liferay.portlet.messageboards.service.persistence.MBThreadFlagPersistence;
072 import com.liferay.portlet.messageboards.service.persistence.MBThreadPersistence;
073 import com.liferay.portlet.ratings.service.persistence.RatingsStatsFinder;
074 import com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence;
075 import com.liferay.portlet.trash.service.persistence.TrashEntryPersistence;
076 import com.liferay.portlet.trash.service.persistence.TrashVersionPersistence;
077
078 import java.io.Serializable;
079
080 import java.util.List;
081
082 import javax.sql.DataSource;
083
084
096 @ProviderType
097 public abstract class MBThreadLocalServiceBaseImpl extends BaseLocalServiceImpl
098 implements MBThreadLocalService, IdentifiableOSGiService {
099
104
105
111 @Indexable(type = IndexableType.REINDEX)
112 @Override
113 public MBThread addMBThread(MBThread mbThread) {
114 mbThread.setNew(true);
115
116 return mbThreadPersistence.update(mbThread);
117 }
118
119
125 @Override
126 public MBThread createMBThread(long threadId) {
127 return mbThreadPersistence.create(threadId);
128 }
129
130
137 @Indexable(type = IndexableType.DELETE)
138 @Override
139 public MBThread deleteMBThread(long threadId) throws PortalException {
140 return mbThreadPersistence.remove(threadId);
141 }
142
143
149 @Indexable(type = IndexableType.DELETE)
150 @Override
151 public MBThread deleteMBThread(MBThread mbThread) {
152 return mbThreadPersistence.remove(mbThread);
153 }
154
155 @Override
156 public DynamicQuery dynamicQuery() {
157 Class<?> clazz = getClass();
158
159 return DynamicQueryFactoryUtil.forClass(MBThread.class,
160 clazz.getClassLoader());
161 }
162
163
169 @Override
170 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
171 return mbThreadPersistence.findWithDynamicQuery(dynamicQuery);
172 }
173
174
186 @Override
187 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
188 int end) {
189 return mbThreadPersistence.findWithDynamicQuery(dynamicQuery, start, end);
190 }
191
192
205 @Override
206 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
207 int end, OrderByComparator<T> orderByComparator) {
208 return mbThreadPersistence.findWithDynamicQuery(dynamicQuery, start,
209 end, orderByComparator);
210 }
211
212
218 @Override
219 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
220 return mbThreadPersistence.countWithDynamicQuery(dynamicQuery);
221 }
222
223
230 @Override
231 public long dynamicQueryCount(DynamicQuery dynamicQuery,
232 Projection projection) {
233 return mbThreadPersistence.countWithDynamicQuery(dynamicQuery,
234 projection);
235 }
236
237 @Override
238 public MBThread fetchMBThread(long threadId) {
239 return mbThreadPersistence.fetchByPrimaryKey(threadId);
240 }
241
242
249 @Override
250 public MBThread fetchMBThreadByUuidAndGroupId(String uuid, long groupId) {
251 return mbThreadPersistence.fetchByUUID_G(uuid, groupId);
252 }
253
254
261 @Override
262 public MBThread getMBThread(long threadId) throws PortalException {
263 return mbThreadPersistence.findByPrimaryKey(threadId);
264 }
265
266 @Override
267 public ActionableDynamicQuery getActionableDynamicQuery() {
268 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
269
270 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.messageboards.service.MBThreadLocalServiceUtil.getService());
271 actionableDynamicQuery.setClassLoader(getClassLoader());
272 actionableDynamicQuery.setModelClass(MBThread.class);
273
274 actionableDynamicQuery.setPrimaryKeyPropertyName("threadId");
275
276 return actionableDynamicQuery;
277 }
278
279 @Override
280 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
281 IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
282
283 indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portlet.messageboards.service.MBThreadLocalServiceUtil.getService());
284 indexableActionableDynamicQuery.setClassLoader(getClassLoader());
285 indexableActionableDynamicQuery.setModelClass(MBThread.class);
286
287 indexableActionableDynamicQuery.setPrimaryKeyPropertyName("threadId");
288
289 return indexableActionableDynamicQuery;
290 }
291
292 protected void initActionableDynamicQuery(
293 ActionableDynamicQuery actionableDynamicQuery) {
294 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.messageboards.service.MBThreadLocalServiceUtil.getService());
295 actionableDynamicQuery.setClassLoader(getClassLoader());
296 actionableDynamicQuery.setModelClass(MBThread.class);
297
298 actionableDynamicQuery.setPrimaryKeyPropertyName("threadId");
299 }
300
301 @Override
302 public ExportActionableDynamicQuery getExportActionableDynamicQuery(
303 final PortletDataContext portletDataContext) {
304 final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
305 @Override
306 public long performCount() throws PortalException {
307 ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
308
309 StagedModelType stagedModelType = getStagedModelType();
310
311 long modelAdditionCount = super.performCount();
312
313 manifestSummary.addModelAdditionCount(stagedModelType,
314 modelAdditionCount);
315
316 long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
317 stagedModelType);
318
319 manifestSummary.addModelDeletionCount(stagedModelType,
320 modelDeletionCount);
321
322 return modelAdditionCount;
323 }
324 };
325
326 initActionableDynamicQuery(exportActionableDynamicQuery);
327
328 exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
329 @Override
330 public void addCriteria(DynamicQuery dynamicQuery) {
331 Criterion modifiedDateCriterion = portletDataContext.getDateRangeCriteria(
332 "modifiedDate");
333 Criterion statusDateCriterion = portletDataContext.getDateRangeCriteria(
334 "statusDate");
335
336 if ((modifiedDateCriterion != null) &&
337 (statusDateCriterion != null)) {
338 Disjunction disjunction = RestrictionsFactoryUtil.disjunction();
339
340 disjunction.add(modifiedDateCriterion);
341 disjunction.add(statusDateCriterion);
342
343 dynamicQuery.add(disjunction);
344 }
345
346 Property workflowStatusProperty = PropertyFactoryUtil.forName(
347 "status");
348
349 if (portletDataContext.isInitialPublication()) {
350 dynamicQuery.add(workflowStatusProperty.ne(
351 WorkflowConstants.STATUS_IN_TRASH));
352 }
353 else {
354 StagedModelDataHandler<?> stagedModelDataHandler = StagedModelDataHandlerRegistryUtil.getStagedModelDataHandler(MBThread.class.getName());
355
356 dynamicQuery.add(workflowStatusProperty.in(
357 stagedModelDataHandler.getExportableStatuses()));
358 }
359 }
360 });
361
362 exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
363
364 exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
365
366 exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<MBThread>() {
367 @Override
368 public void performAction(MBThread mbThread)
369 throws PortalException {
370 StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
371 mbThread);
372 }
373 });
374 exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
375 PortalUtil.getClassNameId(MBThread.class.getName())));
376
377 return exportActionableDynamicQuery;
378 }
379
380
383 @Override
384 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
385 throws PortalException {
386 return mbThreadLocalService.deleteMBThread((MBThread)persistedModel);
387 }
388
389 @Override
390 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
391 throws PortalException {
392 return mbThreadPersistence.findByPrimaryKey(primaryKeyObj);
393 }
394
395
402 @Override
403 public List<MBThread> getMBThreadsByUuidAndCompanyId(String uuid,
404 long companyId) {
405 return mbThreadPersistence.findByUuid_C(uuid, companyId);
406 }
407
408
418 @Override
419 public List<MBThread> getMBThreadsByUuidAndCompanyId(String uuid,
420 long companyId, int start, int end,
421 OrderByComparator<MBThread> orderByComparator) {
422 return mbThreadPersistence.findByUuid_C(uuid, companyId, start, end,
423 orderByComparator);
424 }
425
426
434 @Override
435 public MBThread getMBThreadByUuidAndGroupId(String uuid, long groupId)
436 throws PortalException {
437 return mbThreadPersistence.findByUUID_G(uuid, groupId);
438 }
439
440
451 @Override
452 public List<MBThread> getMBThreads(int start, int end) {
453 return mbThreadPersistence.findAll(start, end);
454 }
455
456
461 @Override
462 public int getMBThreadsCount() {
463 return mbThreadPersistence.countAll();
464 }
465
466
472 @Indexable(type = IndexableType.REINDEX)
473 @Override
474 public MBThread updateMBThread(MBThread mbThread) {
475 return mbThreadPersistence.update(mbThread);
476 }
477
478
483 public MBThreadLocalService getMBThreadLocalService() {
484 return mbThreadLocalService;
485 }
486
487
492 public void setMBThreadLocalService(
493 MBThreadLocalService mbThreadLocalService) {
494 this.mbThreadLocalService = mbThreadLocalService;
495 }
496
497
502 public MBThreadPersistence getMBThreadPersistence() {
503 return mbThreadPersistence;
504 }
505
506
511 public void setMBThreadPersistence(MBThreadPersistence mbThreadPersistence) {
512 this.mbThreadPersistence = mbThreadPersistence;
513 }
514
515
520 public MBThreadFinder getMBThreadFinder() {
521 return mbThreadFinder;
522 }
523
524
529 public void setMBThreadFinder(MBThreadFinder mbThreadFinder) {
530 this.mbThreadFinder = mbThreadFinder;
531 }
532
533
538 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
539 return counterLocalService;
540 }
541
542
547 public void setCounterLocalService(
548 com.liferay.counter.service.CounterLocalService counterLocalService) {
549 this.counterLocalService = counterLocalService;
550 }
551
552
557 public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
558 return groupLocalService;
559 }
560
561
566 public void setGroupLocalService(
567 com.liferay.portal.service.GroupLocalService groupLocalService) {
568 this.groupLocalService = groupLocalService;
569 }
570
571
576 public GroupPersistence getGroupPersistence() {
577 return groupPersistence;
578 }
579
580
585 public void setGroupPersistence(GroupPersistence groupPersistence) {
586 this.groupPersistence = groupPersistence;
587 }
588
589
594 public GroupFinder getGroupFinder() {
595 return groupFinder;
596 }
597
598
603 public void setGroupFinder(GroupFinder groupFinder) {
604 this.groupFinder = groupFinder;
605 }
606
607
612 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
613 return resourceLocalService;
614 }
615
616
621 public void setResourceLocalService(
622 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
623 this.resourceLocalService = resourceLocalService;
624 }
625
626
631 public com.liferay.portal.service.SubscriptionLocalService getSubscriptionLocalService() {
632 return subscriptionLocalService;
633 }
634
635
640 public void setSubscriptionLocalService(
641 com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService) {
642 this.subscriptionLocalService = subscriptionLocalService;
643 }
644
645
650 public SubscriptionPersistence getSubscriptionPersistence() {
651 return subscriptionPersistence;
652 }
653
654
659 public void setSubscriptionPersistence(
660 SubscriptionPersistence subscriptionPersistence) {
661 this.subscriptionPersistence = subscriptionPersistence;
662 }
663
664
669 public com.liferay.portal.service.UserLocalService getUserLocalService() {
670 return userLocalService;
671 }
672
673
678 public void setUserLocalService(
679 com.liferay.portal.service.UserLocalService userLocalService) {
680 this.userLocalService = userLocalService;
681 }
682
683
688 public UserPersistence getUserPersistence() {
689 return userPersistence;
690 }
691
692
697 public void setUserPersistence(UserPersistence userPersistence) {
698 this.userPersistence = userPersistence;
699 }
700
701
706 public UserFinder getUserFinder() {
707 return userFinder;
708 }
709
710
715 public void setUserFinder(UserFinder userFinder) {
716 this.userFinder = userFinder;
717 }
718
719
724 public com.liferay.portal.service.WorkflowInstanceLinkLocalService getWorkflowInstanceLinkLocalService() {
725 return workflowInstanceLinkLocalService;
726 }
727
728
733 public void setWorkflowInstanceLinkLocalService(
734 com.liferay.portal.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService) {
735 this.workflowInstanceLinkLocalService = workflowInstanceLinkLocalService;
736 }
737
738
743 public WorkflowInstanceLinkPersistence getWorkflowInstanceLinkPersistence() {
744 return workflowInstanceLinkPersistence;
745 }
746
747
752 public void setWorkflowInstanceLinkPersistence(
753 WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence) {
754 this.workflowInstanceLinkPersistence = workflowInstanceLinkPersistence;
755 }
756
757
762 public com.liferay.portlet.asset.service.AssetEntryLocalService getAssetEntryLocalService() {
763 return assetEntryLocalService;
764 }
765
766
771 public void setAssetEntryLocalService(
772 com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService) {
773 this.assetEntryLocalService = assetEntryLocalService;
774 }
775
776
781 public AssetEntryPersistence getAssetEntryPersistence() {
782 return assetEntryPersistence;
783 }
784
785
790 public void setAssetEntryPersistence(
791 AssetEntryPersistence assetEntryPersistence) {
792 this.assetEntryPersistence = assetEntryPersistence;
793 }
794
795
800 public AssetEntryFinder getAssetEntryFinder() {
801 return assetEntryFinder;
802 }
803
804
809 public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
810 this.assetEntryFinder = assetEntryFinder;
811 }
812
813
818 public com.liferay.portlet.messageboards.service.MBCategoryLocalService getMBCategoryLocalService() {
819 return mbCategoryLocalService;
820 }
821
822
827 public void setMBCategoryLocalService(
828 com.liferay.portlet.messageboards.service.MBCategoryLocalService mbCategoryLocalService) {
829 this.mbCategoryLocalService = mbCategoryLocalService;
830 }
831
832
837 public MBCategoryPersistence getMBCategoryPersistence() {
838 return mbCategoryPersistence;
839 }
840
841
846 public void setMBCategoryPersistence(
847 MBCategoryPersistence mbCategoryPersistence) {
848 this.mbCategoryPersistence = mbCategoryPersistence;
849 }
850
851
856 public MBCategoryFinder getMBCategoryFinder() {
857 return mbCategoryFinder;
858 }
859
860
865 public void setMBCategoryFinder(MBCategoryFinder mbCategoryFinder) {
866 this.mbCategoryFinder = mbCategoryFinder;
867 }
868
869
874 public com.liferay.portlet.messageboards.service.MBMessageLocalService getMBMessageLocalService() {
875 return mbMessageLocalService;
876 }
877
878
883 public void setMBMessageLocalService(
884 com.liferay.portlet.messageboards.service.MBMessageLocalService mbMessageLocalService) {
885 this.mbMessageLocalService = mbMessageLocalService;
886 }
887
888
893 public MBMessagePersistence getMBMessagePersistence() {
894 return mbMessagePersistence;
895 }
896
897
902 public void setMBMessagePersistence(
903 MBMessagePersistence mbMessagePersistence) {
904 this.mbMessagePersistence = mbMessagePersistence;
905 }
906
907
912 public MBMessageFinder getMBMessageFinder() {
913 return mbMessageFinder;
914 }
915
916
921 public void setMBMessageFinder(MBMessageFinder mbMessageFinder) {
922 this.mbMessageFinder = mbMessageFinder;
923 }
924
925
930 public com.liferay.portlet.messageboards.service.MBStatsUserLocalService getMBStatsUserLocalService() {
931 return mbStatsUserLocalService;
932 }
933
934
939 public void setMBStatsUserLocalService(
940 com.liferay.portlet.messageboards.service.MBStatsUserLocalService mbStatsUserLocalService) {
941 this.mbStatsUserLocalService = mbStatsUserLocalService;
942 }
943
944
949 public MBStatsUserPersistence getMBStatsUserPersistence() {
950 return mbStatsUserPersistence;
951 }
952
953
958 public void setMBStatsUserPersistence(
959 MBStatsUserPersistence mbStatsUserPersistence) {
960 this.mbStatsUserPersistence = mbStatsUserPersistence;
961 }
962
963
968 public com.liferay.portlet.ratings.service.RatingsStatsLocalService getRatingsStatsLocalService() {
969 return ratingsStatsLocalService;
970 }
971
972
977 public void setRatingsStatsLocalService(
978 com.liferay.portlet.ratings.service.RatingsStatsLocalService ratingsStatsLocalService) {
979 this.ratingsStatsLocalService = ratingsStatsLocalService;
980 }
981
982
987 public RatingsStatsPersistence getRatingsStatsPersistence() {
988 return ratingsStatsPersistence;
989 }
990
991
996 public void setRatingsStatsPersistence(
997 RatingsStatsPersistence ratingsStatsPersistence) {
998 this.ratingsStatsPersistence = ratingsStatsPersistence;
999 }
1000
1001
1006 public RatingsStatsFinder getRatingsStatsFinder() {
1007 return ratingsStatsFinder;
1008 }
1009
1010
1015 public void setRatingsStatsFinder(RatingsStatsFinder ratingsStatsFinder) {
1016 this.ratingsStatsFinder = ratingsStatsFinder;
1017 }
1018
1019
1024 public com.liferay.portlet.trash.service.TrashEntryLocalService getTrashEntryLocalService() {
1025 return trashEntryLocalService;
1026 }
1027
1028
1033 public void setTrashEntryLocalService(
1034 com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService) {
1035 this.trashEntryLocalService = trashEntryLocalService;
1036 }
1037
1038
1043 public TrashEntryPersistence getTrashEntryPersistence() {
1044 return trashEntryPersistence;
1045 }
1046
1047
1052 public void setTrashEntryPersistence(
1053 TrashEntryPersistence trashEntryPersistence) {
1054 this.trashEntryPersistence = trashEntryPersistence;
1055 }
1056
1057
1062 public com.liferay.portlet.trash.service.TrashVersionLocalService getTrashVersionLocalService() {
1063 return trashVersionLocalService;
1064 }
1065
1066
1071 public void setTrashVersionLocalService(
1072 com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService) {
1073 this.trashVersionLocalService = trashVersionLocalService;
1074 }
1075
1076
1081 public TrashVersionPersistence getTrashVersionPersistence() {
1082 return trashVersionPersistence;
1083 }
1084
1085
1090 public void setTrashVersionPersistence(
1091 TrashVersionPersistence trashVersionPersistence) {
1092 this.trashVersionPersistence = trashVersionPersistence;
1093 }
1094
1095
1100 public com.liferay.portlet.messageboards.service.MBThreadFlagLocalService getMBThreadFlagLocalService() {
1101 return mbThreadFlagLocalService;
1102 }
1103
1104
1109 public void setMBThreadFlagLocalService(
1110 com.liferay.portlet.messageboards.service.MBThreadFlagLocalService mbThreadFlagLocalService) {
1111 this.mbThreadFlagLocalService = mbThreadFlagLocalService;
1112 }
1113
1114
1119 public MBThreadFlagPersistence getMBThreadFlagPersistence() {
1120 return mbThreadFlagPersistence;
1121 }
1122
1123
1128 public void setMBThreadFlagPersistence(
1129 MBThreadFlagPersistence mbThreadFlagPersistence) {
1130 this.mbThreadFlagPersistence = mbThreadFlagPersistence;
1131 }
1132
1133 public void afterPropertiesSet() {
1134 persistedModelLocalServiceRegistry.register("com.liferay.portlet.messageboards.model.MBThread",
1135 mbThreadLocalService);
1136 }
1137
1138 public void destroy() {
1139 persistedModelLocalServiceRegistry.unregister(
1140 "com.liferay.portlet.messageboards.model.MBThread");
1141 }
1142
1143
1148 @Override
1149 public String getOSGiServiceIdentifier() {
1150 return MBThreadLocalService.class.getName();
1151 }
1152
1153 protected Class<?> getModelClass() {
1154 return MBThread.class;
1155 }
1156
1157 protected String getModelClassName() {
1158 return MBThread.class.getName();
1159 }
1160
1161
1166 protected void runSQL(String sql) {
1167 try {
1168 DataSource dataSource = mbThreadPersistence.getDataSource();
1169
1170 DB db = DBManagerUtil.getDB();
1171
1172 sql = db.buildSQL(sql);
1173 sql = PortalUtil.transformSQL(sql);
1174
1175 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1176 sql, new int[0]);
1177
1178 sqlUpdate.update();
1179 }
1180 catch (Exception e) {
1181 throw new SystemException(e);
1182 }
1183 }
1184
1185 @BeanReference(type = com.liferay.portlet.messageboards.service.MBThreadLocalService.class)
1186 protected MBThreadLocalService mbThreadLocalService;
1187 @BeanReference(type = MBThreadPersistence.class)
1188 protected MBThreadPersistence mbThreadPersistence;
1189 @BeanReference(type = MBThreadFinder.class)
1190 protected MBThreadFinder mbThreadFinder;
1191 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
1192 protected com.liferay.counter.service.CounterLocalService counterLocalService;
1193 @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
1194 protected com.liferay.portal.service.GroupLocalService groupLocalService;
1195 @BeanReference(type = GroupPersistence.class)
1196 protected GroupPersistence groupPersistence;
1197 @BeanReference(type = GroupFinder.class)
1198 protected GroupFinder groupFinder;
1199 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
1200 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
1201 @BeanReference(type = com.liferay.portal.service.SubscriptionLocalService.class)
1202 protected com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService;
1203 @BeanReference(type = SubscriptionPersistence.class)
1204 protected SubscriptionPersistence subscriptionPersistence;
1205 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1206 protected com.liferay.portal.service.UserLocalService userLocalService;
1207 @BeanReference(type = UserPersistence.class)
1208 protected UserPersistence userPersistence;
1209 @BeanReference(type = UserFinder.class)
1210 protected UserFinder userFinder;
1211 @BeanReference(type = com.liferay.portal.service.WorkflowInstanceLinkLocalService.class)
1212 protected com.liferay.portal.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService;
1213 @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1214 protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1215 @BeanReference(type = com.liferay.portlet.asset.service.AssetEntryLocalService.class)
1216 protected com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService;
1217 @BeanReference(type = AssetEntryPersistence.class)
1218 protected AssetEntryPersistence assetEntryPersistence;
1219 @BeanReference(type = AssetEntryFinder.class)
1220 protected AssetEntryFinder assetEntryFinder;
1221 @BeanReference(type = com.liferay.portlet.messageboards.service.MBCategoryLocalService.class)
1222 protected com.liferay.portlet.messageboards.service.MBCategoryLocalService mbCategoryLocalService;
1223 @BeanReference(type = MBCategoryPersistence.class)
1224 protected MBCategoryPersistence mbCategoryPersistence;
1225 @BeanReference(type = MBCategoryFinder.class)
1226 protected MBCategoryFinder mbCategoryFinder;
1227 @BeanReference(type = com.liferay.portlet.messageboards.service.MBMessageLocalService.class)
1228 protected com.liferay.portlet.messageboards.service.MBMessageLocalService mbMessageLocalService;
1229 @BeanReference(type = MBMessagePersistence.class)
1230 protected MBMessagePersistence mbMessagePersistence;
1231 @BeanReference(type = MBMessageFinder.class)
1232 protected MBMessageFinder mbMessageFinder;
1233 @BeanReference(type = com.liferay.portlet.messageboards.service.MBStatsUserLocalService.class)
1234 protected com.liferay.portlet.messageboards.service.MBStatsUserLocalService mbStatsUserLocalService;
1235 @BeanReference(type = MBStatsUserPersistence.class)
1236 protected MBStatsUserPersistence mbStatsUserPersistence;
1237 @BeanReference(type = com.liferay.portlet.ratings.service.RatingsStatsLocalService.class)
1238 protected com.liferay.portlet.ratings.service.RatingsStatsLocalService ratingsStatsLocalService;
1239 @BeanReference(type = RatingsStatsPersistence.class)
1240 protected RatingsStatsPersistence ratingsStatsPersistence;
1241 @BeanReference(type = RatingsStatsFinder.class)
1242 protected RatingsStatsFinder ratingsStatsFinder;
1243 @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryLocalService.class)
1244 protected com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService;
1245 @BeanReference(type = TrashEntryPersistence.class)
1246 protected TrashEntryPersistence trashEntryPersistence;
1247 @BeanReference(type = com.liferay.portlet.trash.service.TrashVersionLocalService.class)
1248 protected com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService;
1249 @BeanReference(type = TrashVersionPersistence.class)
1250 protected TrashVersionPersistence trashVersionPersistence;
1251 @BeanReference(type = com.liferay.portlet.messageboards.service.MBThreadFlagLocalService.class)
1252 protected com.liferay.portlet.messageboards.service.MBThreadFlagLocalService mbThreadFlagLocalService;
1253 @BeanReference(type = MBThreadFlagPersistence.class)
1254 protected MBThreadFlagPersistence mbThreadFlagPersistence;
1255 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1256 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1257 }