001    /**
002     * Copyright (c) 2000-2010 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.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.service.ServiceContext;
022    
023    import com.liferay.portlet.messageboards.model.MBDiscussion;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the message boards discussion service. This utility wraps {@link MBDiscussionPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
032     * </p>
033     *
034     * <p>
035     * Caching information and settings can be found in <code>portal.properties</code>
036     * </p>
037     *
038     * @author Brian Wing Shun Chan
039     * @see MBDiscussionPersistence
040     * @see MBDiscussionPersistenceImpl
041     * @generated
042     */
043    public class MBDiscussionUtil {
044            /**
045             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
046             */
047            public static void clearCache() {
048                    getPersistence().clearCache();
049            }
050    
051            /**
052             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
053             */
054            public static void clearCache(MBDiscussion mbDiscussion) {
055                    getPersistence().clearCache(mbDiscussion);
056            }
057    
058            /**
059             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
060             */
061            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
062                    throws SystemException {
063                    return getPersistence().countWithDynamicQuery(dynamicQuery);
064            }
065    
066            /**
067             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
068             */
069            public static List<MBDiscussion> findWithDynamicQuery(
070                    DynamicQuery dynamicQuery) throws SystemException {
071                    return getPersistence().findWithDynamicQuery(dynamicQuery);
072            }
073    
074            /**
075             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
076             */
077            public static List<MBDiscussion> findWithDynamicQuery(
078                    DynamicQuery dynamicQuery, int start, int end)
079                    throws SystemException {
080                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
081            }
082    
083            /**
084             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
085             */
086            public static List<MBDiscussion> findWithDynamicQuery(
087                    DynamicQuery dynamicQuery, int start, int end,
088                    OrderByComparator orderByComparator) throws SystemException {
089                    return getPersistence()
090                                       .findWithDynamicQuery(dynamicQuery, start, end,
091                            orderByComparator);
092            }
093    
094            /**
095             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
096             */
097            public static MBDiscussion remove(MBDiscussion mbDiscussion)
098                    throws SystemException {
099                    return getPersistence().remove(mbDiscussion);
100            }
101    
102            /**
103             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
104             */
105            public static MBDiscussion update(MBDiscussion mbDiscussion, boolean merge)
106                    throws SystemException {
107                    return getPersistence().update(mbDiscussion, merge);
108            }
109    
110            /**
111             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
112             */
113            public static MBDiscussion update(MBDiscussion mbDiscussion, boolean merge,
114                    ServiceContext serviceContext) throws SystemException {
115                    return getPersistence().update(mbDiscussion, merge, serviceContext);
116            }
117    
118            /**
119            * Caches the message boards discussion in the entity cache if it is enabled.
120            *
121            * @param mbDiscussion the message boards discussion to cache
122            */
123            public static void cacheResult(
124                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion) {
125                    getPersistence().cacheResult(mbDiscussion);
126            }
127    
128            /**
129            * Caches the message boards discussions in the entity cache if it is enabled.
130            *
131            * @param mbDiscussions the message boards discussions to cache
132            */
133            public static void cacheResult(
134                    java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> mbDiscussions) {
135                    getPersistence().cacheResult(mbDiscussions);
136            }
137    
138            /**
139            * Creates a new message boards discussion with the primary key. Does not add the message boards discussion to the database.
140            *
141            * @param discussionId the primary key for the new message boards discussion
142            * @return the new message boards discussion
143            */
144            public static com.liferay.portlet.messageboards.model.MBDiscussion create(
145                    long discussionId) {
146                    return getPersistence().create(discussionId);
147            }
148    
149            /**
150            * Removes the message boards discussion with the primary key from the database. Also notifies the appropriate model listeners.
151            *
152            * @param discussionId the primary key of the message boards discussion to remove
153            * @return the message boards discussion that was removed
154            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
155            * @throws SystemException if a system exception occurred
156            */
157            public static com.liferay.portlet.messageboards.model.MBDiscussion remove(
158                    long discussionId)
159                    throws com.liferay.portal.kernel.exception.SystemException,
160                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
161                    return getPersistence().remove(discussionId);
162            }
163    
164            public static com.liferay.portlet.messageboards.model.MBDiscussion updateImpl(
165                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion,
166                    boolean merge)
167                    throws com.liferay.portal.kernel.exception.SystemException {
168                    return getPersistence().updateImpl(mbDiscussion, merge);
169            }
170    
171            /**
172            * Finds the message boards discussion with the primary key or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found.
173            *
174            * @param discussionId the primary key of the message boards discussion to find
175            * @return the message boards discussion
176            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
177            * @throws SystemException if a system exception occurred
178            */
179            public static com.liferay.portlet.messageboards.model.MBDiscussion findByPrimaryKey(
180                    long discussionId)
181                    throws com.liferay.portal.kernel.exception.SystemException,
182                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
183                    return getPersistence().findByPrimaryKey(discussionId);
184            }
185    
186            /**
187            * Finds the message boards discussion with the primary key or returns <code>null</code> if it could not be found.
188            *
189            * @param discussionId the primary key of the message boards discussion to find
190            * @return the message boards discussion, or <code>null</code> if a message boards discussion with the primary key could not be found
191            * @throws SystemException if a system exception occurred
192            */
193            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByPrimaryKey(
194                    long discussionId)
195                    throws com.liferay.portal.kernel.exception.SystemException {
196                    return getPersistence().fetchByPrimaryKey(discussionId);
197            }
198    
199            /**
200            * Finds all the message boards discussions where classNameId = &#63;.
201            *
202            * @param classNameId the class name id to search with
203            * @return the matching message boards discussions
204            * @throws SystemException if a system exception occurred
205            */
206            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
207                    long classNameId)
208                    throws com.liferay.portal.kernel.exception.SystemException {
209                    return getPersistence().findByClassNameId(classNameId);
210            }
211    
212            /**
213            * Finds a range of all the message boards discussions where classNameId = &#63;.
214            *
215            * <p>
216            * 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.
217            * </p>
218            *
219            * @param classNameId the class name id to search with
220            * @param start the lower bound of the range of message boards discussions to return
221            * @param end the upper bound of the range of message boards discussions to return (not inclusive)
222            * @return the range of matching message boards discussions
223            * @throws SystemException if a system exception occurred
224            */
225            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
226                    long classNameId, int start, int end)
227                    throws com.liferay.portal.kernel.exception.SystemException {
228                    return getPersistence().findByClassNameId(classNameId, start, end);
229            }
230    
231            /**
232            * Finds an ordered range of all the message boards discussions where classNameId = &#63;.
233            *
234            * <p>
235            * 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.
236            * </p>
237            *
238            * @param classNameId the class name id to search with
239            * @param start the lower bound of the range of message boards discussions to return
240            * @param end the upper bound of the range of message boards discussions to return (not inclusive)
241            * @param orderByComparator the comparator to order the results by
242            * @return the ordered range of matching message boards discussions
243            * @throws SystemException if a system exception occurred
244            */
245            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
246                    long classNameId, int start, int end,
247                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
248                    throws com.liferay.portal.kernel.exception.SystemException {
249                    return getPersistence()
250                                       .findByClassNameId(classNameId, start, end, orderByComparator);
251            }
252    
253            /**
254            * Finds the first message boards discussion in the ordered set where classNameId = &#63;.
255            *
256            * <p>
257            * 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.
258            * </p>
259            *
260            * @param classNameId the class name id to search with
261            * @param orderByComparator the comparator to order the set by
262            * @return the first matching message boards discussion
263            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
264            * @throws SystemException if a system exception occurred
265            */
266            public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
267                    long classNameId,
268                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
269                    throws com.liferay.portal.kernel.exception.SystemException,
270                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
271                    return getPersistence()
272                                       .findByClassNameId_First(classNameId, orderByComparator);
273            }
274    
275            /**
276            * Finds the last message boards discussion in the ordered set where classNameId = &#63;.
277            *
278            * <p>
279            * 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.
280            * </p>
281            *
282            * @param classNameId the class name id to search with
283            * @param orderByComparator the comparator to order the set by
284            * @return the last matching message boards discussion
285            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
286            * @throws SystemException if a system exception occurred
287            */
288            public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
289                    long classNameId,
290                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
291                    throws com.liferay.portal.kernel.exception.SystemException,
292                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
293                    return getPersistence()
294                                       .findByClassNameId_Last(classNameId, orderByComparator);
295            }
296    
297            /**
298            * Finds the message boards discussions before and after the current message boards discussion in the ordered set where classNameId = &#63;.
299            *
300            * <p>
301            * 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.
302            * </p>
303            *
304            * @param discussionId the primary key of the current message boards discussion
305            * @param classNameId the class name id to search with
306            * @param orderByComparator the comparator to order the set by
307            * @return the previous, current, and next message boards discussion
308            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
309            * @throws SystemException if a system exception occurred
310            */
311            public static com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
312                    long discussionId, long classNameId,
313                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
314                    throws com.liferay.portal.kernel.exception.SystemException,
315                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
316                    return getPersistence()
317                                       .findByClassNameId_PrevAndNext(discussionId, classNameId,
318                            orderByComparator);
319            }
320    
321            /**
322            * Finds the message boards discussion where threadId = &#63; or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found.
323            *
324            * @param threadId the thread id to search with
325            * @return the matching message boards discussion
326            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
327            * @throws SystemException if a system exception occurred
328            */
329            public static com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId(
330                    long threadId)
331                    throws com.liferay.portal.kernel.exception.SystemException,
332                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
333                    return getPersistence().findByThreadId(threadId);
334            }
335    
336            /**
337            * Finds the message boards discussion where threadId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
338            *
339            * @param threadId the thread id to search with
340            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
341            * @throws SystemException if a system exception occurred
342            */
343            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
344                    long threadId)
345                    throws com.liferay.portal.kernel.exception.SystemException {
346                    return getPersistence().fetchByThreadId(threadId);
347            }
348    
349            /**
350            * Finds the message boards discussion where threadId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
351            *
352            * @param threadId the thread id to search with
353            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
354            * @throws SystemException if a system exception occurred
355            */
356            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
357                    long threadId, boolean retrieveFromCache)
358                    throws com.liferay.portal.kernel.exception.SystemException {
359                    return getPersistence().fetchByThreadId(threadId, retrieveFromCache);
360            }
361    
362            /**
363            * Finds the message boards discussion where classNameId = &#63; and classPK = &#63; or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found.
364            *
365            * @param classNameId the class name id to search with
366            * @param classPK the class p k to search with
367            * @return the matching message boards discussion
368            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
369            * @throws SystemException if a system exception occurred
370            */
371            public static com.liferay.portlet.messageboards.model.MBDiscussion findByC_C(
372                    long classNameId, long classPK)
373                    throws com.liferay.portal.kernel.exception.SystemException,
374                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
375                    return getPersistence().findByC_C(classNameId, classPK);
376            }
377    
378            /**
379            * Finds the message boards discussion where classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
380            *
381            * @param classNameId the class name id to search with
382            * @param classPK the class p k to search with
383            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
384            * @throws SystemException if a system exception occurred
385            */
386            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
387                    long classNameId, long classPK)
388                    throws com.liferay.portal.kernel.exception.SystemException {
389                    return getPersistence().fetchByC_C(classNameId, classPK);
390            }
391    
392            /**
393            * Finds the message boards discussion where classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
394            *
395            * @param classNameId the class name id to search with
396            * @param classPK the class p k to search with
397            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
398            * @throws SystemException if a system exception occurred
399            */
400            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
401                    long classNameId, long classPK, boolean retrieveFromCache)
402                    throws com.liferay.portal.kernel.exception.SystemException {
403                    return getPersistence()
404                                       .fetchByC_C(classNameId, classPK, retrieveFromCache);
405            }
406    
407            /**
408            * Finds all the message boards discussions.
409            *
410            * @return the message boards discussions
411            * @throws SystemException if a system exception occurred
412            */
413            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
414                    throws com.liferay.portal.kernel.exception.SystemException {
415                    return getPersistence().findAll();
416            }
417    
418            /**
419            * Finds a range of all the message boards discussions.
420            *
421            * <p>
422            * 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.
423            * </p>
424            *
425            * @param start the lower bound of the range of message boards discussions to return
426            * @param end the upper bound of the range of message boards discussions to return (not inclusive)
427            * @return the range of message boards discussions
428            * @throws SystemException if a system exception occurred
429            */
430            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
431                    int start, int end)
432                    throws com.liferay.portal.kernel.exception.SystemException {
433                    return getPersistence().findAll(start, end);
434            }
435    
436            /**
437            * Finds an ordered range of all the message boards discussions.
438            *
439            * <p>
440            * 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.
441            * </p>
442            *
443            * @param start the lower bound of the range of message boards discussions to return
444            * @param end the upper bound of the range of message boards discussions to return (not inclusive)
445            * @param orderByComparator the comparator to order the results by
446            * @return the ordered range of message boards discussions
447            * @throws SystemException if a system exception occurred
448            */
449            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
450                    int start, int end,
451                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
452                    throws com.liferay.portal.kernel.exception.SystemException {
453                    return getPersistence().findAll(start, end, orderByComparator);
454            }
455    
456            /**
457            * Removes all the message boards discussions where classNameId = &#63; from the database.
458            *
459            * @param classNameId the class name id to search with
460            * @throws SystemException if a system exception occurred
461            */
462            public static void removeByClassNameId(long classNameId)
463                    throws com.liferay.portal.kernel.exception.SystemException {
464                    getPersistence().removeByClassNameId(classNameId);
465            }
466    
467            /**
468            * Removes the message boards discussion where threadId = &#63; from the database.
469            *
470            * @param threadId the thread id to search with
471            * @throws SystemException if a system exception occurred
472            */
473            public static void removeByThreadId(long threadId)
474                    throws com.liferay.portal.kernel.exception.SystemException,
475                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
476                    getPersistence().removeByThreadId(threadId);
477            }
478    
479            /**
480            * Removes the message boards discussion where classNameId = &#63; and classPK = &#63; from the database.
481            *
482            * @param classNameId the class name id to search with
483            * @param classPK the class p k to search with
484            * @throws SystemException if a system exception occurred
485            */
486            public static void removeByC_C(long classNameId, long classPK)
487                    throws com.liferay.portal.kernel.exception.SystemException,
488                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
489                    getPersistence().removeByC_C(classNameId, classPK);
490            }
491    
492            /**
493            * Removes all the message boards discussions from the database.
494            *
495            * @throws SystemException if a system exception occurred
496            */
497            public static void removeAll()
498                    throws com.liferay.portal.kernel.exception.SystemException {
499                    getPersistence().removeAll();
500            }
501    
502            /**
503            * Counts all the message boards discussions where classNameId = &#63;.
504            *
505            * @param classNameId the class name id to search with
506            * @return the number of matching message boards discussions
507            * @throws SystemException if a system exception occurred
508            */
509            public static int countByClassNameId(long classNameId)
510                    throws com.liferay.portal.kernel.exception.SystemException {
511                    return getPersistence().countByClassNameId(classNameId);
512            }
513    
514            /**
515            * Counts all the message boards discussions where threadId = &#63;.
516            *
517            * @param threadId the thread id to search with
518            * @return the number of matching message boards discussions
519            * @throws SystemException if a system exception occurred
520            */
521            public static int countByThreadId(long threadId)
522                    throws com.liferay.portal.kernel.exception.SystemException {
523                    return getPersistence().countByThreadId(threadId);
524            }
525    
526            /**
527            * Counts all the message boards discussions where classNameId = &#63; and classPK = &#63;.
528            *
529            * @param classNameId the class name id to search with
530            * @param classPK the class p k to search with
531            * @return the number of matching message boards discussions
532            * @throws SystemException if a system exception occurred
533            */
534            public static int countByC_C(long classNameId, long classPK)
535                    throws com.liferay.portal.kernel.exception.SystemException {
536                    return getPersistence().countByC_C(classNameId, classPK);
537            }
538    
539            /**
540            * Counts all the message boards discussions.
541            *
542            * @return the number of message boards discussions
543            * @throws SystemException if a system exception occurred
544            */
545            public static int countAll()
546                    throws com.liferay.portal.kernel.exception.SystemException {
547                    return getPersistence().countAll();
548            }
549    
550            public static MBDiscussionPersistence getPersistence() {
551                    if (_persistence == null) {
552                            _persistence = (MBDiscussionPersistence)PortalBeanLocatorUtil.locate(MBDiscussionPersistence.class.getName());
553                    }
554    
555                    return _persistence;
556            }
557    
558            public void setPersistence(MBDiscussionPersistence persistence) {
559                    _persistence = persistence;
560            }
561    
562            private static MBDiscussionPersistence _persistence;
563    }