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            * Returns all the message boards discussions where classNameId = &#63;.
115            *
116            * @param classNameId the class name ID
117            * @return the matching message boards discussions
118            * @throws SystemException if a system exception occurred
119            */
120            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
121                    long classNameId)
122                    throws com.liferay.portal.kernel.exception.SystemException {
123                    return getPersistence().findByClassNameId(classNameId);
124            }
125    
126            /**
127            * Returns a range of all the message boards discussions where classNameId = &#63;.
128            *
129            * <p>
130            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBDiscussionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
131            * </p>
132            *
133            * @param classNameId the class name ID
134            * @param start the lower bound of the range of message boards discussions
135            * @param end the upper bound of the range of message boards discussions (not inclusive)
136            * @return the range of matching message boards discussions
137            * @throws SystemException if a system exception occurred
138            */
139            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
140                    long classNameId, int start, int end)
141                    throws com.liferay.portal.kernel.exception.SystemException {
142                    return getPersistence().findByClassNameId(classNameId, start, end);
143            }
144    
145            /**
146            * Returns an ordered range of all the message boards discussions where classNameId = &#63;.
147            *
148            * <p>
149            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBDiscussionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
150            * </p>
151            *
152            * @param classNameId the class name ID
153            * @param start the lower bound of the range of message boards discussions
154            * @param end the upper bound of the range of message boards discussions (not inclusive)
155            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
156            * @return the ordered range of matching message boards discussions
157            * @throws SystemException if a system exception occurred
158            */
159            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
160                    long classNameId, int start, int end,
161                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
162                    throws com.liferay.portal.kernel.exception.SystemException {
163                    return getPersistence()
164                                       .findByClassNameId(classNameId, start, end, orderByComparator);
165            }
166    
167            /**
168            * Returns the first message boards discussion in the ordered set where classNameId = &#63;.
169            *
170            * @param classNameId the class name ID
171            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
172            * @return the first matching message boards discussion
173            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
174            * @throws SystemException if a system exception occurred
175            */
176            public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
177                    long classNameId,
178                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
179                    throws com.liferay.portal.kernel.exception.SystemException,
180                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
181                    return getPersistence()
182                                       .findByClassNameId_First(classNameId, orderByComparator);
183            }
184    
185            /**
186            * Returns the first message boards discussion in the ordered set where classNameId = &#63;.
187            *
188            * @param classNameId the class name ID
189            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
190            * @return the first matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
191            * @throws SystemException if a system exception occurred
192            */
193            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByClassNameId_First(
194                    long classNameId,
195                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
196                    throws com.liferay.portal.kernel.exception.SystemException {
197                    return getPersistence()
198                                       .fetchByClassNameId_First(classNameId, orderByComparator);
199            }
200    
201            /**
202            * Returns the last message boards discussion in the ordered set where classNameId = &#63;.
203            *
204            * @param classNameId the class name ID
205            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
206            * @return the last matching message boards discussion
207            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
208            * @throws SystemException if a system exception occurred
209            */
210            public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
211                    long classNameId,
212                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
213                    throws com.liferay.portal.kernel.exception.SystemException,
214                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
215                    return getPersistence()
216                                       .findByClassNameId_Last(classNameId, orderByComparator);
217            }
218    
219            /**
220            * Returns the last message boards discussion in the ordered set where classNameId = &#63;.
221            *
222            * @param classNameId the class name ID
223            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
224            * @return the last matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
225            * @throws SystemException if a system exception occurred
226            */
227            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByClassNameId_Last(
228                    long classNameId,
229                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
230                    throws com.liferay.portal.kernel.exception.SystemException {
231                    return getPersistence()
232                                       .fetchByClassNameId_Last(classNameId, orderByComparator);
233            }
234    
235            /**
236            * Returns the message boards discussions before and after the current message boards discussion in the ordered set where classNameId = &#63;.
237            *
238            * @param discussionId the primary key of the current message boards discussion
239            * @param classNameId the class name ID
240            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
241            * @return the previous, current, and next message boards discussion
242            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
243            * @throws SystemException if a system exception occurred
244            */
245            public static com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
246                    long discussionId, long classNameId,
247                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
248                    throws com.liferay.portal.kernel.exception.SystemException,
249                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
250                    return getPersistence()
251                                       .findByClassNameId_PrevAndNext(discussionId, classNameId,
252                            orderByComparator);
253            }
254    
255            /**
256            * Removes all the message boards discussions where classNameId = &#63; from the database.
257            *
258            * @param classNameId the class name ID
259            * @throws SystemException if a system exception occurred
260            */
261            public static void removeByClassNameId(long classNameId)
262                    throws com.liferay.portal.kernel.exception.SystemException {
263                    getPersistence().removeByClassNameId(classNameId);
264            }
265    
266            /**
267            * Returns the number of message boards discussions where classNameId = &#63;.
268            *
269            * @param classNameId the class name ID
270            * @return the number of matching message boards discussions
271            * @throws SystemException if a system exception occurred
272            */
273            public static int countByClassNameId(long classNameId)
274                    throws com.liferay.portal.kernel.exception.SystemException {
275                    return getPersistence().countByClassNameId(classNameId);
276            }
277    
278            /**
279            * Returns the message boards discussion where threadId = &#63; or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found.
280            *
281            * @param threadId the thread ID
282            * @return the matching message boards discussion
283            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
284            * @throws SystemException if a system exception occurred
285            */
286            public static com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId(
287                    long threadId)
288                    throws com.liferay.portal.kernel.exception.SystemException,
289                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
290                    return getPersistence().findByThreadId(threadId);
291            }
292    
293            /**
294            * Returns the message boards discussion where threadId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
295            *
296            * @param threadId the thread ID
297            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
298            * @throws SystemException if a system exception occurred
299            */
300            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
301                    long threadId)
302                    throws com.liferay.portal.kernel.exception.SystemException {
303                    return getPersistence().fetchByThreadId(threadId);
304            }
305    
306            /**
307            * Returns the message boards discussion where threadId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
308            *
309            * @param threadId the thread ID
310            * @param retrieveFromCache whether to use the finder cache
311            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
312            * @throws SystemException if a system exception occurred
313            */
314            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
315                    long threadId, boolean retrieveFromCache)
316                    throws com.liferay.portal.kernel.exception.SystemException {
317                    return getPersistence().fetchByThreadId(threadId, retrieveFromCache);
318            }
319    
320            /**
321            * Removes the message boards discussion where threadId = &#63; from the database.
322            *
323            * @param threadId the thread ID
324            * @return the message boards discussion that was removed
325            * @throws SystemException if a system exception occurred
326            */
327            public static com.liferay.portlet.messageboards.model.MBDiscussion removeByThreadId(
328                    long threadId)
329                    throws com.liferay.portal.kernel.exception.SystemException,
330                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
331                    return getPersistence().removeByThreadId(threadId);
332            }
333    
334            /**
335            * Returns the number of message boards discussions where threadId = &#63;.
336            *
337            * @param threadId the thread ID
338            * @return the number of matching message boards discussions
339            * @throws SystemException if a system exception occurred
340            */
341            public static int countByThreadId(long threadId)
342                    throws com.liferay.portal.kernel.exception.SystemException {
343                    return getPersistence().countByThreadId(threadId);
344            }
345    
346            /**
347            * 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.
348            *
349            * @param classNameId the class name ID
350            * @param classPK the class p k
351            * @return the matching message boards discussion
352            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
353            * @throws SystemException if a system exception occurred
354            */
355            public static com.liferay.portlet.messageboards.model.MBDiscussion findByC_C(
356                    long classNameId, long classPK)
357                    throws com.liferay.portal.kernel.exception.SystemException,
358                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
359                    return getPersistence().findByC_C(classNameId, classPK);
360            }
361    
362            /**
363            * 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.
364            *
365            * @param classNameId the class name ID
366            * @param classPK the class p k
367            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
368            * @throws SystemException if a system exception occurred
369            */
370            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
371                    long classNameId, long classPK)
372                    throws com.liferay.portal.kernel.exception.SystemException {
373                    return getPersistence().fetchByC_C(classNameId, classPK);
374            }
375    
376            /**
377            * 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.
378            *
379            * @param classNameId the class name ID
380            * @param classPK the class p k
381            * @param retrieveFromCache whether to use the finder cache
382            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
383            * @throws SystemException if a system exception occurred
384            */
385            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
386                    long classNameId, long classPK, boolean retrieveFromCache)
387                    throws com.liferay.portal.kernel.exception.SystemException {
388                    return getPersistence()
389                                       .fetchByC_C(classNameId, classPK, retrieveFromCache);
390            }
391    
392            /**
393            * Removes the message boards discussion where classNameId = &#63; and classPK = &#63; from the database.
394            *
395            * @param classNameId the class name ID
396            * @param classPK the class p k
397            * @return the message boards discussion that was removed
398            * @throws SystemException if a system exception occurred
399            */
400            public static com.liferay.portlet.messageboards.model.MBDiscussion removeByC_C(
401                    long classNameId, long classPK)
402                    throws com.liferay.portal.kernel.exception.SystemException,
403                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
404                    return getPersistence().removeByC_C(classNameId, classPK);
405            }
406    
407            /**
408            * Returns the number of message boards discussions where classNameId = &#63; and classPK = &#63;.
409            *
410            * @param classNameId the class name ID
411            * @param classPK the class p k
412            * @return the number of matching message boards discussions
413            * @throws SystemException if a system exception occurred
414            */
415            public static int countByC_C(long classNameId, long classPK)
416                    throws com.liferay.portal.kernel.exception.SystemException {
417                    return getPersistence().countByC_C(classNameId, classPK);
418            }
419    
420            /**
421            * Caches the message boards discussion in the entity cache if it is enabled.
422            *
423            * @param mbDiscussion the message boards discussion
424            */
425            public static void cacheResult(
426                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion) {
427                    getPersistence().cacheResult(mbDiscussion);
428            }
429    
430            /**
431            * Caches the message boards discussions in the entity cache if it is enabled.
432            *
433            * @param mbDiscussions the message boards discussions
434            */
435            public static void cacheResult(
436                    java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> mbDiscussions) {
437                    getPersistence().cacheResult(mbDiscussions);
438            }
439    
440            /**
441            * Creates a new message boards discussion with the primary key. Does not add the message boards discussion to the database.
442            *
443            * @param discussionId the primary key for the new message boards discussion
444            * @return the new message boards discussion
445            */
446            public static com.liferay.portlet.messageboards.model.MBDiscussion create(
447                    long discussionId) {
448                    return getPersistence().create(discussionId);
449            }
450    
451            /**
452            * Removes the message boards discussion with the primary key from the database. Also notifies the appropriate model listeners.
453            *
454            * @param discussionId the primary key of the message boards discussion
455            * @return the message boards discussion that was removed
456            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
457            * @throws SystemException if a system exception occurred
458            */
459            public static com.liferay.portlet.messageboards.model.MBDiscussion remove(
460                    long discussionId)
461                    throws com.liferay.portal.kernel.exception.SystemException,
462                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
463                    return getPersistence().remove(discussionId);
464            }
465    
466            public static com.liferay.portlet.messageboards.model.MBDiscussion updateImpl(
467                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion)
468                    throws com.liferay.portal.kernel.exception.SystemException {
469                    return getPersistence().updateImpl(mbDiscussion);
470            }
471    
472            /**
473            * Returns the message boards discussion with the primary key or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found.
474            *
475            * @param discussionId the primary key of the message boards discussion
476            * @return the message boards discussion
477            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
478            * @throws SystemException if a system exception occurred
479            */
480            public static com.liferay.portlet.messageboards.model.MBDiscussion findByPrimaryKey(
481                    long discussionId)
482                    throws com.liferay.portal.kernel.exception.SystemException,
483                            com.liferay.portlet.messageboards.NoSuchDiscussionException {
484                    return getPersistence().findByPrimaryKey(discussionId);
485            }
486    
487            /**
488            * Returns the message boards discussion with the primary key or returns <code>null</code> if it could not be found.
489            *
490            * @param discussionId the primary key of the message boards discussion
491            * @return the message boards discussion, or <code>null</code> if a message boards discussion with the primary key could not be found
492            * @throws SystemException if a system exception occurred
493            */
494            public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByPrimaryKey(
495                    long discussionId)
496                    throws com.liferay.portal.kernel.exception.SystemException {
497                    return getPersistence().fetchByPrimaryKey(discussionId);
498            }
499    
500            /**
501            * Returns all the message boards discussions.
502            *
503            * @return the message boards discussions
504            * @throws SystemException if a system exception occurred
505            */
506            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
507                    throws com.liferay.portal.kernel.exception.SystemException {
508                    return getPersistence().findAll();
509            }
510    
511            /**
512            * Returns a range of all the message boards discussions.
513            *
514            * <p>
515            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBDiscussionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
516            * </p>
517            *
518            * @param start the lower bound of the range of message boards discussions
519            * @param end the upper bound of the range of message boards discussions (not inclusive)
520            * @return the range of message boards discussions
521            * @throws SystemException if a system exception occurred
522            */
523            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
524                    int start, int end)
525                    throws com.liferay.portal.kernel.exception.SystemException {
526                    return getPersistence().findAll(start, end);
527            }
528    
529            /**
530            * Returns an ordered range of all the message boards discussions.
531            *
532            * <p>
533            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBDiscussionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
534            * </p>
535            *
536            * @param start the lower bound of the range of message boards discussions
537            * @param end the upper bound of the range of message boards discussions (not inclusive)
538            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
539            * @return the ordered range of message boards discussions
540            * @throws SystemException if a system exception occurred
541            */
542            public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
543                    int start, int end,
544                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
545                    throws com.liferay.portal.kernel.exception.SystemException {
546                    return getPersistence().findAll(start, end, orderByComparator);
547            }
548    
549            /**
550            * Removes all the message boards discussions from the database.
551            *
552            * @throws SystemException if a system exception occurred
553            */
554            public static void removeAll()
555                    throws com.liferay.portal.kernel.exception.SystemException {
556                    getPersistence().removeAll();
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    }