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