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