001    /**
002     * Copyright (c) 2000-present 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.messageboards.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.asset.kernel.service.persistence.AssetEntryFinder;
020    import com.liferay.asset.kernel.service.persistence.AssetEntryPersistence;
021    
022    import com.liferay.exportimport.kernel.lar.ExportImportHelperUtil;
023    import com.liferay.exportimport.kernel.lar.ManifestSummary;
024    import com.liferay.exportimport.kernel.lar.PortletDataContext;
025    import com.liferay.exportimport.kernel.lar.StagedModelDataHandler;
026    import com.liferay.exportimport.kernel.lar.StagedModelDataHandlerRegistryUtil;
027    import com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil;
028    import com.liferay.exportimport.kernel.lar.StagedModelType;
029    
030    import com.liferay.message.boards.kernel.model.MBThread;
031    import com.liferay.message.boards.kernel.service.MBThreadLocalService;
032    import com.liferay.message.boards.kernel.service.persistence.MBCategoryFinder;
033    import com.liferay.message.boards.kernel.service.persistence.MBCategoryPersistence;
034    import com.liferay.message.boards.kernel.service.persistence.MBMessageFinder;
035    import com.liferay.message.boards.kernel.service.persistence.MBMessagePersistence;
036    import com.liferay.message.boards.kernel.service.persistence.MBStatsUserPersistence;
037    import com.liferay.message.boards.kernel.service.persistence.MBThreadFinder;
038    import com.liferay.message.boards.kernel.service.persistence.MBThreadFlagPersistence;
039    import com.liferay.message.boards.kernel.service.persistence.MBThreadPersistence;
040    
041    import com.liferay.portal.kernel.bean.BeanReference;
042    import com.liferay.portal.kernel.dao.db.DB;
043    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
044    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
045    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
046    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
047    import com.liferay.portal.kernel.dao.orm.Criterion;
048    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
049    import com.liferay.portal.kernel.dao.orm.Disjunction;
050    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
051    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
052    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
053    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
054    import com.liferay.portal.kernel.dao.orm.Projection;
055    import com.liferay.portal.kernel.dao.orm.Property;
056    import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
057    import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil;
058    import com.liferay.portal.kernel.exception.PortalException;
059    import com.liferay.portal.kernel.exception.SystemException;
060    import com.liferay.portal.kernel.model.PersistedModel;
061    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
062    import com.liferay.portal.kernel.search.Indexable;
063    import com.liferay.portal.kernel.search.IndexableType;
064    import com.liferay.portal.kernel.service.BaseLocalServiceImpl;
065    import com.liferay.portal.kernel.service.PersistedModelLocalServiceRegistry;
066    import com.liferay.portal.kernel.service.persistence.GroupFinder;
067    import com.liferay.portal.kernel.service.persistence.GroupPersistence;
068    import com.liferay.portal.kernel.service.persistence.SubscriptionPersistence;
069    import com.liferay.portal.kernel.service.persistence.UserFinder;
070    import com.liferay.portal.kernel.service.persistence.UserPersistence;
071    import com.liferay.portal.kernel.service.persistence.WorkflowInstanceLinkPersistence;
072    import com.liferay.portal.kernel.util.OrderByComparator;
073    import com.liferay.portal.kernel.util.PortalUtil;
074    import com.liferay.portal.kernel.workflow.WorkflowConstants;
075    
076    import com.liferay.ratings.kernel.service.persistence.RatingsStatsFinder;
077    import com.liferay.ratings.kernel.service.persistence.RatingsStatsPersistence;
078    
079    import com.liferay.trash.kernel.service.persistence.TrashEntryPersistence;
080    import com.liferay.trash.kernel.service.persistence.TrashVersionPersistence;
081    
082    import java.io.Serializable;
083    
084    import java.util.List;
085    
086    import javax.sql.DataSource;
087    
088    /**
089     * Provides the base implementation for the message boards thread local service.
090     *
091     * <p>
092     * 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.messageboards.service.impl.MBThreadLocalServiceImpl}.
093     * </p>
094     *
095     * @author Brian Wing Shun Chan
096     * @see com.liferay.portlet.messageboards.service.impl.MBThreadLocalServiceImpl
097     * @see com.liferay.message.boards.kernel.service.MBThreadLocalServiceUtil
098     * @generated
099     */
100    @ProviderType
101    public abstract class MBThreadLocalServiceBaseImpl extends BaseLocalServiceImpl
102            implements MBThreadLocalService, IdentifiableOSGiService {
103            /*
104             * NOTE FOR DEVELOPERS:
105             *
106             * Never modify or reference this class directly. Always use {@link com.liferay.message.boards.kernel.service.MBThreadLocalServiceUtil} to access the message boards thread local service.
107             */
108    
109            /**
110             * Adds the message boards thread to the database. Also notifies the appropriate model listeners.
111             *
112             * @param mbThread the message boards thread
113             * @return the message boards thread that was added
114             */
115            @Indexable(type = IndexableType.REINDEX)
116            @Override
117            public MBThread addMBThread(MBThread mbThread) {
118                    mbThread.setNew(true);
119    
120                    return mbThreadPersistence.update(mbThread);
121            }
122    
123            /**
124             * Creates a new message boards thread with the primary key. Does not add the message boards thread to the database.
125             *
126             * @param threadId the primary key for the new message boards thread
127             * @return the new message boards thread
128             */
129            @Override
130            public MBThread createMBThread(long threadId) {
131                    return mbThreadPersistence.create(threadId);
132            }
133    
134            /**
135             * Deletes the message boards thread with the primary key from the database. Also notifies the appropriate model listeners.
136             *
137             * @param threadId the primary key of the message boards thread
138             * @return the message boards thread that was removed
139             * @throws PortalException if a message boards thread with the primary key could not be found
140             */
141            @Indexable(type = IndexableType.DELETE)
142            @Override
143            public MBThread deleteMBThread(long threadId) throws PortalException {
144                    return mbThreadPersistence.remove(threadId);
145            }
146    
147            /**
148             * Deletes the message boards thread from the database. Also notifies the appropriate model listeners.
149             *
150             * @param mbThread the message boards thread
151             * @return the message boards thread that was removed
152             */
153            @Indexable(type = IndexableType.DELETE)
154            @Override
155            public MBThread deleteMBThread(MBThread mbThread) {
156                    return mbThreadPersistence.remove(mbThread);
157            }
158    
159            @Override
160            public DynamicQuery dynamicQuery() {
161                    Class<?> clazz = getClass();
162    
163                    return DynamicQueryFactoryUtil.forClass(MBThread.class,
164                            clazz.getClassLoader());
165            }
166    
167            /**
168             * Performs a dynamic query on the database and returns the matching rows.
169             *
170             * @param dynamicQuery the dynamic query
171             * @return the matching rows
172             */
173            @Override
174            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
175                    return mbThreadPersistence.findWithDynamicQuery(dynamicQuery);
176            }
177    
178            /**
179             * Performs a dynamic query on the database and returns a range of the matching rows.
180             *
181             * <p>
182             * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBThreadModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
183             * </p>
184             *
185             * @param dynamicQuery the dynamic query
186             * @param start the lower bound of the range of model instances
187             * @param end the upper bound of the range of model instances (not inclusive)
188             * @return the range of matching rows
189             */
190            @Override
191            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
192                    int end) {
193                    return mbThreadPersistence.findWithDynamicQuery(dynamicQuery, start, end);
194            }
195    
196            /**
197             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
198             *
199             * <p>
200             * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBThreadModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
201             * </p>
202             *
203             * @param dynamicQuery the dynamic query
204             * @param start the lower bound of the range of model instances
205             * @param end the upper bound of the range of model instances (not inclusive)
206             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
207             * @return the ordered range of matching rows
208             */
209            @Override
210            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
211                    int end, OrderByComparator<T> orderByComparator) {
212                    return mbThreadPersistence.findWithDynamicQuery(dynamicQuery, start,
213                            end, orderByComparator);
214            }
215    
216            /**
217             * Returns the number of rows matching the dynamic query.
218             *
219             * @param dynamicQuery the dynamic query
220             * @return the number of rows matching the dynamic query
221             */
222            @Override
223            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
224                    return mbThreadPersistence.countWithDynamicQuery(dynamicQuery);
225            }
226    
227            /**
228             * Returns the number of rows matching the dynamic query.
229             *
230             * @param dynamicQuery the dynamic query
231             * @param projection the projection to apply to the query
232             * @return the number of rows matching the dynamic query
233             */
234            @Override
235            public long dynamicQueryCount(DynamicQuery dynamicQuery,
236                    Projection projection) {
237                    return mbThreadPersistence.countWithDynamicQuery(dynamicQuery,
238                            projection);
239            }
240    
241            @Override
242            public MBThread fetchMBThread(long threadId) {
243                    return mbThreadPersistence.fetchByPrimaryKey(threadId);
244            }
245    
246            /**
247             * Returns the message boards thread matching the UUID and group.
248             *
249             * @param uuid the message boards thread's UUID
250             * @param groupId the primary key of the group
251             * @return the matching message boards thread, or <code>null</code> if a matching message boards thread could not be found
252             */
253            @Override
254            public MBThread fetchMBThreadByUuidAndGroupId(String uuid, long groupId) {
255                    return mbThreadPersistence.fetchByUUID_G(uuid, groupId);
256            }
257    
258            /**
259             * Returns the message boards thread with the primary key.
260             *
261             * @param threadId the primary key of the message boards thread
262             * @return the message boards thread
263             * @throws PortalException if a message boards thread with the primary key could not be found
264             */
265            @Override
266            public MBThread getMBThread(long threadId) throws PortalException {
267                    return mbThreadPersistence.findByPrimaryKey(threadId);
268            }
269    
270            @Override
271            public ActionableDynamicQuery getActionableDynamicQuery() {
272                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
273    
274                    actionableDynamicQuery.setBaseLocalService(mbThreadLocalService);
275                    actionableDynamicQuery.setClassLoader(getClassLoader());
276                    actionableDynamicQuery.setModelClass(MBThread.class);
277    
278                    actionableDynamicQuery.setPrimaryKeyPropertyName("threadId");
279    
280                    return actionableDynamicQuery;
281            }
282    
283            @Override
284            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
285                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
286    
287                    indexableActionableDynamicQuery.setBaseLocalService(mbThreadLocalService);
288                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
289                    indexableActionableDynamicQuery.setModelClass(MBThread.class);
290    
291                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("threadId");
292    
293                    return indexableActionableDynamicQuery;
294            }
295    
296            protected void initActionableDynamicQuery(
297                    ActionableDynamicQuery actionableDynamicQuery) {
298                    actionableDynamicQuery.setBaseLocalService(mbThreadLocalService);
299                    actionableDynamicQuery.setClassLoader(getClassLoader());
300                    actionableDynamicQuery.setModelClass(MBThread.class);
301    
302                    actionableDynamicQuery.setPrimaryKeyPropertyName("threadId");
303            }
304    
305            @Override
306            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
307                    final PortletDataContext portletDataContext) {
308                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
309                                    @Override
310                                    public long performCount() throws PortalException {
311                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
312    
313                                            StagedModelType stagedModelType = getStagedModelType();
314    
315                                            long modelAdditionCount = super.performCount();
316    
317                                            manifestSummary.addModelAdditionCount(stagedModelType,
318                                                    modelAdditionCount);
319    
320                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
321                                                            stagedModelType);
322    
323                                            manifestSummary.addModelDeletionCount(stagedModelType,
324                                                    modelDeletionCount);
325    
326                                            return modelAdditionCount;
327                                    }
328                            };
329    
330                    initActionableDynamicQuery(exportActionableDynamicQuery);
331    
332                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
333                                    @Override
334                                    public void addCriteria(DynamicQuery dynamicQuery) {
335                                            Criterion modifiedDateCriterion = portletDataContext.getDateRangeCriteria(
336                                                            "modifiedDate");
337                                            Criterion statusDateCriterion = portletDataContext.getDateRangeCriteria(
338                                                            "statusDate");
339    
340                                            if ((modifiedDateCriterion != null) &&
341                                                            (statusDateCriterion != null)) {
342                                                    Disjunction disjunction = RestrictionsFactoryUtil.disjunction();
343    
344                                                    disjunction.add(modifiedDateCriterion);
345                                                    disjunction.add(statusDateCriterion);
346    
347                                                    dynamicQuery.add(disjunction);
348                                            }
349    
350                                            Property workflowStatusProperty = PropertyFactoryUtil.forName(
351                                                            "status");
352    
353                                            if (portletDataContext.isInitialPublication()) {
354                                                    dynamicQuery.add(workflowStatusProperty.ne(
355                                                                    WorkflowConstants.STATUS_IN_TRASH));
356                                            }
357                                            else {
358                                                    StagedModelDataHandler<?> stagedModelDataHandler = StagedModelDataHandlerRegistryUtil.getStagedModelDataHandler(MBThread.class.getName());
359    
360                                                    dynamicQuery.add(workflowStatusProperty.in(
361                                                                    stagedModelDataHandler.getExportableStatuses()));
362                                            }
363                                    }
364                            });
365    
366                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
367    
368                    exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
369    
370                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<MBThread>() {
371                                    @Override
372                                    public void performAction(MBThread mbThread)
373                                            throws PortalException {
374                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
375                                                    mbThread);
376                                    }
377                            });
378                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
379                                    PortalUtil.getClassNameId(MBThread.class.getName())));
380    
381                    return exportActionableDynamicQuery;
382            }
383    
384            /**
385             * @throws PortalException
386             */
387            @Override
388            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
389                    throws PortalException {
390                    return mbThreadLocalService.deleteMBThread((MBThread)persistedModel);
391            }
392    
393            @Override
394            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
395                    throws PortalException {
396                    return mbThreadPersistence.findByPrimaryKey(primaryKeyObj);
397            }
398    
399            /**
400             * Returns all the message boards threads matching the UUID and company.
401             *
402             * @param uuid the UUID of the message boards threads
403             * @param companyId the primary key of the company
404             * @return the matching message boards threads, or an empty list if no matches were found
405             */
406            @Override
407            public List<MBThread> getMBThreadsByUuidAndCompanyId(String uuid,
408                    long companyId) {
409                    return mbThreadPersistence.findByUuid_C(uuid, companyId);
410            }
411    
412            /**
413             * Returns a range of message boards threads matching the UUID and company.
414             *
415             * @param uuid the UUID of the message boards threads
416             * @param companyId the primary key of the company
417             * @param start the lower bound of the range of message boards threads
418             * @param end the upper bound of the range of message boards threads (not inclusive)
419             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
420             * @return the range of matching message boards threads, or an empty list if no matches were found
421             */
422            @Override
423            public List<MBThread> getMBThreadsByUuidAndCompanyId(String uuid,
424                    long companyId, int start, int end,
425                    OrderByComparator<MBThread> orderByComparator) {
426                    return mbThreadPersistence.findByUuid_C(uuid, companyId, start, end,
427                            orderByComparator);
428            }
429    
430            /**
431             * Returns the message boards thread matching the UUID and group.
432             *
433             * @param uuid the message boards thread's UUID
434             * @param groupId the primary key of the group
435             * @return the matching message boards thread
436             * @throws PortalException if a matching message boards thread could not be found
437             */
438            @Override
439            public MBThread getMBThreadByUuidAndGroupId(String uuid, long groupId)
440                    throws PortalException {
441                    return mbThreadPersistence.findByUUID_G(uuid, groupId);
442            }
443    
444            /**
445             * Returns a range of all the message boards threads.
446             *
447             * <p>
448             * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBThreadModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
449             * </p>
450             *
451             * @param start the lower bound of the range of message boards threads
452             * @param end the upper bound of the range of message boards threads (not inclusive)
453             * @return the range of message boards threads
454             */
455            @Override
456            public List<MBThread> getMBThreads(int start, int end) {
457                    return mbThreadPersistence.findAll(start, end);
458            }
459    
460            /**
461             * Returns the number of message boards threads.
462             *
463             * @return the number of message boards threads
464             */
465            @Override
466            public int getMBThreadsCount() {
467                    return mbThreadPersistence.countAll();
468            }
469    
470            /**
471             * Updates the message boards thread in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
472             *
473             * @param mbThread the message boards thread
474             * @return the message boards thread that was updated
475             */
476            @Indexable(type = IndexableType.REINDEX)
477            @Override
478            public MBThread updateMBThread(MBThread mbThread) {
479                    return mbThreadPersistence.update(mbThread);
480            }
481    
482            /**
483             * Returns the message boards thread local service.
484             *
485             * @return the message boards thread local service
486             */
487            public MBThreadLocalService getMBThreadLocalService() {
488                    return mbThreadLocalService;
489            }
490    
491            /**
492             * Sets the message boards thread local service.
493             *
494             * @param mbThreadLocalService the message boards thread local service
495             */
496            public void setMBThreadLocalService(
497                    MBThreadLocalService mbThreadLocalService) {
498                    this.mbThreadLocalService = mbThreadLocalService;
499            }
500    
501            /**
502             * Returns the message boards thread persistence.
503             *
504             * @return the message boards thread persistence
505             */
506            public MBThreadPersistence getMBThreadPersistence() {
507                    return mbThreadPersistence;
508            }
509    
510            /**
511             * Sets the message boards thread persistence.
512             *
513             * @param mbThreadPersistence the message boards thread persistence
514             */
515            public void setMBThreadPersistence(MBThreadPersistence mbThreadPersistence) {
516                    this.mbThreadPersistence = mbThreadPersistence;
517            }
518    
519            /**
520             * Returns the message boards thread finder.
521             *
522             * @return the message boards thread finder
523             */
524            public MBThreadFinder getMBThreadFinder() {
525                    return mbThreadFinder;
526            }
527    
528            /**
529             * Sets the message boards thread finder.
530             *
531             * @param mbThreadFinder the message boards thread finder
532             */
533            public void setMBThreadFinder(MBThreadFinder mbThreadFinder) {
534                    this.mbThreadFinder = mbThreadFinder;
535            }
536    
537            /**
538             * Returns the counter local service.
539             *
540             * @return the counter local service
541             */
542            public com.liferay.counter.kernel.service.CounterLocalService getCounterLocalService() {
543                    return counterLocalService;
544            }
545    
546            /**
547             * Sets the counter local service.
548             *
549             * @param counterLocalService the counter local service
550             */
551            public void setCounterLocalService(
552                    com.liferay.counter.kernel.service.CounterLocalService counterLocalService) {
553                    this.counterLocalService = counterLocalService;
554            }
555    
556            /**
557             * Returns the group local service.
558             *
559             * @return the group local service
560             */
561            public com.liferay.portal.kernel.service.GroupLocalService getGroupLocalService() {
562                    return groupLocalService;
563            }
564    
565            /**
566             * Sets the group local service.
567             *
568             * @param groupLocalService the group local service
569             */
570            public void setGroupLocalService(
571                    com.liferay.portal.kernel.service.GroupLocalService groupLocalService) {
572                    this.groupLocalService = groupLocalService;
573            }
574    
575            /**
576             * Returns the group persistence.
577             *
578             * @return the group persistence
579             */
580            public GroupPersistence getGroupPersistence() {
581                    return groupPersistence;
582            }
583    
584            /**
585             * Sets the group persistence.
586             *
587             * @param groupPersistence the group persistence
588             */
589            public void setGroupPersistence(GroupPersistence groupPersistence) {
590                    this.groupPersistence = groupPersistence;
591            }
592    
593            /**
594             * Returns the group finder.
595             *
596             * @return the group finder
597             */
598            public GroupFinder getGroupFinder() {
599                    return groupFinder;
600            }
601    
602            /**
603             * Sets the group finder.
604             *
605             * @param groupFinder the group finder
606             */
607            public void setGroupFinder(GroupFinder groupFinder) {
608                    this.groupFinder = groupFinder;
609            }
610    
611            /**
612             * Returns the resource local service.
613             *
614             * @return the resource local service
615             */
616            public com.liferay.portal.kernel.service.ResourceLocalService getResourceLocalService() {
617                    return resourceLocalService;
618            }
619    
620            /**
621             * Sets the resource local service.
622             *
623             * @param resourceLocalService the resource local service
624             */
625            public void setResourceLocalService(
626                    com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService) {
627                    this.resourceLocalService = resourceLocalService;
628            }
629    
630            /**
631             * Returns the subscription local service.
632             *
633             * @return the subscription local service
634             */
635            public com.liferay.portal.kernel.service.SubscriptionLocalService getSubscriptionLocalService() {
636                    return subscriptionLocalService;
637            }
638    
639            /**
640             * Sets the subscription local service.
641             *
642             * @param subscriptionLocalService the subscription local service
643             */
644            public void setSubscriptionLocalService(
645                    com.liferay.portal.kernel.service.SubscriptionLocalService subscriptionLocalService) {
646                    this.subscriptionLocalService = subscriptionLocalService;
647            }
648    
649            /**
650             * Returns the subscription persistence.
651             *
652             * @return the subscription persistence
653             */
654            public SubscriptionPersistence getSubscriptionPersistence() {
655                    return subscriptionPersistence;
656            }
657    
658            /**
659             * Sets the subscription persistence.
660             *
661             * @param subscriptionPersistence the subscription persistence
662             */
663            public void setSubscriptionPersistence(
664                    SubscriptionPersistence subscriptionPersistence) {
665                    this.subscriptionPersistence = subscriptionPersistence;
666            }
667    
668            /**
669             * Returns the user local service.
670             *
671             * @return the user local service
672             */
673            public com.liferay.portal.kernel.service.UserLocalService getUserLocalService() {
674                    return userLocalService;
675            }
676    
677            /**
678             * Sets the user local service.
679             *
680             * @param userLocalService the user local service
681             */
682            public void setUserLocalService(
683                    com.liferay.portal.kernel.service.UserLocalService userLocalService) {
684                    this.userLocalService = userLocalService;
685            }
686    
687            /**
688             * Returns the user persistence.
689             *
690             * @return the user persistence
691             */
692            public UserPersistence getUserPersistence() {
693                    return userPersistence;
694            }
695    
696            /**
697             * Sets the user persistence.
698             *
699             * @param userPersistence the user persistence
700             */
701            public void setUserPersistence(UserPersistence userPersistence) {
702                    this.userPersistence = userPersistence;
703            }
704    
705            /**
706             * Returns the user finder.
707             *
708             * @return the user finder
709             */
710            public UserFinder getUserFinder() {
711                    return userFinder;
712            }
713    
714            /**
715             * Sets the user finder.
716             *
717             * @param userFinder the user finder
718             */
719            public void setUserFinder(UserFinder userFinder) {
720                    this.userFinder = userFinder;
721            }
722    
723            /**
724             * Returns the workflow instance link local service.
725             *
726             * @return the workflow instance link local service
727             */
728            public com.liferay.portal.kernel.service.WorkflowInstanceLinkLocalService getWorkflowInstanceLinkLocalService() {
729                    return workflowInstanceLinkLocalService;
730            }
731    
732            /**
733             * Sets the workflow instance link local service.
734             *
735             * @param workflowInstanceLinkLocalService the workflow instance link local service
736             */
737            public void setWorkflowInstanceLinkLocalService(
738                    com.liferay.portal.kernel.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService) {
739                    this.workflowInstanceLinkLocalService = workflowInstanceLinkLocalService;
740            }
741    
742            /**
743             * Returns the workflow instance link persistence.
744             *
745             * @return the workflow instance link persistence
746             */
747            public WorkflowInstanceLinkPersistence getWorkflowInstanceLinkPersistence() {
748                    return workflowInstanceLinkPersistence;
749            }
750    
751            /**
752             * Sets the workflow instance link persistence.
753             *
754             * @param workflowInstanceLinkPersistence the workflow instance link persistence
755             */
756            public void setWorkflowInstanceLinkPersistence(
757                    WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence) {
758                    this.workflowInstanceLinkPersistence = workflowInstanceLinkPersistence;
759            }
760    
761            /**
762             * Returns the asset entry local service.
763             *
764             * @return the asset entry local service
765             */
766            public com.liferay.asset.kernel.service.AssetEntryLocalService getAssetEntryLocalService() {
767                    return assetEntryLocalService;
768            }
769    
770            /**
771             * Sets the asset entry local service.
772             *
773             * @param assetEntryLocalService the asset entry local service
774             */
775            public void setAssetEntryLocalService(
776                    com.liferay.asset.kernel.service.AssetEntryLocalService assetEntryLocalService) {
777                    this.assetEntryLocalService = assetEntryLocalService;
778            }
779    
780            /**
781             * Returns the asset entry persistence.
782             *
783             * @return the asset entry persistence
784             */
785            public AssetEntryPersistence getAssetEntryPersistence() {
786                    return assetEntryPersistence;
787            }
788    
789            /**
790             * Sets the asset entry persistence.
791             *
792             * @param assetEntryPersistence the asset entry persistence
793             */
794            public void setAssetEntryPersistence(
795                    AssetEntryPersistence assetEntryPersistence) {
796                    this.assetEntryPersistence = assetEntryPersistence;
797            }
798    
799            /**
800             * Returns the asset entry finder.
801             *
802             * @return the asset entry finder
803             */
804            public AssetEntryFinder getAssetEntryFinder() {
805                    return assetEntryFinder;
806            }
807    
808            /**
809             * Sets the asset entry finder.
810             *
811             * @param assetEntryFinder the asset entry finder
812             */
813            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
814                    this.assetEntryFinder = assetEntryFinder;
815            }
816    
817            /**
818             * Returns the message boards category local service.
819             *
820             * @return the message boards category local service
821             */
822            public com.liferay.message.boards.kernel.service.MBCategoryLocalService getMBCategoryLocalService() {
823                    return mbCategoryLocalService;
824            }
825    
826            /**
827             * Sets the message boards category local service.
828             *
829             * @param mbCategoryLocalService the message boards category local service
830             */
831            public void setMBCategoryLocalService(
832                    com.liferay.message.boards.kernel.service.MBCategoryLocalService mbCategoryLocalService) {
833                    this.mbCategoryLocalService = mbCategoryLocalService;
834            }
835    
836            /**
837             * Returns the message boards category persistence.
838             *
839             * @return the message boards category persistence
840             */
841            public MBCategoryPersistence getMBCategoryPersistence() {
842                    return mbCategoryPersistence;
843            }
844    
845            /**
846             * Sets the message boards category persistence.
847             *
848             * @param mbCategoryPersistence the message boards category persistence
849             */
850            public void setMBCategoryPersistence(
851                    MBCategoryPersistence mbCategoryPersistence) {
852                    this.mbCategoryPersistence = mbCategoryPersistence;
853            }
854    
855            /**
856             * Returns the message boards category finder.
857             *
858             * @return the message boards category finder
859             */
860            public MBCategoryFinder getMBCategoryFinder() {
861                    return mbCategoryFinder;
862            }
863    
864            /**
865             * Sets the message boards category finder.
866             *
867             * @param mbCategoryFinder the message boards category finder
868             */
869            public void setMBCategoryFinder(MBCategoryFinder mbCategoryFinder) {
870                    this.mbCategoryFinder = mbCategoryFinder;
871            }
872    
873            /**
874             * Returns the message-boards message local service.
875             *
876             * @return the message-boards message local service
877             */
878            public com.liferay.message.boards.kernel.service.MBMessageLocalService getMBMessageLocalService() {
879                    return mbMessageLocalService;
880            }
881    
882            /**
883             * Sets the message-boards message local service.
884             *
885             * @param mbMessageLocalService the message-boards message local service
886             */
887            public void setMBMessageLocalService(
888                    com.liferay.message.boards.kernel.service.MBMessageLocalService mbMessageLocalService) {
889                    this.mbMessageLocalService = mbMessageLocalService;
890            }
891    
892            /**
893             * Returns the message-boards message persistence.
894             *
895             * @return the message-boards message persistence
896             */
897            public MBMessagePersistence getMBMessagePersistence() {
898                    return mbMessagePersistence;
899            }
900    
901            /**
902             * Sets the message-boards message persistence.
903             *
904             * @param mbMessagePersistence the message-boards message persistence
905             */
906            public void setMBMessagePersistence(
907                    MBMessagePersistence mbMessagePersistence) {
908                    this.mbMessagePersistence = mbMessagePersistence;
909            }
910    
911            /**
912             * Returns the message-boards message finder.
913             *
914             * @return the message-boards message finder
915             */
916            public MBMessageFinder getMBMessageFinder() {
917                    return mbMessageFinder;
918            }
919    
920            /**
921             * Sets the message-boards message finder.
922             *
923             * @param mbMessageFinder the message-boards message finder
924             */
925            public void setMBMessageFinder(MBMessageFinder mbMessageFinder) {
926                    this.mbMessageFinder = mbMessageFinder;
927            }
928    
929            /**
930             * Returns the message boards stats user local service.
931             *
932             * @return the message boards stats user local service
933             */
934            public com.liferay.message.boards.kernel.service.MBStatsUserLocalService getMBStatsUserLocalService() {
935                    return mbStatsUserLocalService;
936            }
937    
938            /**
939             * Sets the message boards stats user local service.
940             *
941             * @param mbStatsUserLocalService the message boards stats user local service
942             */
943            public void setMBStatsUserLocalService(
944                    com.liferay.message.boards.kernel.service.MBStatsUserLocalService mbStatsUserLocalService) {
945                    this.mbStatsUserLocalService = mbStatsUserLocalService;
946            }
947    
948            /**
949             * Returns the message boards stats user persistence.
950             *
951             * @return the message boards stats user persistence
952             */
953            public MBStatsUserPersistence getMBStatsUserPersistence() {
954                    return mbStatsUserPersistence;
955            }
956    
957            /**
958             * Sets the message boards stats user persistence.
959             *
960             * @param mbStatsUserPersistence the message boards stats user persistence
961             */
962            public void setMBStatsUserPersistence(
963                    MBStatsUserPersistence mbStatsUserPersistence) {
964                    this.mbStatsUserPersistence = mbStatsUserPersistence;
965            }
966    
967            /**
968             * Returns the ratings stats local service.
969             *
970             * @return the ratings stats local service
971             */
972            public com.liferay.ratings.kernel.service.RatingsStatsLocalService getRatingsStatsLocalService() {
973                    return ratingsStatsLocalService;
974            }
975    
976            /**
977             * Sets the ratings stats local service.
978             *
979             * @param ratingsStatsLocalService the ratings stats local service
980             */
981            public void setRatingsStatsLocalService(
982                    com.liferay.ratings.kernel.service.RatingsStatsLocalService ratingsStatsLocalService) {
983                    this.ratingsStatsLocalService = ratingsStatsLocalService;
984            }
985    
986            /**
987             * Returns the ratings stats persistence.
988             *
989             * @return the ratings stats persistence
990             */
991            public RatingsStatsPersistence getRatingsStatsPersistence() {
992                    return ratingsStatsPersistence;
993            }
994    
995            /**
996             * Sets the ratings stats persistence.
997             *
998             * @param ratingsStatsPersistence the ratings stats persistence
999             */
1000            public void setRatingsStatsPersistence(
1001                    RatingsStatsPersistence ratingsStatsPersistence) {
1002                    this.ratingsStatsPersistence = ratingsStatsPersistence;
1003            }
1004    
1005            /**
1006             * Returns the ratings stats finder.
1007             *
1008             * @return the ratings stats finder
1009             */
1010            public RatingsStatsFinder getRatingsStatsFinder() {
1011                    return ratingsStatsFinder;
1012            }
1013    
1014            /**
1015             * Sets the ratings stats finder.
1016             *
1017             * @param ratingsStatsFinder the ratings stats finder
1018             */
1019            public void setRatingsStatsFinder(RatingsStatsFinder ratingsStatsFinder) {
1020                    this.ratingsStatsFinder = ratingsStatsFinder;
1021            }
1022    
1023            /**
1024             * Returns the trash entry local service.
1025             *
1026             * @return the trash entry local service
1027             */
1028            public com.liferay.trash.kernel.service.TrashEntryLocalService getTrashEntryLocalService() {
1029                    return trashEntryLocalService;
1030            }
1031    
1032            /**
1033             * Sets the trash entry local service.
1034             *
1035             * @param trashEntryLocalService the trash entry local service
1036             */
1037            public void setTrashEntryLocalService(
1038                    com.liferay.trash.kernel.service.TrashEntryLocalService trashEntryLocalService) {
1039                    this.trashEntryLocalService = trashEntryLocalService;
1040            }
1041    
1042            /**
1043             * Returns the trash entry persistence.
1044             *
1045             * @return the trash entry persistence
1046             */
1047            public TrashEntryPersistence getTrashEntryPersistence() {
1048                    return trashEntryPersistence;
1049            }
1050    
1051            /**
1052             * Sets the trash entry persistence.
1053             *
1054             * @param trashEntryPersistence the trash entry persistence
1055             */
1056            public void setTrashEntryPersistence(
1057                    TrashEntryPersistence trashEntryPersistence) {
1058                    this.trashEntryPersistence = trashEntryPersistence;
1059            }
1060    
1061            /**
1062             * Returns the trash version local service.
1063             *
1064             * @return the trash version local service
1065             */
1066            public com.liferay.trash.kernel.service.TrashVersionLocalService getTrashVersionLocalService() {
1067                    return trashVersionLocalService;
1068            }
1069    
1070            /**
1071             * Sets the trash version local service.
1072             *
1073             * @param trashVersionLocalService the trash version local service
1074             */
1075            public void setTrashVersionLocalService(
1076                    com.liferay.trash.kernel.service.TrashVersionLocalService trashVersionLocalService) {
1077                    this.trashVersionLocalService = trashVersionLocalService;
1078            }
1079    
1080            /**
1081             * Returns the trash version persistence.
1082             *
1083             * @return the trash version persistence
1084             */
1085            public TrashVersionPersistence getTrashVersionPersistence() {
1086                    return trashVersionPersistence;
1087            }
1088    
1089            /**
1090             * Sets the trash version persistence.
1091             *
1092             * @param trashVersionPersistence the trash version persistence
1093             */
1094            public void setTrashVersionPersistence(
1095                    TrashVersionPersistence trashVersionPersistence) {
1096                    this.trashVersionPersistence = trashVersionPersistence;
1097            }
1098    
1099            /**
1100             * Returns the message boards thread flag local service.
1101             *
1102             * @return the message boards thread flag local service
1103             */
1104            public com.liferay.message.boards.kernel.service.MBThreadFlagLocalService getMBThreadFlagLocalService() {
1105                    return mbThreadFlagLocalService;
1106            }
1107    
1108            /**
1109             * Sets the message boards thread flag local service.
1110             *
1111             * @param mbThreadFlagLocalService the message boards thread flag local service
1112             */
1113            public void setMBThreadFlagLocalService(
1114                    com.liferay.message.boards.kernel.service.MBThreadFlagLocalService mbThreadFlagLocalService) {
1115                    this.mbThreadFlagLocalService = mbThreadFlagLocalService;
1116            }
1117    
1118            /**
1119             * Returns the message boards thread flag persistence.
1120             *
1121             * @return the message boards thread flag persistence
1122             */
1123            public MBThreadFlagPersistence getMBThreadFlagPersistence() {
1124                    return mbThreadFlagPersistence;
1125            }
1126    
1127            /**
1128             * Sets the message boards thread flag persistence.
1129             *
1130             * @param mbThreadFlagPersistence the message boards thread flag persistence
1131             */
1132            public void setMBThreadFlagPersistence(
1133                    MBThreadFlagPersistence mbThreadFlagPersistence) {
1134                    this.mbThreadFlagPersistence = mbThreadFlagPersistence;
1135            }
1136    
1137            public void afterPropertiesSet() {
1138                    persistedModelLocalServiceRegistry.register("com.liferay.message.boards.kernel.model.MBThread",
1139                            mbThreadLocalService);
1140            }
1141    
1142            public void destroy() {
1143                    persistedModelLocalServiceRegistry.unregister(
1144                            "com.liferay.message.boards.kernel.model.MBThread");
1145            }
1146    
1147            /**
1148             * Returns the OSGi service identifier.
1149             *
1150             * @return the OSGi service identifier
1151             */
1152            @Override
1153            public String getOSGiServiceIdentifier() {
1154                    return MBThreadLocalService.class.getName();
1155            }
1156    
1157            protected Class<?> getModelClass() {
1158                    return MBThread.class;
1159            }
1160    
1161            protected String getModelClassName() {
1162                    return MBThread.class.getName();
1163            }
1164    
1165            /**
1166             * Performs a SQL query.
1167             *
1168             * @param sql the sql query
1169             */
1170            protected void runSQL(String sql) {
1171                    try {
1172                            DataSource dataSource = mbThreadPersistence.getDataSource();
1173    
1174                            DB db = DBManagerUtil.getDB();
1175    
1176                            sql = db.buildSQL(sql);
1177                            sql = PortalUtil.transformSQL(sql);
1178    
1179                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1180                                            sql);
1181    
1182                            sqlUpdate.update();
1183                    }
1184                    catch (Exception e) {
1185                            throw new SystemException(e);
1186                    }
1187            }
1188    
1189            @BeanReference(type = MBThreadLocalService.class)
1190            protected MBThreadLocalService mbThreadLocalService;
1191            @BeanReference(type = MBThreadPersistence.class)
1192            protected MBThreadPersistence mbThreadPersistence;
1193            @BeanReference(type = MBThreadFinder.class)
1194            protected MBThreadFinder mbThreadFinder;
1195            @BeanReference(type = com.liferay.counter.kernel.service.CounterLocalService.class)
1196            protected com.liferay.counter.kernel.service.CounterLocalService counterLocalService;
1197            @BeanReference(type = com.liferay.portal.kernel.service.GroupLocalService.class)
1198            protected com.liferay.portal.kernel.service.GroupLocalService groupLocalService;
1199            @BeanReference(type = GroupPersistence.class)
1200            protected GroupPersistence groupPersistence;
1201            @BeanReference(type = GroupFinder.class)
1202            protected GroupFinder groupFinder;
1203            @BeanReference(type = com.liferay.portal.kernel.service.ResourceLocalService.class)
1204            protected com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService;
1205            @BeanReference(type = com.liferay.portal.kernel.service.SubscriptionLocalService.class)
1206            protected com.liferay.portal.kernel.service.SubscriptionLocalService subscriptionLocalService;
1207            @BeanReference(type = SubscriptionPersistence.class)
1208            protected SubscriptionPersistence subscriptionPersistence;
1209            @BeanReference(type = com.liferay.portal.kernel.service.UserLocalService.class)
1210            protected com.liferay.portal.kernel.service.UserLocalService userLocalService;
1211            @BeanReference(type = UserPersistence.class)
1212            protected UserPersistence userPersistence;
1213            @BeanReference(type = UserFinder.class)
1214            protected UserFinder userFinder;
1215            @BeanReference(type = com.liferay.portal.kernel.service.WorkflowInstanceLinkLocalService.class)
1216            protected com.liferay.portal.kernel.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService;
1217            @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1218            protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1219            @BeanReference(type = com.liferay.asset.kernel.service.AssetEntryLocalService.class)
1220            protected com.liferay.asset.kernel.service.AssetEntryLocalService assetEntryLocalService;
1221            @BeanReference(type = AssetEntryPersistence.class)
1222            protected AssetEntryPersistence assetEntryPersistence;
1223            @BeanReference(type = AssetEntryFinder.class)
1224            protected AssetEntryFinder assetEntryFinder;
1225            @BeanReference(type = com.liferay.message.boards.kernel.service.MBCategoryLocalService.class)
1226            protected com.liferay.message.boards.kernel.service.MBCategoryLocalService mbCategoryLocalService;
1227            @BeanReference(type = MBCategoryPersistence.class)
1228            protected MBCategoryPersistence mbCategoryPersistence;
1229            @BeanReference(type = MBCategoryFinder.class)
1230            protected MBCategoryFinder mbCategoryFinder;
1231            @BeanReference(type = com.liferay.message.boards.kernel.service.MBMessageLocalService.class)
1232            protected com.liferay.message.boards.kernel.service.MBMessageLocalService mbMessageLocalService;
1233            @BeanReference(type = MBMessagePersistence.class)
1234            protected MBMessagePersistence mbMessagePersistence;
1235            @BeanReference(type = MBMessageFinder.class)
1236            protected MBMessageFinder mbMessageFinder;
1237            @BeanReference(type = com.liferay.message.boards.kernel.service.MBStatsUserLocalService.class)
1238            protected com.liferay.message.boards.kernel.service.MBStatsUserLocalService mbStatsUserLocalService;
1239            @BeanReference(type = MBStatsUserPersistence.class)
1240            protected MBStatsUserPersistence mbStatsUserPersistence;
1241            @BeanReference(type = com.liferay.ratings.kernel.service.RatingsStatsLocalService.class)
1242            protected com.liferay.ratings.kernel.service.RatingsStatsLocalService ratingsStatsLocalService;
1243            @BeanReference(type = RatingsStatsPersistence.class)
1244            protected RatingsStatsPersistence ratingsStatsPersistence;
1245            @BeanReference(type = RatingsStatsFinder.class)
1246            protected RatingsStatsFinder ratingsStatsFinder;
1247            @BeanReference(type = com.liferay.trash.kernel.service.TrashEntryLocalService.class)
1248            protected com.liferay.trash.kernel.service.TrashEntryLocalService trashEntryLocalService;
1249            @BeanReference(type = TrashEntryPersistence.class)
1250            protected TrashEntryPersistence trashEntryPersistence;
1251            @BeanReference(type = com.liferay.trash.kernel.service.TrashVersionLocalService.class)
1252            protected com.liferay.trash.kernel.service.TrashVersionLocalService trashVersionLocalService;
1253            @BeanReference(type = TrashVersionPersistence.class)
1254            protected TrashVersionPersistence trashVersionPersistence;
1255            @BeanReference(type = com.liferay.message.boards.kernel.service.MBThreadFlagLocalService.class)
1256            protected com.liferay.message.boards.kernel.service.MBThreadFlagLocalService mbThreadFlagLocalService;
1257            @BeanReference(type = MBThreadFlagPersistence.class)
1258            protected MBThreadFlagPersistence mbThreadFlagPersistence;
1259            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1260            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1261    }