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.MBThreadFlag;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the message boards thread flag service. This utility wraps {@link MBThreadFlagPersistenceImpl} 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 MBThreadFlagPersistence
037     * @see MBThreadFlagPersistenceImpl
038     * @generated
039     */
040    public class MBThreadFlagUtil {
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(MBThreadFlag mbThreadFlag) {
058                    getPersistence().clearCache(mbThreadFlag);
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<MBThreadFlag> 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<MBThreadFlag> 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<MBThreadFlag> 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 MBThreadFlag update(MBThreadFlag mbThreadFlag, boolean merge)
101                    throws SystemException {
102                    return getPersistence().update(mbThreadFlag, merge);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
107             */
108            public static MBThreadFlag update(MBThreadFlag mbThreadFlag, boolean merge,
109                    ServiceContext serviceContext) throws SystemException {
110                    return getPersistence().update(mbThreadFlag, merge, serviceContext);
111            }
112    
113            /**
114            * Caches the message boards thread flag in the entity cache if it is enabled.
115            *
116            * @param mbThreadFlag the message boards thread flag
117            */
118            public static void cacheResult(
119                    com.liferay.portlet.messageboards.model.MBThreadFlag mbThreadFlag) {
120                    getPersistence().cacheResult(mbThreadFlag);
121            }
122    
123            /**
124            * Caches the message boards thread flags in the entity cache if it is enabled.
125            *
126            * @param mbThreadFlags the message boards thread flags
127            */
128            public static void cacheResult(
129                    java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> mbThreadFlags) {
130                    getPersistence().cacheResult(mbThreadFlags);
131            }
132    
133            /**
134            * Creates a new message boards thread flag with the primary key. Does not add the message boards thread flag to the database.
135            *
136            * @param threadFlagId the primary key for the new message boards thread flag
137            * @return the new message boards thread flag
138            */
139            public static com.liferay.portlet.messageboards.model.MBThreadFlag create(
140                    long threadFlagId) {
141                    return getPersistence().create(threadFlagId);
142            }
143    
144            /**
145            * Removes the message boards thread flag with the primary key from the database. Also notifies the appropriate model listeners.
146            *
147            * @param threadFlagId the primary key of the message boards thread flag
148            * @return the message boards thread flag that was removed
149            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a message boards thread flag 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.MBThreadFlag remove(
153                    long threadFlagId)
154                    throws com.liferay.portal.kernel.exception.SystemException,
155                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
156                    return getPersistence().remove(threadFlagId);
157            }
158    
159            public static com.liferay.portlet.messageboards.model.MBThreadFlag updateImpl(
160                    com.liferay.portlet.messageboards.model.MBThreadFlag mbThreadFlag,
161                    boolean merge)
162                    throws com.liferay.portal.kernel.exception.SystemException {
163                    return getPersistence().updateImpl(mbThreadFlag, merge);
164            }
165    
166            /**
167            * Returns the message boards thread flag with the primary key or throws a {@link com.liferay.portlet.messageboards.NoSuchThreadFlagException} if it could not be found.
168            *
169            * @param threadFlagId the primary key of the message boards thread flag
170            * @return the message boards thread flag
171            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a message boards thread flag 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.MBThreadFlag findByPrimaryKey(
175                    long threadFlagId)
176                    throws com.liferay.portal.kernel.exception.SystemException,
177                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
178                    return getPersistence().findByPrimaryKey(threadFlagId);
179            }
180    
181            /**
182            * Returns the message boards thread flag with the primary key or returns <code>null</code> if it could not be found.
183            *
184            * @param threadFlagId the primary key of the message boards thread flag
185            * @return the message boards thread flag, or <code>null</code> if a message boards thread flag 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.MBThreadFlag fetchByPrimaryKey(
189                    long threadFlagId)
190                    throws com.liferay.portal.kernel.exception.SystemException {
191                    return getPersistence().fetchByPrimaryKey(threadFlagId);
192            }
193    
194            /**
195            * Returns all the message boards thread flags where userId = &#63;.
196            *
197            * @param userId the user ID
198            * @return the matching message boards thread flags
199            * @throws SystemException if a system exception occurred
200            */
201            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findByUserId(
202                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
203                    return getPersistence().findByUserId(userId);
204            }
205    
206            /**
207            * Returns a range of all the message boards thread flags where userId = &#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 userId the user ID
214            * @param start the lower bound of the range of message boards thread flags
215            * @param end the upper bound of the range of message boards thread flags (not inclusive)
216            * @return the range of matching message boards thread flags
217            * @throws SystemException if a system exception occurred
218            */
219            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findByUserId(
220                    long userId, int start, int end)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getPersistence().findByUserId(userId, start, end);
223            }
224    
225            /**
226            * Returns an ordered range of all the message boards thread flags where userId = &#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 userId the user ID
233            * @param start the lower bound of the range of message boards thread flags
234            * @param end the upper bound of the range of message boards thread flags (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 thread flags
237            * @throws SystemException if a system exception occurred
238            */
239            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findByUserId(
240                    long userId, int start, int end,
241                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getPersistence()
244                                       .findByUserId(userId, start, end, orderByComparator);
245            }
246    
247            /**
248            * Returns the first message boards thread flag in the ordered set where userId = &#63;.
249            *
250            * <p>
251            * 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.
252            * </p>
253            *
254            * @param userId the user ID
255            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
256            * @return the first matching message boards thread flag
257            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a matching message boards thread flag could not be found
258            * @throws SystemException if a system exception occurred
259            */
260            public static com.liferay.portlet.messageboards.model.MBThreadFlag findByUserId_First(
261                    long userId,
262                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
263                    throws com.liferay.portal.kernel.exception.SystemException,
264                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
265                    return getPersistence().findByUserId_First(userId, orderByComparator);
266            }
267    
268            /**
269            * Returns the last message boards thread flag in the ordered set where userId = &#63;.
270            *
271            * <p>
272            * 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.
273            * </p>
274            *
275            * @param userId the user ID
276            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
277            * @return the last matching message boards thread flag
278            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a matching message boards thread flag could not be found
279            * @throws SystemException if a system exception occurred
280            */
281            public static com.liferay.portlet.messageboards.model.MBThreadFlag findByUserId_Last(
282                    long userId,
283                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
284                    throws com.liferay.portal.kernel.exception.SystemException,
285                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
286                    return getPersistence().findByUserId_Last(userId, orderByComparator);
287            }
288    
289            /**
290            * Returns the message boards thread flags before and after the current message boards thread flag in the ordered set where userId = &#63;.
291            *
292            * <p>
293            * 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.
294            * </p>
295            *
296            * @param threadFlagId the primary key of the current message boards thread flag
297            * @param userId the user ID
298            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
299            * @return the previous, current, and next message boards thread flag
300            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a message boards thread flag with the primary key could not be found
301            * @throws SystemException if a system exception occurred
302            */
303            public static com.liferay.portlet.messageboards.model.MBThreadFlag[] findByUserId_PrevAndNext(
304                    long threadFlagId, long userId,
305                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
306                    throws com.liferay.portal.kernel.exception.SystemException,
307                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
308                    return getPersistence()
309                                       .findByUserId_PrevAndNext(threadFlagId, userId,
310                            orderByComparator);
311            }
312    
313            /**
314            * Returns all the message boards thread flags where threadId = &#63;.
315            *
316            * @param threadId the thread ID
317            * @return the matching message boards thread flags
318            * @throws SystemException if a system exception occurred
319            */
320            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findByThreadId(
321                    long threadId)
322                    throws com.liferay.portal.kernel.exception.SystemException {
323                    return getPersistence().findByThreadId(threadId);
324            }
325    
326            /**
327            * Returns a range of all the message boards thread flags where threadId = &#63;.
328            *
329            * <p>
330            * 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.
331            * </p>
332            *
333            * @param threadId the thread ID
334            * @param start the lower bound of the range of message boards thread flags
335            * @param end the upper bound of the range of message boards thread flags (not inclusive)
336            * @return the range of matching message boards thread flags
337            * @throws SystemException if a system exception occurred
338            */
339            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findByThreadId(
340                    long threadId, int start, int end)
341                    throws com.liferay.portal.kernel.exception.SystemException {
342                    return getPersistence().findByThreadId(threadId, start, end);
343            }
344    
345            /**
346            * Returns an ordered range of all the message boards thread flags where threadId = &#63;.
347            *
348            * <p>
349            * 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.
350            * </p>
351            *
352            * @param threadId the thread ID
353            * @param start the lower bound of the range of message boards thread flags
354            * @param end the upper bound of the range of message boards thread flags (not inclusive)
355            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
356            * @return the ordered range of matching message boards thread flags
357            * @throws SystemException if a system exception occurred
358            */
359            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findByThreadId(
360                    long threadId, int start, int end,
361                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
362                    throws com.liferay.portal.kernel.exception.SystemException {
363                    return getPersistence()
364                                       .findByThreadId(threadId, start, end, orderByComparator);
365            }
366    
367            /**
368            * Returns the first message boards thread flag in the ordered set where threadId = &#63;.
369            *
370            * <p>
371            * 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.
372            * </p>
373            *
374            * @param threadId the thread ID
375            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
376            * @return the first matching message boards thread flag
377            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a matching message boards thread flag could not be found
378            * @throws SystemException if a system exception occurred
379            */
380            public static com.liferay.portlet.messageboards.model.MBThreadFlag findByThreadId_First(
381                    long threadId,
382                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
383                    throws com.liferay.portal.kernel.exception.SystemException,
384                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
385                    return getPersistence().findByThreadId_First(threadId, orderByComparator);
386            }
387    
388            /**
389            * Returns the last message boards thread flag in the ordered set where threadId = &#63;.
390            *
391            * <p>
392            * 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.
393            * </p>
394            *
395            * @param threadId the thread ID
396            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
397            * @return the last matching message boards thread flag
398            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a matching message boards thread flag could not be found
399            * @throws SystemException if a system exception occurred
400            */
401            public static com.liferay.portlet.messageboards.model.MBThreadFlag findByThreadId_Last(
402                    long threadId,
403                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
404                    throws com.liferay.portal.kernel.exception.SystemException,
405                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
406                    return getPersistence().findByThreadId_Last(threadId, orderByComparator);
407            }
408    
409            /**
410            * Returns the message boards thread flags before and after the current message boards thread flag in the ordered set where threadId = &#63;.
411            *
412            * <p>
413            * 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.
414            * </p>
415            *
416            * @param threadFlagId the primary key of the current message boards thread flag
417            * @param threadId the thread ID
418            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
419            * @return the previous, current, and next message boards thread flag
420            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a message boards thread flag with the primary key could not be found
421            * @throws SystemException if a system exception occurred
422            */
423            public static com.liferay.portlet.messageboards.model.MBThreadFlag[] findByThreadId_PrevAndNext(
424                    long threadFlagId, long threadId,
425                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
426                    throws com.liferay.portal.kernel.exception.SystemException,
427                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
428                    return getPersistence()
429                                       .findByThreadId_PrevAndNext(threadFlagId, threadId,
430                            orderByComparator);
431            }
432    
433            /**
434            * Returns the message boards thread flag where userId = &#63; and threadId = &#63; or throws a {@link com.liferay.portlet.messageboards.NoSuchThreadFlagException} if it could not be found.
435            *
436            * @param userId the user ID
437            * @param threadId the thread ID
438            * @return the matching message boards thread flag
439            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a matching message boards thread flag could not be found
440            * @throws SystemException if a system exception occurred
441            */
442            public static com.liferay.portlet.messageboards.model.MBThreadFlag findByU_T(
443                    long userId, long threadId)
444                    throws com.liferay.portal.kernel.exception.SystemException,
445                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
446                    return getPersistence().findByU_T(userId, threadId);
447            }
448    
449            /**
450            * Returns the message boards thread flag where userId = &#63; and threadId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
451            *
452            * @param userId the user ID
453            * @param threadId the thread ID
454            * @return the matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
455            * @throws SystemException if a system exception occurred
456            */
457            public static com.liferay.portlet.messageboards.model.MBThreadFlag fetchByU_T(
458                    long userId, long threadId)
459                    throws com.liferay.portal.kernel.exception.SystemException {
460                    return getPersistence().fetchByU_T(userId, threadId);
461            }
462    
463            /**
464            * Returns the message boards thread flag where userId = &#63; and threadId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
465            *
466            * @param userId the user ID
467            * @param threadId the thread ID
468            * @param retrieveFromCache whether to use the finder cache
469            * @return the matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
470            * @throws SystemException if a system exception occurred
471            */
472            public static com.liferay.portlet.messageboards.model.MBThreadFlag fetchByU_T(
473                    long userId, long threadId, boolean retrieveFromCache)
474                    throws com.liferay.portal.kernel.exception.SystemException {
475                    return getPersistence().fetchByU_T(userId, threadId, retrieveFromCache);
476            }
477    
478            /**
479            * Returns all the message boards thread flags.
480            *
481            * @return the message boards thread flags
482            * @throws SystemException if a system exception occurred
483            */
484            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findAll()
485                    throws com.liferay.portal.kernel.exception.SystemException {
486                    return getPersistence().findAll();
487            }
488    
489            /**
490            * Returns a range of all the message boards thread flags.
491            *
492            * <p>
493            * 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.
494            * </p>
495            *
496            * @param start the lower bound of the range of message boards thread flags
497            * @param end the upper bound of the range of message boards thread flags (not inclusive)
498            * @return the range of message boards thread flags
499            * @throws SystemException if a system exception occurred
500            */
501            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findAll(
502                    int start, int end)
503                    throws com.liferay.portal.kernel.exception.SystemException {
504                    return getPersistence().findAll(start, end);
505            }
506    
507            /**
508            * Returns an ordered range of all the message boards thread flags.
509            *
510            * <p>
511            * 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.
512            * </p>
513            *
514            * @param start the lower bound of the range of message boards thread flags
515            * @param end the upper bound of the range of message boards thread flags (not inclusive)
516            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
517            * @return the ordered range of message boards thread flags
518            * @throws SystemException if a system exception occurred
519            */
520            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findAll(
521                    int start, int end,
522                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
523                    throws com.liferay.portal.kernel.exception.SystemException {
524                    return getPersistence().findAll(start, end, orderByComparator);
525            }
526    
527            /**
528            * Removes all the message boards thread flags where userId = &#63; from the database.
529            *
530            * @param userId the user ID
531            * @throws SystemException if a system exception occurred
532            */
533            public static void removeByUserId(long userId)
534                    throws com.liferay.portal.kernel.exception.SystemException {
535                    getPersistence().removeByUserId(userId);
536            }
537    
538            /**
539            * Removes all the message boards thread flags where threadId = &#63; from the database.
540            *
541            * @param threadId the thread ID
542            * @throws SystemException if a system exception occurred
543            */
544            public static void removeByThreadId(long threadId)
545                    throws com.liferay.portal.kernel.exception.SystemException {
546                    getPersistence().removeByThreadId(threadId);
547            }
548    
549            /**
550            * Removes the message boards thread flag where userId = &#63; and threadId = &#63; from the database.
551            *
552            * @param userId the user ID
553            * @param threadId the thread ID
554            * @throws SystemException if a system exception occurred
555            */
556            public static void removeByU_T(long userId, long threadId)
557                    throws com.liferay.portal.kernel.exception.SystemException,
558                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
559                    getPersistence().removeByU_T(userId, threadId);
560            }
561    
562            /**
563            * Removes all the message boards thread flags from the database.
564            *
565            * @throws SystemException if a system exception occurred
566            */
567            public static void removeAll()
568                    throws com.liferay.portal.kernel.exception.SystemException {
569                    getPersistence().removeAll();
570            }
571    
572            /**
573            * Returns the number of message boards thread flags where userId = &#63;.
574            *
575            * @param userId the user ID
576            * @return the number of matching message boards thread flags
577            * @throws SystemException if a system exception occurred
578            */
579            public static int countByUserId(long userId)
580                    throws com.liferay.portal.kernel.exception.SystemException {
581                    return getPersistence().countByUserId(userId);
582            }
583    
584            /**
585            * Returns the number of message boards thread flags where threadId = &#63;.
586            *
587            * @param threadId the thread ID
588            * @return the number of matching message boards thread flags
589            * @throws SystemException if a system exception occurred
590            */
591            public static int countByThreadId(long threadId)
592                    throws com.liferay.portal.kernel.exception.SystemException {
593                    return getPersistence().countByThreadId(threadId);
594            }
595    
596            /**
597            * Returns the number of message boards thread flags where userId = &#63; and threadId = &#63;.
598            *
599            * @param userId the user ID
600            * @param threadId the thread ID
601            * @return the number of matching message boards thread flags
602            * @throws SystemException if a system exception occurred
603            */
604            public static int countByU_T(long userId, long threadId)
605                    throws com.liferay.portal.kernel.exception.SystemException {
606                    return getPersistence().countByU_T(userId, threadId);
607            }
608    
609            /**
610            * Returns the number of message boards thread flags.
611            *
612            * @return the number of message boards thread flags
613            * @throws SystemException if a system exception occurred
614            */
615            public static int countAll()
616                    throws com.liferay.portal.kernel.exception.SystemException {
617                    return getPersistence().countAll();
618            }
619    
620            public static MBThreadFlagPersistence getPersistence() {
621                    if (_persistence == null) {
622                            _persistence = (MBThreadFlagPersistence)PortalBeanLocatorUtil.locate(MBThreadFlagPersistence.class.getName());
623    
624                            ReferenceRegistry.registerReference(MBThreadFlagUtil.class,
625                                    "_persistence");
626                    }
627    
628                    return _persistence;
629            }
630    
631            public void setPersistence(MBThreadFlagPersistence persistence) {
632                    _persistence = persistence;
633    
634                    ReferenceRegistry.registerReference(MBThreadFlagUtil.class,
635                            "_persistence");
636            }
637    
638            private static MBThreadFlagPersistence _persistence;
639    }