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.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    /**
085     * Provides the base implementation for the message boards thread local service.
086     *
087     * <p>
088     * 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}.
089     * </p>
090     *
091     * @author Brian Wing Shun Chan
092     * @see com.liferay.portlet.messageboards.service.impl.MBThreadLocalServiceImpl
093     * @see com.liferay.portlet.messageboards.service.MBThreadLocalServiceUtil
094     * @generated
095     */
096    @ProviderType
097    public abstract class MBThreadLocalServiceBaseImpl extends BaseLocalServiceImpl
098            implements MBThreadLocalService, IdentifiableOSGiService {
099            /*
100             * NOTE FOR DEVELOPERS:
101             *
102             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.messageboards.service.MBThreadLocalServiceUtil} to access the message boards thread local service.
103             */
104    
105            /**
106             * Adds the message boards thread to the database. Also notifies the appropriate model listeners.
107             *
108             * @param mbThread the message boards thread
109             * @return the message boards thread that was added
110             */
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            /**
120             * Creates a new message boards thread with the primary key. Does not add the message boards thread to the database.
121             *
122             * @param threadId the primary key for the new message boards thread
123             * @return the new message boards thread
124             */
125            @Override
126            public MBThread createMBThread(long threadId) {
127                    return mbThreadPersistence.create(threadId);
128            }
129    
130            /**
131             * Deletes the message boards thread with the primary key from the database. Also notifies the appropriate model listeners.
132             *
133             * @param threadId the primary key of the message boards thread
134             * @return the message boards thread that was removed
135             * @throws PortalException if a message boards thread with the primary key could not be found
136             */
137            @Indexable(type = IndexableType.DELETE)
138            @Override
139            public MBThread deleteMBThread(long threadId) throws PortalException {
140                    return mbThreadPersistence.remove(threadId);
141            }
142    
143            /**
144             * Deletes the message boards thread from the database. Also notifies the appropriate model listeners.
145             *
146             * @param mbThread the message boards thread
147             * @return the message boards thread that was removed
148             */
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            /**
164             * Performs a dynamic query on the database and returns the matching rows.
165             *
166             * @param dynamicQuery the dynamic query
167             * @return the matching rows
168             */
169            @Override
170            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
171                    return mbThreadPersistence.findWithDynamicQuery(dynamicQuery);
172            }
173    
174            /**
175             * Performs a dynamic query on the database and returns a range of the matching rows.
176             *
177             * <p>
178             * 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.
179             * </p>
180             *
181             * @param dynamicQuery the dynamic query
182             * @param start the lower bound of the range of model instances
183             * @param end the upper bound of the range of model instances (not inclusive)
184             * @return the range of matching rows
185             */
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            /**
193             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
194             *
195             * <p>
196             * 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.
197             * </p>
198             *
199             * @param dynamicQuery the dynamic query
200             * @param start the lower bound of the range of model instances
201             * @param end the upper bound of the range of model instances (not inclusive)
202             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
203             * @return the ordered range of matching rows
204             */
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            /**
213             * Returns the number of rows matching the dynamic query.
214             *
215             * @param dynamicQuery the dynamic query
216             * @return the number of rows matching the dynamic query
217             */
218            @Override
219            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
220                    return mbThreadPersistence.countWithDynamicQuery(dynamicQuery);
221            }
222    
223            /**
224             * Returns the number of rows matching the dynamic query.
225             *
226             * @param dynamicQuery the dynamic query
227             * @param projection the projection to apply to the query
228             * @return the number of rows matching the dynamic query
229             */
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            /**
243             * Returns the message boards thread matching the UUID and group.
244             *
245             * @param uuid the message boards thread's UUID
246             * @param groupId the primary key of the group
247             * @return the matching message boards thread, or <code>null</code> if a matching message boards thread could not be found
248             */
249            @Override
250            public MBThread fetchMBThreadByUuidAndGroupId(String uuid, long groupId) {
251                    return mbThreadPersistence.fetchByUUID_G(uuid, groupId);
252            }
253    
254            /**
255             * Returns the message boards thread with the primary key.
256             *
257             * @param threadId the primary key of the message boards thread
258             * @return the message boards thread
259             * @throws PortalException if a message boards thread with the primary key could not be found
260             */
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            /**
381             * @throws PortalException
382             */
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            /**
396             * Returns all the message boards threads matching the UUID and company.
397             *
398             * @param uuid the UUID of the message boards threads
399             * @param companyId the primary key of the company
400             * @return the matching message boards threads, or an empty list if no matches were found
401             */
402            @Override
403            public List<MBThread> getMBThreadsByUuidAndCompanyId(String uuid,
404                    long companyId) {
405                    return mbThreadPersistence.findByUuid_C(uuid, companyId);
406            }
407    
408            /**
409             * Returns a range of message boards threads matching the UUID and company.
410             *
411             * @param uuid the UUID of the message boards threads
412             * @param companyId the primary key of the company
413             * @param start the lower bound of the range of message boards threads
414             * @param end the upper bound of the range of message boards threads (not inclusive)
415             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
416             * @return the range of matching message boards threads, or an empty list if no matches were found
417             */
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            /**
427             * Returns the message boards thread matching the UUID and group.
428             *
429             * @param uuid the message boards thread's UUID
430             * @param groupId the primary key of the group
431             * @return the matching message boards thread
432             * @throws PortalException if a matching message boards thread could not be found
433             */
434            @Override
435            public MBThread getMBThreadByUuidAndGroupId(String uuid, long groupId)
436                    throws PortalException {
437                    return mbThreadPersistence.findByUUID_G(uuid, groupId);
438            }
439    
440            /**
441             * Returns a range of all the message boards threads.
442             *
443             * <p>
444             * 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.
445             * </p>
446             *
447             * @param start the lower bound of the range of message boards threads
448             * @param end the upper bound of the range of message boards threads (not inclusive)
449             * @return the range of message boards threads
450             */
451            @Override
452            public List<MBThread> getMBThreads(int start, int end) {
453                    return mbThreadPersistence.findAll(start, end);
454            }
455    
456            /**
457             * Returns the number of message boards threads.
458             *
459             * @return the number of message boards threads
460             */
461            @Override
462            public int getMBThreadsCount() {
463                    return mbThreadPersistence.countAll();
464            }
465    
466            /**
467             * Updates the message boards thread in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
468             *
469             * @param mbThread the message boards thread
470             * @return the message boards thread that was updated
471             */
472            @Indexable(type = IndexableType.REINDEX)
473            @Override
474            public MBThread updateMBThread(MBThread mbThread) {
475                    return mbThreadPersistence.update(mbThread);
476            }
477    
478            /**
479             * Returns the message boards thread local service.
480             *
481             * @return the message boards thread local service
482             */
483            public MBThreadLocalService getMBThreadLocalService() {
484                    return mbThreadLocalService;
485            }
486    
487            /**
488             * Sets the message boards thread local service.
489             *
490             * @param mbThreadLocalService the message boards thread local service
491             */
492            public void setMBThreadLocalService(
493                    MBThreadLocalService mbThreadLocalService) {
494                    this.mbThreadLocalService = mbThreadLocalService;
495            }
496    
497            /**
498             * Returns the message boards thread persistence.
499             *
500             * @return the message boards thread persistence
501             */
502            public MBThreadPersistence getMBThreadPersistence() {
503                    return mbThreadPersistence;
504            }
505    
506            /**
507             * Sets the message boards thread persistence.
508             *
509             * @param mbThreadPersistence the message boards thread persistence
510             */
511            public void setMBThreadPersistence(MBThreadPersistence mbThreadPersistence) {
512                    this.mbThreadPersistence = mbThreadPersistence;
513            }
514    
515            /**
516             * Returns the message boards thread finder.
517             *
518             * @return the message boards thread finder
519             */
520            public MBThreadFinder getMBThreadFinder() {
521                    return mbThreadFinder;
522            }
523    
524            /**
525             * Sets the message boards thread finder.
526             *
527             * @param mbThreadFinder the message boards thread finder
528             */
529            public void setMBThreadFinder(MBThreadFinder mbThreadFinder) {
530                    this.mbThreadFinder = mbThreadFinder;
531            }
532    
533            /**
534             * Returns the counter local service.
535             *
536             * @return the counter local service
537             */
538            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
539                    return counterLocalService;
540            }
541    
542            /**
543             * Sets the counter local service.
544             *
545             * @param counterLocalService the counter local service
546             */
547            public void setCounterLocalService(
548                    com.liferay.counter.service.CounterLocalService counterLocalService) {
549                    this.counterLocalService = counterLocalService;
550            }
551    
552            /**
553             * Returns the group local service.
554             *
555             * @return the group local service
556             */
557            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
558                    return groupLocalService;
559            }
560    
561            /**
562             * Sets the group local service.
563             *
564             * @param groupLocalService the group local service
565             */
566            public void setGroupLocalService(
567                    com.liferay.portal.service.GroupLocalService groupLocalService) {
568                    this.groupLocalService = groupLocalService;
569            }
570    
571            /**
572             * Returns the group persistence.
573             *
574             * @return the group persistence
575             */
576            public GroupPersistence getGroupPersistence() {
577                    return groupPersistence;
578            }
579    
580            /**
581             * Sets the group persistence.
582             *
583             * @param groupPersistence the group persistence
584             */
585            public void setGroupPersistence(GroupPersistence groupPersistence) {
586                    this.groupPersistence = groupPersistence;
587            }
588    
589            /**
590             * Returns the group finder.
591             *
592             * @return the group finder
593             */
594            public GroupFinder getGroupFinder() {
595                    return groupFinder;
596            }
597    
598            /**
599             * Sets the group finder.
600             *
601             * @param groupFinder the group finder
602             */
603            public void setGroupFinder(GroupFinder groupFinder) {
604                    this.groupFinder = groupFinder;
605            }
606    
607            /**
608             * Returns the resource local service.
609             *
610             * @return the resource local service
611             */
612            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
613                    return resourceLocalService;
614            }
615    
616            /**
617             * Sets the resource local service.
618             *
619             * @param resourceLocalService the resource local service
620             */
621            public void setResourceLocalService(
622                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
623                    this.resourceLocalService = resourceLocalService;
624            }
625    
626            /**
627             * Returns the subscription local service.
628             *
629             * @return the subscription local service
630             */
631            public com.liferay.portal.service.SubscriptionLocalService getSubscriptionLocalService() {
632                    return subscriptionLocalService;
633            }
634    
635            /**
636             * Sets the subscription local service.
637             *
638             * @param subscriptionLocalService the subscription local service
639             */
640            public void setSubscriptionLocalService(
641                    com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService) {
642                    this.subscriptionLocalService = subscriptionLocalService;
643            }
644    
645            /**
646             * Returns the subscription persistence.
647             *
648             * @return the subscription persistence
649             */
650            public SubscriptionPersistence getSubscriptionPersistence() {
651                    return subscriptionPersistence;
652            }
653    
654            /**
655             * Sets the subscription persistence.
656             *
657             * @param subscriptionPersistence the subscription persistence
658             */
659            public void setSubscriptionPersistence(
660                    SubscriptionPersistence subscriptionPersistence) {
661                    this.subscriptionPersistence = subscriptionPersistence;
662            }
663    
664            /**
665             * Returns the user local service.
666             *
667             * @return the user local service
668             */
669            public com.liferay.portal.service.UserLocalService getUserLocalService() {
670                    return userLocalService;
671            }
672    
673            /**
674             * Sets the user local service.
675             *
676             * @param userLocalService the user local service
677             */
678            public void setUserLocalService(
679                    com.liferay.portal.service.UserLocalService userLocalService) {
680                    this.userLocalService = userLocalService;
681            }
682    
683            /**
684             * Returns the user persistence.
685             *
686             * @return the user persistence
687             */
688            public UserPersistence getUserPersistence() {
689                    return userPersistence;
690            }
691    
692            /**
693             * Sets the user persistence.
694             *
695             * @param userPersistence the user persistence
696             */
697            public void setUserPersistence(UserPersistence userPersistence) {
698                    this.userPersistence = userPersistence;
699            }
700    
701            /**
702             * Returns the user finder.
703             *
704             * @return the user finder
705             */
706            public UserFinder getUserFinder() {
707                    return userFinder;
708            }
709    
710            /**
711             * Sets the user finder.
712             *
713             * @param userFinder the user finder
714             */
715            public void setUserFinder(UserFinder userFinder) {
716                    this.userFinder = userFinder;
717            }
718    
719            /**
720             * Returns the workflow instance link local service.
721             *
722             * @return the workflow instance link local service
723             */
724            public com.liferay.portal.service.WorkflowInstanceLinkLocalService getWorkflowInstanceLinkLocalService() {
725                    return workflowInstanceLinkLocalService;
726            }
727    
728            /**
729             * Sets the workflow instance link local service.
730             *
731             * @param workflowInstanceLinkLocalService the workflow instance link local service
732             */
733            public void setWorkflowInstanceLinkLocalService(
734                    com.liferay.portal.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService) {
735                    this.workflowInstanceLinkLocalService = workflowInstanceLinkLocalService;
736            }
737    
738            /**
739             * Returns the workflow instance link persistence.
740             *
741             * @return the workflow instance link persistence
742             */
743            public WorkflowInstanceLinkPersistence getWorkflowInstanceLinkPersistence() {
744                    return workflowInstanceLinkPersistence;
745            }
746    
747            /**
748             * Sets the workflow instance link persistence.
749             *
750             * @param workflowInstanceLinkPersistence the workflow instance link persistence
751             */
752            public void setWorkflowInstanceLinkPersistence(
753                    WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence) {
754                    this.workflowInstanceLinkPersistence = workflowInstanceLinkPersistence;
755            }
756    
757            /**
758             * Returns the asset entry local service.
759             *
760             * @return the asset entry local service
761             */
762            public com.liferay.portlet.asset.service.AssetEntryLocalService getAssetEntryLocalService() {
763                    return assetEntryLocalService;
764            }
765    
766            /**
767             * Sets the asset entry local service.
768             *
769             * @param assetEntryLocalService the asset entry local service
770             */
771            public void setAssetEntryLocalService(
772                    com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService) {
773                    this.assetEntryLocalService = assetEntryLocalService;
774            }
775    
776            /**
777             * Returns the asset entry persistence.
778             *
779             * @return the asset entry persistence
780             */
781            public AssetEntryPersistence getAssetEntryPersistence() {
782                    return assetEntryPersistence;
783            }
784    
785            /**
786             * Sets the asset entry persistence.
787             *
788             * @param assetEntryPersistence the asset entry persistence
789             */
790            public void setAssetEntryPersistence(
791                    AssetEntryPersistence assetEntryPersistence) {
792                    this.assetEntryPersistence = assetEntryPersistence;
793            }
794    
795            /**
796             * Returns the asset entry finder.
797             *
798             * @return the asset entry finder
799             */
800            public AssetEntryFinder getAssetEntryFinder() {
801                    return assetEntryFinder;
802            }
803    
804            /**
805             * Sets the asset entry finder.
806             *
807             * @param assetEntryFinder the asset entry finder
808             */
809            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
810                    this.assetEntryFinder = assetEntryFinder;
811            }
812    
813            /**
814             * Returns the message boards category local service.
815             *
816             * @return the message boards category local service
817             */
818            public com.liferay.portlet.messageboards.service.MBCategoryLocalService getMBCategoryLocalService() {
819                    return mbCategoryLocalService;
820            }
821    
822            /**
823             * Sets the message boards category local service.
824             *
825             * @param mbCategoryLocalService the message boards category local service
826             */
827            public void setMBCategoryLocalService(
828                    com.liferay.portlet.messageboards.service.MBCategoryLocalService mbCategoryLocalService) {
829                    this.mbCategoryLocalService = mbCategoryLocalService;
830            }
831    
832            /**
833             * Returns the message boards category persistence.
834             *
835             * @return the message boards category persistence
836             */
837            public MBCategoryPersistence getMBCategoryPersistence() {
838                    return mbCategoryPersistence;
839            }
840    
841            /**
842             * Sets the message boards category persistence.
843             *
844             * @param mbCategoryPersistence the message boards category persistence
845             */
846            public void setMBCategoryPersistence(
847                    MBCategoryPersistence mbCategoryPersistence) {
848                    this.mbCategoryPersistence = mbCategoryPersistence;
849            }
850    
851            /**
852             * Returns the message boards category finder.
853             *
854             * @return the message boards category finder
855             */
856            public MBCategoryFinder getMBCategoryFinder() {
857                    return mbCategoryFinder;
858            }
859    
860            /**
861             * Sets the message boards category finder.
862             *
863             * @param mbCategoryFinder the message boards category finder
864             */
865            public void setMBCategoryFinder(MBCategoryFinder mbCategoryFinder) {
866                    this.mbCategoryFinder = mbCategoryFinder;
867            }
868    
869            /**
870             * Returns the message-boards message local service.
871             *
872             * @return the message-boards message local service
873             */
874            public com.liferay.portlet.messageboards.service.MBMessageLocalService getMBMessageLocalService() {
875                    return mbMessageLocalService;
876            }
877    
878            /**
879             * Sets the message-boards message local service.
880             *
881             * @param mbMessageLocalService the message-boards message local service
882             */
883            public void setMBMessageLocalService(
884                    com.liferay.portlet.messageboards.service.MBMessageLocalService mbMessageLocalService) {
885                    this.mbMessageLocalService = mbMessageLocalService;
886            }
887    
888            /**
889             * Returns the message-boards message persistence.
890             *
891             * @return the message-boards message persistence
892             */
893            public MBMessagePersistence getMBMessagePersistence() {
894                    return mbMessagePersistence;
895            }
896    
897            /**
898             * Sets the message-boards message persistence.
899             *
900             * @param mbMessagePersistence the message-boards message persistence
901             */
902            public void setMBMessagePersistence(
903                    MBMessagePersistence mbMessagePersistence) {
904                    this.mbMessagePersistence = mbMessagePersistence;
905            }
906    
907            /**
908             * Returns the message-boards message finder.
909             *
910             * @return the message-boards message finder
911             */
912            public MBMessageFinder getMBMessageFinder() {
913                    return mbMessageFinder;
914            }
915    
916            /**
917             * Sets the message-boards message finder.
918             *
919             * @param mbMessageFinder the message-boards message finder
920             */
921            public void setMBMessageFinder(MBMessageFinder mbMessageFinder) {
922                    this.mbMessageFinder = mbMessageFinder;
923            }
924    
925            /**
926             * Returns the message boards stats user local service.
927             *
928             * @return the message boards stats user local service
929             */
930            public com.liferay.portlet.messageboards.service.MBStatsUserLocalService getMBStatsUserLocalService() {
931                    return mbStatsUserLocalService;
932            }
933    
934            /**
935             * Sets the message boards stats user local service.
936             *
937             * @param mbStatsUserLocalService the message boards stats user local service
938             */
939            public void setMBStatsUserLocalService(
940                    com.liferay.portlet.messageboards.service.MBStatsUserLocalService mbStatsUserLocalService) {
941                    this.mbStatsUserLocalService = mbStatsUserLocalService;
942            }
943    
944            /**
945             * Returns the message boards stats user persistence.
946             *
947             * @return the message boards stats user persistence
948             */
949            public MBStatsUserPersistence getMBStatsUserPersistence() {
950                    return mbStatsUserPersistence;
951            }
952    
953            /**
954             * Sets the message boards stats user persistence.
955             *
956             * @param mbStatsUserPersistence the message boards stats user persistence
957             */
958            public void setMBStatsUserPersistence(
959                    MBStatsUserPersistence mbStatsUserPersistence) {
960                    this.mbStatsUserPersistence = mbStatsUserPersistence;
961            }
962    
963            /**
964             * Returns the ratings stats local service.
965             *
966             * @return the ratings stats local service
967             */
968            public com.liferay.portlet.ratings.service.RatingsStatsLocalService getRatingsStatsLocalService() {
969                    return ratingsStatsLocalService;
970            }
971    
972            /**
973             * Sets the ratings stats local service.
974             *
975             * @param ratingsStatsLocalService the ratings stats local service
976             */
977            public void setRatingsStatsLocalService(
978                    com.liferay.portlet.ratings.service.RatingsStatsLocalService ratingsStatsLocalService) {
979                    this.ratingsStatsLocalService = ratingsStatsLocalService;
980            }
981    
982            /**
983             * Returns the ratings stats persistence.
984             *
985             * @return the ratings stats persistence
986             */
987            public RatingsStatsPersistence getRatingsStatsPersistence() {
988                    return ratingsStatsPersistence;
989            }
990    
991            /**
992             * Sets the ratings stats persistence.
993             *
994             * @param ratingsStatsPersistence the ratings stats persistence
995             */
996            public void setRatingsStatsPersistence(
997                    RatingsStatsPersistence ratingsStatsPersistence) {
998                    this.ratingsStatsPersistence = ratingsStatsPersistence;
999            }
1000    
1001            /**
1002             * Returns the ratings stats finder.
1003             *
1004             * @return the ratings stats finder
1005             */
1006            public RatingsStatsFinder getRatingsStatsFinder() {
1007                    return ratingsStatsFinder;
1008            }
1009    
1010            /**
1011             * Sets the ratings stats finder.
1012             *
1013             * @param ratingsStatsFinder the ratings stats finder
1014             */
1015            public void setRatingsStatsFinder(RatingsStatsFinder ratingsStatsFinder) {
1016                    this.ratingsStatsFinder = ratingsStatsFinder;
1017            }
1018    
1019            /**
1020             * Returns the trash entry local service.
1021             *
1022             * @return the trash entry local service
1023             */
1024            public com.liferay.portlet.trash.service.TrashEntryLocalService getTrashEntryLocalService() {
1025                    return trashEntryLocalService;
1026            }
1027    
1028            /**
1029             * Sets the trash entry local service.
1030             *
1031             * @param trashEntryLocalService the trash entry local service
1032             */
1033            public void setTrashEntryLocalService(
1034                    com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService) {
1035                    this.trashEntryLocalService = trashEntryLocalService;
1036            }
1037    
1038            /**
1039             * Returns the trash entry persistence.
1040             *
1041             * @return the trash entry persistence
1042             */
1043            public TrashEntryPersistence getTrashEntryPersistence() {
1044                    return trashEntryPersistence;
1045            }
1046    
1047            /**
1048             * Sets the trash entry persistence.
1049             *
1050             * @param trashEntryPersistence the trash entry persistence
1051             */
1052            public void setTrashEntryPersistence(
1053                    TrashEntryPersistence trashEntryPersistence) {
1054                    this.trashEntryPersistence = trashEntryPersistence;
1055            }
1056    
1057            /**
1058             * Returns the trash version local service.
1059             *
1060             * @return the trash version local service
1061             */
1062            public com.liferay.portlet.trash.service.TrashVersionLocalService getTrashVersionLocalService() {
1063                    return trashVersionLocalService;
1064            }
1065    
1066            /**
1067             * Sets the trash version local service.
1068             *
1069             * @param trashVersionLocalService the trash version local service
1070             */
1071            public void setTrashVersionLocalService(
1072                    com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService) {
1073                    this.trashVersionLocalService = trashVersionLocalService;
1074            }
1075    
1076            /**
1077             * Returns the trash version persistence.
1078             *
1079             * @return the trash version persistence
1080             */
1081            public TrashVersionPersistence getTrashVersionPersistence() {
1082                    return trashVersionPersistence;
1083            }
1084    
1085            /**
1086             * Sets the trash version persistence.
1087             *
1088             * @param trashVersionPersistence the trash version persistence
1089             */
1090            public void setTrashVersionPersistence(
1091                    TrashVersionPersistence trashVersionPersistence) {
1092                    this.trashVersionPersistence = trashVersionPersistence;
1093            }
1094    
1095            /**
1096             * Returns the message boards thread flag local service.
1097             *
1098             * @return the message boards thread flag local service
1099             */
1100            public com.liferay.portlet.messageboards.service.MBThreadFlagLocalService getMBThreadFlagLocalService() {
1101                    return mbThreadFlagLocalService;
1102            }
1103    
1104            /**
1105             * Sets the message boards thread flag local service.
1106             *
1107             * @param mbThreadFlagLocalService the message boards thread flag local service
1108             */
1109            public void setMBThreadFlagLocalService(
1110                    com.liferay.portlet.messageboards.service.MBThreadFlagLocalService mbThreadFlagLocalService) {
1111                    this.mbThreadFlagLocalService = mbThreadFlagLocalService;
1112            }
1113    
1114            /**
1115             * Returns the message boards thread flag persistence.
1116             *
1117             * @return the message boards thread flag persistence
1118             */
1119            public MBThreadFlagPersistence getMBThreadFlagPersistence() {
1120                    return mbThreadFlagPersistence;
1121            }
1122    
1123            /**
1124             * Sets the message boards thread flag persistence.
1125             *
1126             * @param mbThreadFlagPersistence the message boards thread flag persistence
1127             */
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            /**
1144             * Returns the OSGi service identifier.
1145             *
1146             * @return the OSGi service identifier
1147             */
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            /**
1162             * Performs a SQL query.
1163             *
1164             * @param sql the sql query
1165             */
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    }