001    /**
002     * Copyright (c) 2000-2013 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 com.liferay.portal.kernel.bean.BeanReference;
018    import com.liferay.portal.kernel.bean.IdentifiableBean;
019    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
020    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
021    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
023    import com.liferay.portal.kernel.dao.orm.Projection;
024    import com.liferay.portal.kernel.exception.PortalException;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.search.Indexable;
027    import com.liferay.portal.kernel.search.IndexableType;
028    import com.liferay.portal.kernel.util.OrderByComparator;
029    import com.liferay.portal.model.PersistedModel;
030    import com.liferay.portal.service.BaseLocalServiceImpl;
031    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
032    import com.liferay.portal.service.persistence.UserFinder;
033    import com.liferay.portal.service.persistence.UserPersistence;
034    
035    import com.liferay.portlet.messageboards.model.MBDiscussion;
036    import com.liferay.portlet.messageboards.service.MBDiscussionLocalService;
037    import com.liferay.portlet.messageboards.service.persistence.MBBanPersistence;
038    import com.liferay.portlet.messageboards.service.persistence.MBCategoryFinder;
039    import com.liferay.portlet.messageboards.service.persistence.MBCategoryPersistence;
040    import com.liferay.portlet.messageboards.service.persistence.MBDiscussionPersistence;
041    import com.liferay.portlet.messageboards.service.persistence.MBMailingListPersistence;
042    import com.liferay.portlet.messageboards.service.persistence.MBMessageFinder;
043    import com.liferay.portlet.messageboards.service.persistence.MBMessagePersistence;
044    import com.liferay.portlet.messageboards.service.persistence.MBStatsUserPersistence;
045    import com.liferay.portlet.messageboards.service.persistence.MBThreadFinder;
046    import com.liferay.portlet.messageboards.service.persistence.MBThreadFlagPersistence;
047    import com.liferay.portlet.messageboards.service.persistence.MBThreadPersistence;
048    
049    import java.io.Serializable;
050    
051    import java.util.List;
052    
053    import javax.sql.DataSource;
054    
055    /**
056     * Provides the base implementation for the message boards discussion local service.
057     *
058     * <p>
059     * 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.MBDiscussionLocalServiceImpl}.
060     * </p>
061     *
062     * @author Brian Wing Shun Chan
063     * @see com.liferay.portlet.messageboards.service.impl.MBDiscussionLocalServiceImpl
064     * @see com.liferay.portlet.messageboards.service.MBDiscussionLocalServiceUtil
065     * @generated
066     */
067    public abstract class MBDiscussionLocalServiceBaseImpl
068            extends BaseLocalServiceImpl implements MBDiscussionLocalService,
069                    IdentifiableBean {
070            /*
071             * NOTE FOR DEVELOPERS:
072             *
073             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.messageboards.service.MBDiscussionLocalServiceUtil} to access the message boards discussion local service.
074             */
075    
076            /**
077             * Adds the message boards discussion to the database. Also notifies the appropriate model listeners.
078             *
079             * @param mbDiscussion the message boards discussion
080             * @return the message boards discussion that was added
081             * @throws SystemException if a system exception occurred
082             */
083            @Indexable(type = IndexableType.REINDEX)
084            @Override
085            public MBDiscussion addMBDiscussion(MBDiscussion mbDiscussion)
086                    throws SystemException {
087                    mbDiscussion.setNew(true);
088    
089                    return mbDiscussionPersistence.update(mbDiscussion);
090            }
091    
092            /**
093             * Creates a new message boards discussion with the primary key. Does not add the message boards discussion to the database.
094             *
095             * @param discussionId the primary key for the new message boards discussion
096             * @return the new message boards discussion
097             */
098            @Override
099            public MBDiscussion createMBDiscussion(long discussionId) {
100                    return mbDiscussionPersistence.create(discussionId);
101            }
102    
103            /**
104             * Deletes the message boards discussion with the primary key from the database. Also notifies the appropriate model listeners.
105             *
106             * @param discussionId the primary key of the message boards discussion
107             * @return the message boards discussion that was removed
108             * @throws PortalException if a message boards discussion with the primary key could not be found
109             * @throws SystemException if a system exception occurred
110             */
111            @Indexable(type = IndexableType.DELETE)
112            @Override
113            public MBDiscussion deleteMBDiscussion(long discussionId)
114                    throws PortalException, SystemException {
115                    return mbDiscussionPersistence.remove(discussionId);
116            }
117    
118            /**
119             * Deletes the message boards discussion from the database. Also notifies the appropriate model listeners.
120             *
121             * @param mbDiscussion the message boards discussion
122             * @return the message boards discussion that was removed
123             * @throws SystemException if a system exception occurred
124             */
125            @Indexable(type = IndexableType.DELETE)
126            @Override
127            public MBDiscussion deleteMBDiscussion(MBDiscussion mbDiscussion)
128                    throws SystemException {
129                    return mbDiscussionPersistence.remove(mbDiscussion);
130            }
131    
132            @Override
133            public DynamicQuery dynamicQuery() {
134                    Class<?> clazz = getClass();
135    
136                    return DynamicQueryFactoryUtil.forClass(MBDiscussion.class,
137                            clazz.getClassLoader());
138            }
139    
140            /**
141             * Performs a dynamic query on the database and returns the matching rows.
142             *
143             * @param dynamicQuery the dynamic query
144             * @return the matching rows
145             * @throws SystemException if a system exception occurred
146             */
147            @Override
148            @SuppressWarnings("rawtypes")
149            public List dynamicQuery(DynamicQuery dynamicQuery)
150                    throws SystemException {
151                    return mbDiscussionPersistence.findWithDynamicQuery(dynamicQuery);
152            }
153    
154            /**
155             * Performs a dynamic query on the database and returns a range of the matching rows.
156             *
157             * <p>
158             * 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.MBDiscussionModelImpl}. 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.
159             * </p>
160             *
161             * @param dynamicQuery the dynamic query
162             * @param start the lower bound of the range of model instances
163             * @param end the upper bound of the range of model instances (not inclusive)
164             * @return the range of matching rows
165             * @throws SystemException if a system exception occurred
166             */
167            @Override
168            @SuppressWarnings("rawtypes")
169            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
170                    throws SystemException {
171                    return mbDiscussionPersistence.findWithDynamicQuery(dynamicQuery,
172                            start, end);
173            }
174    
175            /**
176             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
177             *
178             * <p>
179             * 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.MBDiscussionModelImpl}. 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.
180             * </p>
181             *
182             * @param dynamicQuery the dynamic query
183             * @param start the lower bound of the range of model instances
184             * @param end the upper bound of the range of model instances (not inclusive)
185             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
186             * @return the ordered range of matching rows
187             * @throws SystemException if a system exception occurred
188             */
189            @Override
190            @SuppressWarnings("rawtypes")
191            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
192                    OrderByComparator orderByComparator) throws SystemException {
193                    return mbDiscussionPersistence.findWithDynamicQuery(dynamicQuery,
194                            start, end, orderByComparator);
195            }
196    
197            /**
198             * Returns the number of rows that match the dynamic query.
199             *
200             * @param dynamicQuery the dynamic query
201             * @return the number of rows that match the dynamic query
202             * @throws SystemException if a system exception occurred
203             */
204            @Override
205            public long dynamicQueryCount(DynamicQuery dynamicQuery)
206                    throws SystemException {
207                    return mbDiscussionPersistence.countWithDynamicQuery(dynamicQuery);
208            }
209    
210            /**
211             * Returns the number of rows that match the dynamic query.
212             *
213             * @param dynamicQuery the dynamic query
214             * @param projection the projection to apply to the query
215             * @return the number of rows that match the dynamic query
216             * @throws SystemException if a system exception occurred
217             */
218            @Override
219            public long dynamicQueryCount(DynamicQuery dynamicQuery,
220                    Projection projection) throws SystemException {
221                    return mbDiscussionPersistence.countWithDynamicQuery(dynamicQuery,
222                            projection);
223            }
224    
225            @Override
226            public MBDiscussion fetchMBDiscussion(long discussionId)
227                    throws SystemException {
228                    return mbDiscussionPersistence.fetchByPrimaryKey(discussionId);
229            }
230    
231            /**
232             * Returns the message boards discussion with the matching UUID and company.
233             *
234             * @param uuid the message boards discussion's UUID
235             * @param  companyId the primary key of the company
236             * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
237             * @throws SystemException if a system exception occurred
238             */
239            @Override
240            public MBDiscussion fetchMBDiscussionByUuidAndCompanyId(String uuid,
241                    long companyId) throws SystemException {
242                    return mbDiscussionPersistence.fetchByUuid_C_First(uuid, companyId, null);
243            }
244    
245            /**
246             * Returns the message boards discussion matching the UUID and group.
247             *
248             * @param uuid the message boards discussion's UUID
249             * @param groupId the primary key of the group
250             * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
251             * @throws SystemException if a system exception occurred
252             */
253            @Override
254            public MBDiscussion fetchMBDiscussionByUuidAndGroupId(String uuid,
255                    long groupId) throws SystemException {
256                    return mbDiscussionPersistence.fetchByUUID_G(uuid, groupId);
257            }
258    
259            /**
260             * Returns the message boards discussion with the primary key.
261             *
262             * @param discussionId the primary key of the message boards discussion
263             * @return the message boards discussion
264             * @throws PortalException if a message boards discussion with the primary key could not be found
265             * @throws SystemException if a system exception occurred
266             */
267            @Override
268            public MBDiscussion getMBDiscussion(long discussionId)
269                    throws PortalException, SystemException {
270                    return mbDiscussionPersistence.findByPrimaryKey(discussionId);
271            }
272    
273            @Override
274            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
275                    throws PortalException, SystemException {
276                    return mbDiscussionPersistence.findByPrimaryKey(primaryKeyObj);
277            }
278    
279            /**
280             * Returns the message boards discussion with the matching UUID and company.
281             *
282             * @param uuid the message boards discussion's UUID
283             * @param  companyId the primary key of the company
284             * @return the matching message boards discussion
285             * @throws PortalException if a matching message boards discussion could not be found
286             * @throws SystemException if a system exception occurred
287             */
288            @Override
289            public MBDiscussion getMBDiscussionByUuidAndCompanyId(String uuid,
290                    long companyId) throws PortalException, SystemException {
291                    return mbDiscussionPersistence.findByUuid_C_First(uuid, companyId, null);
292            }
293    
294            /**
295             * Returns the message boards discussion matching the UUID and group.
296             *
297             * @param uuid the message boards discussion's UUID
298             * @param groupId the primary key of the group
299             * @return the matching message boards discussion
300             * @throws PortalException if a matching message boards discussion could not be found
301             * @throws SystemException if a system exception occurred
302             */
303            @Override
304            public MBDiscussion getMBDiscussionByUuidAndGroupId(String uuid,
305                    long groupId) throws PortalException, SystemException {
306                    return mbDiscussionPersistence.findByUUID_G(uuid, groupId);
307            }
308    
309            /**
310             * Returns a range of all the message boards discussions.
311             *
312             * <p>
313             * 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.MBDiscussionModelImpl}. 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.
314             * </p>
315             *
316             * @param start the lower bound of the range of message boards discussions
317             * @param end the upper bound of the range of message boards discussions (not inclusive)
318             * @return the range of message boards discussions
319             * @throws SystemException if a system exception occurred
320             */
321            @Override
322            public List<MBDiscussion> getMBDiscussions(int start, int end)
323                    throws SystemException {
324                    return mbDiscussionPersistence.findAll(start, end);
325            }
326    
327            /**
328             * Returns the number of message boards discussions.
329             *
330             * @return the number of message boards discussions
331             * @throws SystemException if a system exception occurred
332             */
333            @Override
334            public int getMBDiscussionsCount() throws SystemException {
335                    return mbDiscussionPersistence.countAll();
336            }
337    
338            /**
339             * Updates the message boards discussion in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
340             *
341             * @param mbDiscussion the message boards discussion
342             * @return the message boards discussion that was updated
343             * @throws SystemException if a system exception occurred
344             */
345            @Indexable(type = IndexableType.REINDEX)
346            @Override
347            public MBDiscussion updateMBDiscussion(MBDiscussion mbDiscussion)
348                    throws SystemException {
349                    return mbDiscussionPersistence.update(mbDiscussion);
350            }
351    
352            /**
353             * Returns the message boards ban local service.
354             *
355             * @return the message boards ban local service
356             */
357            public com.liferay.portlet.messageboards.service.MBBanLocalService getMBBanLocalService() {
358                    return mbBanLocalService;
359            }
360    
361            /**
362             * Sets the message boards ban local service.
363             *
364             * @param mbBanLocalService the message boards ban local service
365             */
366            public void setMBBanLocalService(
367                    com.liferay.portlet.messageboards.service.MBBanLocalService mbBanLocalService) {
368                    this.mbBanLocalService = mbBanLocalService;
369            }
370    
371            /**
372             * Returns the message boards ban remote service.
373             *
374             * @return the message boards ban remote service
375             */
376            public com.liferay.portlet.messageboards.service.MBBanService getMBBanService() {
377                    return mbBanService;
378            }
379    
380            /**
381             * Sets the message boards ban remote service.
382             *
383             * @param mbBanService the message boards ban remote service
384             */
385            public void setMBBanService(
386                    com.liferay.portlet.messageboards.service.MBBanService mbBanService) {
387                    this.mbBanService = mbBanService;
388            }
389    
390            /**
391             * Returns the message boards ban persistence.
392             *
393             * @return the message boards ban persistence
394             */
395            public MBBanPersistence getMBBanPersistence() {
396                    return mbBanPersistence;
397            }
398    
399            /**
400             * Sets the message boards ban persistence.
401             *
402             * @param mbBanPersistence the message boards ban persistence
403             */
404            public void setMBBanPersistence(MBBanPersistence mbBanPersistence) {
405                    this.mbBanPersistence = mbBanPersistence;
406            }
407    
408            /**
409             * Returns the message boards category local service.
410             *
411             * @return the message boards category local service
412             */
413            public com.liferay.portlet.messageboards.service.MBCategoryLocalService getMBCategoryLocalService() {
414                    return mbCategoryLocalService;
415            }
416    
417            /**
418             * Sets the message boards category local service.
419             *
420             * @param mbCategoryLocalService the message boards category local service
421             */
422            public void setMBCategoryLocalService(
423                    com.liferay.portlet.messageboards.service.MBCategoryLocalService mbCategoryLocalService) {
424                    this.mbCategoryLocalService = mbCategoryLocalService;
425            }
426    
427            /**
428             * Returns the message boards category remote service.
429             *
430             * @return the message boards category remote service
431             */
432            public com.liferay.portlet.messageboards.service.MBCategoryService getMBCategoryService() {
433                    return mbCategoryService;
434            }
435    
436            /**
437             * Sets the message boards category remote service.
438             *
439             * @param mbCategoryService the message boards category remote service
440             */
441            public void setMBCategoryService(
442                    com.liferay.portlet.messageboards.service.MBCategoryService mbCategoryService) {
443                    this.mbCategoryService = mbCategoryService;
444            }
445    
446            /**
447             * Returns the message boards category persistence.
448             *
449             * @return the message boards category persistence
450             */
451            public MBCategoryPersistence getMBCategoryPersistence() {
452                    return mbCategoryPersistence;
453            }
454    
455            /**
456             * Sets the message boards category persistence.
457             *
458             * @param mbCategoryPersistence the message boards category persistence
459             */
460            public void setMBCategoryPersistence(
461                    MBCategoryPersistence mbCategoryPersistence) {
462                    this.mbCategoryPersistence = mbCategoryPersistence;
463            }
464    
465            /**
466             * Returns the message boards category finder.
467             *
468             * @return the message boards category finder
469             */
470            public MBCategoryFinder getMBCategoryFinder() {
471                    return mbCategoryFinder;
472            }
473    
474            /**
475             * Sets the message boards category finder.
476             *
477             * @param mbCategoryFinder the message boards category finder
478             */
479            public void setMBCategoryFinder(MBCategoryFinder mbCategoryFinder) {
480                    this.mbCategoryFinder = mbCategoryFinder;
481            }
482    
483            /**
484             * Returns the message boards discussion local service.
485             *
486             * @return the message boards discussion local service
487             */
488            public com.liferay.portlet.messageboards.service.MBDiscussionLocalService getMBDiscussionLocalService() {
489                    return mbDiscussionLocalService;
490            }
491    
492            /**
493             * Sets the message boards discussion local service.
494             *
495             * @param mbDiscussionLocalService the message boards discussion local service
496             */
497            public void setMBDiscussionLocalService(
498                    com.liferay.portlet.messageboards.service.MBDiscussionLocalService mbDiscussionLocalService) {
499                    this.mbDiscussionLocalService = mbDiscussionLocalService;
500            }
501    
502            /**
503             * Returns the message boards discussion persistence.
504             *
505             * @return the message boards discussion persistence
506             */
507            public MBDiscussionPersistence getMBDiscussionPersistence() {
508                    return mbDiscussionPersistence;
509            }
510    
511            /**
512             * Sets the message boards discussion persistence.
513             *
514             * @param mbDiscussionPersistence the message boards discussion persistence
515             */
516            public void setMBDiscussionPersistence(
517                    MBDiscussionPersistence mbDiscussionPersistence) {
518                    this.mbDiscussionPersistence = mbDiscussionPersistence;
519            }
520    
521            /**
522             * Returns the message boards mailing list local service.
523             *
524             * @return the message boards mailing list local service
525             */
526            public com.liferay.portlet.messageboards.service.MBMailingListLocalService getMBMailingListLocalService() {
527                    return mbMailingListLocalService;
528            }
529    
530            /**
531             * Sets the message boards mailing list local service.
532             *
533             * @param mbMailingListLocalService the message boards mailing list local service
534             */
535            public void setMBMailingListLocalService(
536                    com.liferay.portlet.messageboards.service.MBMailingListLocalService mbMailingListLocalService) {
537                    this.mbMailingListLocalService = mbMailingListLocalService;
538            }
539    
540            /**
541             * Returns the message boards mailing list persistence.
542             *
543             * @return the message boards mailing list persistence
544             */
545            public MBMailingListPersistence getMBMailingListPersistence() {
546                    return mbMailingListPersistence;
547            }
548    
549            /**
550             * Sets the message boards mailing list persistence.
551             *
552             * @param mbMailingListPersistence the message boards mailing list persistence
553             */
554            public void setMBMailingListPersistence(
555                    MBMailingListPersistence mbMailingListPersistence) {
556                    this.mbMailingListPersistence = mbMailingListPersistence;
557            }
558    
559            /**
560             * Returns the message-boards message local service.
561             *
562             * @return the message-boards message local service
563             */
564            public com.liferay.portlet.messageboards.service.MBMessageLocalService getMBMessageLocalService() {
565                    return mbMessageLocalService;
566            }
567    
568            /**
569             * Sets the message-boards message local service.
570             *
571             * @param mbMessageLocalService the message-boards message local service
572             */
573            public void setMBMessageLocalService(
574                    com.liferay.portlet.messageboards.service.MBMessageLocalService mbMessageLocalService) {
575                    this.mbMessageLocalService = mbMessageLocalService;
576            }
577    
578            /**
579             * Returns the message-boards message remote service.
580             *
581             * @return the message-boards message remote service
582             */
583            public com.liferay.portlet.messageboards.service.MBMessageService getMBMessageService() {
584                    return mbMessageService;
585            }
586    
587            /**
588             * Sets the message-boards message remote service.
589             *
590             * @param mbMessageService the message-boards message remote service
591             */
592            public void setMBMessageService(
593                    com.liferay.portlet.messageboards.service.MBMessageService mbMessageService) {
594                    this.mbMessageService = mbMessageService;
595            }
596    
597            /**
598             * Returns the message-boards message persistence.
599             *
600             * @return the message-boards message persistence
601             */
602            public MBMessagePersistence getMBMessagePersistence() {
603                    return mbMessagePersistence;
604            }
605    
606            /**
607             * Sets the message-boards message persistence.
608             *
609             * @param mbMessagePersistence the message-boards message persistence
610             */
611            public void setMBMessagePersistence(
612                    MBMessagePersistence mbMessagePersistence) {
613                    this.mbMessagePersistence = mbMessagePersistence;
614            }
615    
616            /**
617             * Returns the message-boards message finder.
618             *
619             * @return the message-boards message finder
620             */
621            public MBMessageFinder getMBMessageFinder() {
622                    return mbMessageFinder;
623            }
624    
625            /**
626             * Sets the message-boards message finder.
627             *
628             * @param mbMessageFinder the message-boards message finder
629             */
630            public void setMBMessageFinder(MBMessageFinder mbMessageFinder) {
631                    this.mbMessageFinder = mbMessageFinder;
632            }
633    
634            /**
635             * Returns the message boards stats user local service.
636             *
637             * @return the message boards stats user local service
638             */
639            public com.liferay.portlet.messageboards.service.MBStatsUserLocalService getMBStatsUserLocalService() {
640                    return mbStatsUserLocalService;
641            }
642    
643            /**
644             * Sets the message boards stats user local service.
645             *
646             * @param mbStatsUserLocalService the message boards stats user local service
647             */
648            public void setMBStatsUserLocalService(
649                    com.liferay.portlet.messageboards.service.MBStatsUserLocalService mbStatsUserLocalService) {
650                    this.mbStatsUserLocalService = mbStatsUserLocalService;
651            }
652    
653            /**
654             * Returns the message boards stats user persistence.
655             *
656             * @return the message boards stats user persistence
657             */
658            public MBStatsUserPersistence getMBStatsUserPersistence() {
659                    return mbStatsUserPersistence;
660            }
661    
662            /**
663             * Sets the message boards stats user persistence.
664             *
665             * @param mbStatsUserPersistence the message boards stats user persistence
666             */
667            public void setMBStatsUserPersistence(
668                    MBStatsUserPersistence mbStatsUserPersistence) {
669                    this.mbStatsUserPersistence = mbStatsUserPersistence;
670            }
671    
672            /**
673             * Returns the message boards thread local service.
674             *
675             * @return the message boards thread local service
676             */
677            public com.liferay.portlet.messageboards.service.MBThreadLocalService getMBThreadLocalService() {
678                    return mbThreadLocalService;
679            }
680    
681            /**
682             * Sets the message boards thread local service.
683             *
684             * @param mbThreadLocalService the message boards thread local service
685             */
686            public void setMBThreadLocalService(
687                    com.liferay.portlet.messageboards.service.MBThreadLocalService mbThreadLocalService) {
688                    this.mbThreadLocalService = mbThreadLocalService;
689            }
690    
691            /**
692             * Returns the message boards thread remote service.
693             *
694             * @return the message boards thread remote service
695             */
696            public com.liferay.portlet.messageboards.service.MBThreadService getMBThreadService() {
697                    return mbThreadService;
698            }
699    
700            /**
701             * Sets the message boards thread remote service.
702             *
703             * @param mbThreadService the message boards thread remote service
704             */
705            public void setMBThreadService(
706                    com.liferay.portlet.messageboards.service.MBThreadService mbThreadService) {
707                    this.mbThreadService = mbThreadService;
708            }
709    
710            /**
711             * Returns the message boards thread persistence.
712             *
713             * @return the message boards thread persistence
714             */
715            public MBThreadPersistence getMBThreadPersistence() {
716                    return mbThreadPersistence;
717            }
718    
719            /**
720             * Sets the message boards thread persistence.
721             *
722             * @param mbThreadPersistence the message boards thread persistence
723             */
724            public void setMBThreadPersistence(MBThreadPersistence mbThreadPersistence) {
725                    this.mbThreadPersistence = mbThreadPersistence;
726            }
727    
728            /**
729             * Returns the message boards thread finder.
730             *
731             * @return the message boards thread finder
732             */
733            public MBThreadFinder getMBThreadFinder() {
734                    return mbThreadFinder;
735            }
736    
737            /**
738             * Sets the message boards thread finder.
739             *
740             * @param mbThreadFinder the message boards thread finder
741             */
742            public void setMBThreadFinder(MBThreadFinder mbThreadFinder) {
743                    this.mbThreadFinder = mbThreadFinder;
744            }
745    
746            /**
747             * Returns the message boards thread flag local service.
748             *
749             * @return the message boards thread flag local service
750             */
751            public com.liferay.portlet.messageboards.service.MBThreadFlagLocalService getMBThreadFlagLocalService() {
752                    return mbThreadFlagLocalService;
753            }
754    
755            /**
756             * Sets the message boards thread flag local service.
757             *
758             * @param mbThreadFlagLocalService the message boards thread flag local service
759             */
760            public void setMBThreadFlagLocalService(
761                    com.liferay.portlet.messageboards.service.MBThreadFlagLocalService mbThreadFlagLocalService) {
762                    this.mbThreadFlagLocalService = mbThreadFlagLocalService;
763            }
764    
765            /**
766             * Returns the message boards thread flag persistence.
767             *
768             * @return the message boards thread flag persistence
769             */
770            public MBThreadFlagPersistence getMBThreadFlagPersistence() {
771                    return mbThreadFlagPersistence;
772            }
773    
774            /**
775             * Sets the message boards thread flag persistence.
776             *
777             * @param mbThreadFlagPersistence the message boards thread flag persistence
778             */
779            public void setMBThreadFlagPersistence(
780                    MBThreadFlagPersistence mbThreadFlagPersistence) {
781                    this.mbThreadFlagPersistence = mbThreadFlagPersistence;
782            }
783    
784            /**
785             * Returns the counter local service.
786             *
787             * @return the counter local service
788             */
789            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
790                    return counterLocalService;
791            }
792    
793            /**
794             * Sets the counter local service.
795             *
796             * @param counterLocalService the counter local service
797             */
798            public void setCounterLocalService(
799                    com.liferay.counter.service.CounterLocalService counterLocalService) {
800                    this.counterLocalService = counterLocalService;
801            }
802    
803            /**
804             * Returns the resource local service.
805             *
806             * @return the resource local service
807             */
808            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
809                    return resourceLocalService;
810            }
811    
812            /**
813             * Sets the resource local service.
814             *
815             * @param resourceLocalService the resource local service
816             */
817            public void setResourceLocalService(
818                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
819                    this.resourceLocalService = resourceLocalService;
820            }
821    
822            /**
823             * Returns the user local service.
824             *
825             * @return the user local service
826             */
827            public com.liferay.portal.service.UserLocalService getUserLocalService() {
828                    return userLocalService;
829            }
830    
831            /**
832             * Sets the user local service.
833             *
834             * @param userLocalService the user local service
835             */
836            public void setUserLocalService(
837                    com.liferay.portal.service.UserLocalService userLocalService) {
838                    this.userLocalService = userLocalService;
839            }
840    
841            /**
842             * Returns the user remote service.
843             *
844             * @return the user remote service
845             */
846            public com.liferay.portal.service.UserService getUserService() {
847                    return userService;
848            }
849    
850            /**
851             * Sets the user remote service.
852             *
853             * @param userService the user remote service
854             */
855            public void setUserService(
856                    com.liferay.portal.service.UserService userService) {
857                    this.userService = userService;
858            }
859    
860            /**
861             * Returns the user persistence.
862             *
863             * @return the user persistence
864             */
865            public UserPersistence getUserPersistence() {
866                    return userPersistence;
867            }
868    
869            /**
870             * Sets the user persistence.
871             *
872             * @param userPersistence the user persistence
873             */
874            public void setUserPersistence(UserPersistence userPersistence) {
875                    this.userPersistence = userPersistence;
876            }
877    
878            /**
879             * Returns the user finder.
880             *
881             * @return the user finder
882             */
883            public UserFinder getUserFinder() {
884                    return userFinder;
885            }
886    
887            /**
888             * Sets the user finder.
889             *
890             * @param userFinder the user finder
891             */
892            public void setUserFinder(UserFinder userFinder) {
893                    this.userFinder = userFinder;
894            }
895    
896            public void afterPropertiesSet() {
897                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.messageboards.model.MBDiscussion",
898                            mbDiscussionLocalService);
899            }
900    
901            public void destroy() {
902                    persistedModelLocalServiceRegistry.unregister(
903                            "com.liferay.portlet.messageboards.model.MBDiscussion");
904            }
905    
906            /**
907             * Returns the Spring bean ID for this bean.
908             *
909             * @return the Spring bean ID for this bean
910             */
911            @Override
912            public String getBeanIdentifier() {
913                    return _beanIdentifier;
914            }
915    
916            /**
917             * Sets the Spring bean ID for this bean.
918             *
919             * @param beanIdentifier the Spring bean ID for this bean
920             */
921            @Override
922            public void setBeanIdentifier(String beanIdentifier) {
923                    _beanIdentifier = beanIdentifier;
924            }
925    
926            protected Class<?> getModelClass() {
927                    return MBDiscussion.class;
928            }
929    
930            protected String getModelClassName() {
931                    return MBDiscussion.class.getName();
932            }
933    
934            /**
935             * Performs an SQL query.
936             *
937             * @param sql the sql query
938             */
939            protected void runSQL(String sql) throws SystemException {
940                    try {
941                            DataSource dataSource = mbDiscussionPersistence.getDataSource();
942    
943                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
944                                            sql, new int[0]);
945    
946                            sqlUpdate.update();
947                    }
948                    catch (Exception e) {
949                            throw new SystemException(e);
950                    }
951            }
952    
953            @BeanReference(type = com.liferay.portlet.messageboards.service.MBBanLocalService.class)
954            protected com.liferay.portlet.messageboards.service.MBBanLocalService mbBanLocalService;
955            @BeanReference(type = com.liferay.portlet.messageboards.service.MBBanService.class)
956            protected com.liferay.portlet.messageboards.service.MBBanService mbBanService;
957            @BeanReference(type = MBBanPersistence.class)
958            protected MBBanPersistence mbBanPersistence;
959            @BeanReference(type = com.liferay.portlet.messageboards.service.MBCategoryLocalService.class)
960            protected com.liferay.portlet.messageboards.service.MBCategoryLocalService mbCategoryLocalService;
961            @BeanReference(type = com.liferay.portlet.messageboards.service.MBCategoryService.class)
962            protected com.liferay.portlet.messageboards.service.MBCategoryService mbCategoryService;
963            @BeanReference(type = MBCategoryPersistence.class)
964            protected MBCategoryPersistence mbCategoryPersistence;
965            @BeanReference(type = MBCategoryFinder.class)
966            protected MBCategoryFinder mbCategoryFinder;
967            @BeanReference(type = com.liferay.portlet.messageboards.service.MBDiscussionLocalService.class)
968            protected com.liferay.portlet.messageboards.service.MBDiscussionLocalService mbDiscussionLocalService;
969            @BeanReference(type = MBDiscussionPersistence.class)
970            protected MBDiscussionPersistence mbDiscussionPersistence;
971            @BeanReference(type = com.liferay.portlet.messageboards.service.MBMailingListLocalService.class)
972            protected com.liferay.portlet.messageboards.service.MBMailingListLocalService mbMailingListLocalService;
973            @BeanReference(type = MBMailingListPersistence.class)
974            protected MBMailingListPersistence mbMailingListPersistence;
975            @BeanReference(type = com.liferay.portlet.messageboards.service.MBMessageLocalService.class)
976            protected com.liferay.portlet.messageboards.service.MBMessageLocalService mbMessageLocalService;
977            @BeanReference(type = com.liferay.portlet.messageboards.service.MBMessageService.class)
978            protected com.liferay.portlet.messageboards.service.MBMessageService mbMessageService;
979            @BeanReference(type = MBMessagePersistence.class)
980            protected MBMessagePersistence mbMessagePersistence;
981            @BeanReference(type = MBMessageFinder.class)
982            protected MBMessageFinder mbMessageFinder;
983            @BeanReference(type = com.liferay.portlet.messageboards.service.MBStatsUserLocalService.class)
984            protected com.liferay.portlet.messageboards.service.MBStatsUserLocalService mbStatsUserLocalService;
985            @BeanReference(type = MBStatsUserPersistence.class)
986            protected MBStatsUserPersistence mbStatsUserPersistence;
987            @BeanReference(type = com.liferay.portlet.messageboards.service.MBThreadLocalService.class)
988            protected com.liferay.portlet.messageboards.service.MBThreadLocalService mbThreadLocalService;
989            @BeanReference(type = com.liferay.portlet.messageboards.service.MBThreadService.class)
990            protected com.liferay.portlet.messageboards.service.MBThreadService mbThreadService;
991            @BeanReference(type = MBThreadPersistence.class)
992            protected MBThreadPersistence mbThreadPersistence;
993            @BeanReference(type = MBThreadFinder.class)
994            protected MBThreadFinder mbThreadFinder;
995            @BeanReference(type = com.liferay.portlet.messageboards.service.MBThreadFlagLocalService.class)
996            protected com.liferay.portlet.messageboards.service.MBThreadFlagLocalService mbThreadFlagLocalService;
997            @BeanReference(type = MBThreadFlagPersistence.class)
998            protected MBThreadFlagPersistence mbThreadFlagPersistence;
999            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
1000            protected com.liferay.counter.service.CounterLocalService counterLocalService;
1001            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
1002            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
1003            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1004            protected com.liferay.portal.service.UserLocalService userLocalService;
1005            @BeanReference(type = com.liferay.portal.service.UserService.class)
1006            protected com.liferay.portal.service.UserService userService;
1007            @BeanReference(type = UserPersistence.class)
1008            protected UserPersistence userPersistence;
1009            @BeanReference(type = UserFinder.class)
1010            protected UserFinder userFinder;
1011            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1012            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1013            private String _beanIdentifier;
1014    }