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.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)
099             */
100            public static MBDiscussion update(MBDiscussion mbDiscussion)
101                    throws SystemException {
102                    return getPersistence().update(mbDiscussion);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
107             */
108            public static MBDiscussion update(MBDiscussion mbDiscussion,
109                    ServiceContext serviceContext) throws SystemException {
110                    return getPersistence().update(mbDiscussion, 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                    throws com.liferay.portal.kernel.exception.SystemException {
162                    return getPersistence().updateImpl(mbDiscussion);
163            }
164    
165            /**
166            * Returns the message boards discussion with the primary key or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found.
167            *
168            * @param discussionId the primary key of the message boards discussion
169            * @return the message boards discussion
170            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
171            * @throws SystemException if a system exception occurred
172            */
173            public static com.liferay.portlet.messageboards.model.MBDiscussion findByPrimaryKey(
174                    long discussionId)
175                    throws com.liferay.portal.kernel.exception.SystemException,
176                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
177                    return getPersistence().findByPrimaryKey(discussionId);
178            }
179    
180            /**
181            * Returns the message boards discussion with the primary key or returns <code>null</code> if it could not be found.
182            *
183            * @param discussionId the primary key of the message boards discussion
184            * @return the message boards discussion, or <code>null</code> if a message boards discussion with the primary key could not be found
185            * @throws SystemException if a system exception occurred
186            */
187            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByPrimaryKey(
188                    long discussionId)
189                    throws com.liferay.portal.kernel.exception.SystemException {
190                    return getPersistence().fetchByPrimaryKey(discussionId);
191            }
192    
193            /**
194            * Returns all the message boards discussions where classNameId = &#63;.
195            *
196            * @param classNameId the class name ID
197            * @return the matching message boards discussions
198            * @throws SystemException if a system exception occurred
199            */
200            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
201                    long classNameId)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return getPersistence().findByClassNameId(classNameId);
204            }
205    
206            /**
207            * Returns a range of all the message boards discussions where classNameId = &#63;.
208            *
209            * <p>
210            * 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.
211            * </p>
212            *
213            * @param classNameId the class name ID
214            * @param start the lower bound of the range of message boards discussions
215            * @param end the upper bound of the range of message boards discussions (not inclusive)
216            * @return the range of matching message boards discussions
217            * @throws SystemException if a system exception occurred
218            */
219            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
220                    long classNameId, int start, int end)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getPersistence().findByClassNameId(classNameId, start, end);
223            }
224    
225            /**
226            * Returns an ordered range of all the message boards discussions where classNameId = &#63;.
227            *
228            * <p>
229            * 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.
230            * </p>
231            *
232            * @param classNameId the class name ID
233            * @param start the lower bound of the range of message boards discussions
234            * @param end the upper bound of the range of message boards discussions (not inclusive)
235            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
236            * @return the ordered range of matching message boards discussions
237            * @throws SystemException if a system exception occurred
238            */
239            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
240                    long classNameId, int start, int end,
241                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getPersistence()
244                                       .findByClassNameId(classNameId, start, end, orderByComparator);
245            }
246    
247            /**
248            * Returns the first message boards discussion in the ordered set where classNameId = &#63;.
249            *
250            * @param classNameId the class name ID
251            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
252            * @return the first matching message boards discussion
253            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
254            * @throws SystemException if a system exception occurred
255            */
256            public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
257                    long classNameId,
258                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
259                    throws com.liferay.portal.kernel.exception.SystemException,
260                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
261                    return getPersistence()
262                                       .findByClassNameId_First(classNameId, orderByComparator);
263            }
264    
265            /**
266            * Returns the first message boards discussion in the ordered set where classNameId = &#63;.
267            *
268            * @param classNameId the class name ID
269            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
270            * @return the first matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
271            * @throws SystemException if a system exception occurred
272            */
273            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByClassNameId_First(
274                    long classNameId,
275                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
276                    throws com.liferay.portal.kernel.exception.SystemException {
277                    return getPersistence()
278                                       .fetchByClassNameId_First(classNameId, orderByComparator);
279            }
280    
281            /**
282            * Returns the last message boards discussion in the ordered set where classNameId = &#63;.
283            *
284            * @param classNameId the class name ID
285            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
286            * @return the last matching message boards discussion
287            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
288            * @throws SystemException if a system exception occurred
289            */
290            public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
291                    long classNameId,
292                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
293                    throws com.liferay.portal.kernel.exception.SystemException,
294                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
295                    return getPersistence()
296                                       .findByClassNameId_Last(classNameId, orderByComparator);
297            }
298    
299            /**
300            * Returns the last message boards discussion in the ordered set where classNameId = &#63;.
301            *
302            * @param classNameId the class name ID
303            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
304            * @return the last matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
305            * @throws SystemException if a system exception occurred
306            */
307            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByClassNameId_Last(
308                    long classNameId,
309                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
310                    throws com.liferay.portal.kernel.exception.SystemException {
311                    return getPersistence()
312                                       .fetchByClassNameId_Last(classNameId, orderByComparator);
313            }
314    
315            /**
316            * Returns the message boards discussions before and after the current message boards discussion in the ordered set where classNameId = &#63;.
317            *
318            * @param discussionId the primary key of the current message boards discussion
319            * @param classNameId the class name ID
320            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
321            * @return the previous, current, and next message boards discussion
322            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
323            * @throws SystemException if a system exception occurred
324            */
325            public static com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
326                    long discussionId, long classNameId,
327                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
328                    throws com.liferay.portal.kernel.exception.SystemException,
329                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
330                    return getPersistence()
331                                       .findByClassNameId_PrevAndNext(discussionId, classNameId,
332                            orderByComparator);
333            }
334    
335            /**
336            * Returns the message boards discussion where threadId = &#63; or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found.
337            *
338            * @param threadId the thread ID
339            * @return the matching message boards discussion
340            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException 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 findByThreadId(
344                    long threadId)
345                    throws com.liferay.portal.kernel.exception.SystemException,
346                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
347                    return getPersistence().findByThreadId(threadId);
348            }
349    
350            /**
351            * Returns the message boards discussion where threadId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
352            *
353            * @param threadId the thread ID
354            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
355            * @throws SystemException if a system exception occurred
356            */
357            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
358                    long threadId)
359                    throws com.liferay.portal.kernel.exception.SystemException {
360                    return getPersistence().fetchByThreadId(threadId);
361            }
362    
363            /**
364            * Returns the message boards discussion where threadId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
365            *
366            * @param threadId the thread ID
367            * @param retrieveFromCache whether to use the finder cache
368            * @return the matching message boards discussion, or <code>null</code> 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 fetchByThreadId(
372                    long threadId, boolean retrieveFromCache)
373                    throws com.liferay.portal.kernel.exception.SystemException {
374                    return getPersistence().fetchByThreadId(threadId, retrieveFromCache);
375            }
376    
377            /**
378            * 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.
379            *
380            * @param classNameId the class name ID
381            * @param classPK the class p k
382            * @return the matching message boards discussion
383            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException 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 findByC_C(
387                    long classNameId, long classPK)
388                    throws com.liferay.portal.kernel.exception.SystemException,
389                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
390                    return getPersistence().findByC_C(classNameId, classPK);
391            }
392    
393            /**
394            * 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.
395            *
396            * @param classNameId the class name ID
397            * @param classPK the class p k
398            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
399            * @throws SystemException if a system exception occurred
400            */
401            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
402                    long classNameId, long classPK)
403                    throws com.liferay.portal.kernel.exception.SystemException {
404                    return getPersistence().fetchByC_C(classNameId, classPK);
405            }
406    
407            /**
408            * 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.
409            *
410            * @param classNameId the class name ID
411            * @param classPK the class p k
412            * @param retrieveFromCache whether to use the finder cache
413            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
414            * @throws SystemException if a system exception occurred
415            */
416            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
417                    long classNameId, long classPK, boolean retrieveFromCache)
418                    throws com.liferay.portal.kernel.exception.SystemException {
419                    return getPersistence()
420                                       .fetchByC_C(classNameId, classPK, retrieveFromCache);
421            }
422    
423            /**
424            * Returns all the message boards discussions.
425            *
426            * @return the message boards discussions
427            * @throws SystemException if a system exception occurred
428            */
429            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
430                    throws com.liferay.portal.kernel.exception.SystemException {
431                    return getPersistence().findAll();
432            }
433    
434            /**
435            * Returns a range of all the message boards discussions.
436            *
437            * <p>
438            * 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.
439            * </p>
440            *
441            * @param start the lower bound of the range of message boards discussions
442            * @param end the upper bound of the range of message boards discussions (not inclusive)
443            * @return the range of message boards discussions
444            * @throws SystemException if a system exception occurred
445            */
446            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
447                    int start, int end)
448                    throws com.liferay.portal.kernel.exception.SystemException {
449                    return getPersistence().findAll(start, end);
450            }
451    
452            /**
453            * Returns an ordered range of all the message boards discussions.
454            *
455            * <p>
456            * 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.
457            * </p>
458            *
459            * @param start the lower bound of the range of message boards discussions
460            * @param end the upper bound of the range of message boards discussions (not inclusive)
461            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
462            * @return the ordered range of message boards discussions
463            * @throws SystemException if a system exception occurred
464            */
465            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
466                    int start, int end,
467                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
468                    throws com.liferay.portal.kernel.exception.SystemException {
469                    return getPersistence().findAll(start, end, orderByComparator);
470            }
471    
472            /**
473            * Removes all the message boards discussions where classNameId = &#63; from the database.
474            *
475            * @param classNameId the class name ID
476            * @throws SystemException if a system exception occurred
477            */
478            public static void removeByClassNameId(long classNameId)
479                    throws com.liferay.portal.kernel.exception.SystemException {
480                    getPersistence().removeByClassNameId(classNameId);
481            }
482    
483            /**
484            * Removes the message boards discussion where threadId = &#63; from the database.
485            *
486            * @param threadId the thread ID
487            * @return the message boards discussion that was removed
488            * @throws SystemException if a system exception occurred
489            */
490            public static com.liferay.portlet.messageboards.model.MBDiscussion removeByThreadId(
491                    long threadId)
492                    throws com.liferay.portal.kernel.exception.SystemException,
493                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
494                    return getPersistence().removeByThreadId(threadId);
495            }
496    
497            /**
498            * Removes the message boards discussion where classNameId = &#63; and classPK = &#63; from the database.
499            *
500            * @param classNameId the class name ID
501            * @param classPK the class p k
502            * @return the message boards discussion that was removed
503            * @throws SystemException if a system exception occurred
504            */
505            public static com.liferay.portlet.messageboards.model.MBDiscussion removeByC_C(
506                    long classNameId, long classPK)
507                    throws com.liferay.portal.kernel.exception.SystemException,
508                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
509                    return getPersistence().removeByC_C(classNameId, classPK);
510            }
511    
512            /**
513            * Removes all the message boards discussions from the database.
514            *
515            * @throws SystemException if a system exception occurred
516            */
517            public static void removeAll()
518                    throws com.liferay.portal.kernel.exception.SystemException {
519                    getPersistence().removeAll();
520            }
521    
522            /**
523            * Returns the number of message boards discussions where classNameId = &#63;.
524            *
525            * @param classNameId the class name ID
526            * @return the number of matching message boards discussions
527            * @throws SystemException if a system exception occurred
528            */
529            public static int countByClassNameId(long classNameId)
530                    throws com.liferay.portal.kernel.exception.SystemException {
531                    return getPersistence().countByClassNameId(classNameId);
532            }
533    
534            /**
535            * Returns the number of message boards discussions where threadId = &#63;.
536            *
537            * @param threadId the thread ID
538            * @return the number of matching message boards discussions
539            * @throws SystemException if a system exception occurred
540            */
541            public static int countByThreadId(long threadId)
542                    throws com.liferay.portal.kernel.exception.SystemException {
543                    return getPersistence().countByThreadId(threadId);
544            }
545    
546            /**
547            * Returns the number of message boards discussions where classNameId = &#63; and classPK = &#63;.
548            *
549            * @param classNameId the class name ID
550            * @param classPK the class p k
551            * @return the number of matching message boards discussions
552            * @throws SystemException if a system exception occurred
553            */
554            public static int countByC_C(long classNameId, long classPK)
555                    throws com.liferay.portal.kernel.exception.SystemException {
556                    return getPersistence().countByC_C(classNameId, classPK);
557            }
558    
559            /**
560            * Returns the number of message boards discussions.
561            *
562            * @return the number of message boards discussions
563            * @throws SystemException if a system exception occurred
564            */
565            public static int countAll()
566                    throws com.liferay.portal.kernel.exception.SystemException {
567                    return getPersistence().countAll();
568            }
569    
570            public static MBDiscussionPersistence getPersistence() {
571                    if (_persistence == null) {
572                            _persistence = (MBDiscussionPersistence)PortalBeanLocatorUtil.locate(MBDiscussionPersistence.class.getName());
573    
574                            ReferenceRegistry.registerReference(MBDiscussionUtil.class,
575                                    "_persistence");
576                    }
577    
578                    return _persistence;
579            }
580    
581            /**
582             * @deprecated
583             */
584            public void setPersistence(MBDiscussionPersistence persistence) {
585            }
586    
587            private static MBDiscussionPersistence _persistence;
588    }