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)
099             */
100            public static MBThreadFlag update(MBThreadFlag mbThreadFlag)
101                    throws SystemException {
102                    return getPersistence().update(mbThreadFlag);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
107             */
108            public static MBThreadFlag update(MBThreadFlag mbThreadFlag,
109                    ServiceContext serviceContext) throws SystemException {
110                    return getPersistence().update(mbThreadFlag, 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                    throws com.liferay.portal.kernel.exception.SystemException {
162                    return getPersistence().updateImpl(mbThreadFlag);
163            }
164    
165            /**
166            * 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.
167            *
168            * @param threadFlagId the primary key of the message boards thread flag
169            * @return the message boards thread flag
170            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a message boards thread flag 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.MBThreadFlag findByPrimaryKey(
174                    long threadFlagId)
175                    throws com.liferay.portal.kernel.exception.SystemException,
176                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
177                    return getPersistence().findByPrimaryKey(threadFlagId);
178            }
179    
180            /**
181            * Returns the message boards thread flag with the primary key or returns <code>null</code> if it could not be found.
182            *
183            * @param threadFlagId the primary key of the message boards thread flag
184            * @return the message boards thread flag, or <code>null</code> if a message boards thread flag 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.MBThreadFlag fetchByPrimaryKey(
188                    long threadFlagId)
189                    throws com.liferay.portal.kernel.exception.SystemException {
190                    return getPersistence().fetchByPrimaryKey(threadFlagId);
191            }
192    
193            /**
194            * Returns all the message boards thread flags where userId = &#63;.
195            *
196            * @param userId the user ID
197            * @return the matching message boards thread flags
198            * @throws SystemException if a system exception occurred
199            */
200            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findByUserId(
201                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
202                    return getPersistence().findByUserId(userId);
203            }
204    
205            /**
206            * Returns a range of all the message boards thread flags where userId = &#63;.
207            *
208            * <p>
209            * 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.
210            * </p>
211            *
212            * @param userId the user ID
213            * @param start the lower bound of the range of message boards thread flags
214            * @param end the upper bound of the range of message boards thread flags (not inclusive)
215            * @return the range of matching message boards thread flags
216            * @throws SystemException if a system exception occurred
217            */
218            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findByUserId(
219                    long userId, int start, int end)
220                    throws com.liferay.portal.kernel.exception.SystemException {
221                    return getPersistence().findByUserId(userId, start, end);
222            }
223    
224            /**
225            * Returns an ordered range of all the message boards thread flags where userId = &#63;.
226            *
227            * <p>
228            * 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.
229            * </p>
230            *
231            * @param userId the user ID
232            * @param start the lower bound of the range of message boards thread flags
233            * @param end the upper bound of the range of message boards thread flags (not inclusive)
234            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
235            * @return the ordered range of matching message boards thread flags
236            * @throws SystemException if a system exception occurred
237            */
238            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findByUserId(
239                    long userId, int start, int end,
240                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
241                    throws com.liferay.portal.kernel.exception.SystemException {
242                    return getPersistence()
243                                       .findByUserId(userId, start, end, orderByComparator);
244            }
245    
246            /**
247            * Returns the first message boards thread flag in the ordered set where userId = &#63;.
248            *
249            * @param userId the user ID
250            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
251            * @return the first matching message boards thread flag
252            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a matching message boards thread flag could not be found
253            * @throws SystemException if a system exception occurred
254            */
255            public static com.liferay.portlet.messageboards.model.MBThreadFlag findByUserId_First(
256                    long userId,
257                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
258                    throws com.liferay.portal.kernel.exception.SystemException,
259                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
260                    return getPersistence().findByUserId_First(userId, orderByComparator);
261            }
262    
263            /**
264            * Returns the first message boards thread flag in the ordered set where userId = &#63;.
265            *
266            * @param userId the user ID
267            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
268            * @return the first matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
269            * @throws SystemException if a system exception occurred
270            */
271            public static com.liferay.portlet.messageboards.model.MBThreadFlag fetchByUserId_First(
272                    long userId,
273                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
274                    throws com.liferay.portal.kernel.exception.SystemException {
275                    return getPersistence().fetchByUserId_First(userId, orderByComparator);
276            }
277    
278            /**
279            * Returns the last message boards thread flag in the ordered set where userId = &#63;.
280            *
281            * @param userId the user ID
282            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
283            * @return the last matching message boards thread flag
284            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a matching message boards thread flag could not be found
285            * @throws SystemException if a system exception occurred
286            */
287            public static com.liferay.portlet.messageboards.model.MBThreadFlag findByUserId_Last(
288                    long userId,
289                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
290                    throws com.liferay.portal.kernel.exception.SystemException,
291                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
292                    return getPersistence().findByUserId_Last(userId, orderByComparator);
293            }
294    
295            /**
296            * Returns the last message boards thread flag in the ordered set where userId = &#63;.
297            *
298            * @param userId the user ID
299            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
300            * @return the last matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
301            * @throws SystemException if a system exception occurred
302            */
303            public static com.liferay.portlet.messageboards.model.MBThreadFlag fetchByUserId_Last(
304                    long userId,
305                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
306                    throws com.liferay.portal.kernel.exception.SystemException {
307                    return getPersistence().fetchByUserId_Last(userId, orderByComparator);
308            }
309    
310            /**
311            * Returns the message boards thread flags before and after the current message boards thread flag in the ordered set where userId = &#63;.
312            *
313            * @param threadFlagId the primary key of the current message boards thread flag
314            * @param userId the user ID
315            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
316            * @return the previous, current, and next message boards thread flag
317            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a message boards thread flag with the primary key could not be found
318            * @throws SystemException if a system exception occurred
319            */
320            public static com.liferay.portlet.messageboards.model.MBThreadFlag[] findByUserId_PrevAndNext(
321                    long threadFlagId, long userId,
322                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
323                    throws com.liferay.portal.kernel.exception.SystemException,
324                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
325                    return getPersistence()
326                                       .findByUserId_PrevAndNext(threadFlagId, userId,
327                            orderByComparator);
328            }
329    
330            /**
331            * Returns all the message boards thread flags where threadId = &#63;.
332            *
333            * @param threadId the thread ID
334            * @return the matching message boards thread flags
335            * @throws SystemException if a system exception occurred
336            */
337            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findByThreadId(
338                    long threadId)
339                    throws com.liferay.portal.kernel.exception.SystemException {
340                    return getPersistence().findByThreadId(threadId);
341            }
342    
343            /**
344            * Returns a range of all the message boards thread flags where threadId = &#63;.
345            *
346            * <p>
347            * 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.
348            * </p>
349            *
350            * @param threadId the thread ID
351            * @param start the lower bound of the range of message boards thread flags
352            * @param end the upper bound of the range of message boards thread flags (not inclusive)
353            * @return the range of matching message boards thread flags
354            * @throws SystemException if a system exception occurred
355            */
356            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findByThreadId(
357                    long threadId, int start, int end)
358                    throws com.liferay.portal.kernel.exception.SystemException {
359                    return getPersistence().findByThreadId(threadId, start, end);
360            }
361    
362            /**
363            * Returns an ordered range of all the message boards thread flags where threadId = &#63;.
364            *
365            * <p>
366            * 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.
367            * </p>
368            *
369            * @param threadId the thread ID
370            * @param start the lower bound of the range of message boards thread flags
371            * @param end the upper bound of the range of message boards thread flags (not inclusive)
372            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
373            * @return the ordered range of matching message boards thread flags
374            * @throws SystemException if a system exception occurred
375            */
376            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findByThreadId(
377                    long threadId, int start, int end,
378                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
379                    throws com.liferay.portal.kernel.exception.SystemException {
380                    return getPersistence()
381                                       .findByThreadId(threadId, start, end, orderByComparator);
382            }
383    
384            /**
385            * Returns the first message boards thread flag in the ordered set where threadId = &#63;.
386            *
387            * @param threadId the thread ID
388            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
389            * @return the first matching message boards thread flag
390            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a matching message boards thread flag could not be found
391            * @throws SystemException if a system exception occurred
392            */
393            public static com.liferay.portlet.messageboards.model.MBThreadFlag findByThreadId_First(
394                    long threadId,
395                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
396                    throws com.liferay.portal.kernel.exception.SystemException,
397                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
398                    return getPersistence().findByThreadId_First(threadId, orderByComparator);
399            }
400    
401            /**
402            * Returns the first message boards thread flag in the ordered set where threadId = &#63;.
403            *
404            * @param threadId the thread ID
405            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
406            * @return the first matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
407            * @throws SystemException if a system exception occurred
408            */
409            public static com.liferay.portlet.messageboards.model.MBThreadFlag fetchByThreadId_First(
410                    long threadId,
411                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
412                    throws com.liferay.portal.kernel.exception.SystemException {
413                    return getPersistence()
414                                       .fetchByThreadId_First(threadId, orderByComparator);
415            }
416    
417            /**
418            * Returns the last message boards thread flag in the ordered set where threadId = &#63;.
419            *
420            * @param threadId the thread ID
421            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
422            * @return the last matching message boards thread flag
423            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a matching message boards thread flag could not be found
424            * @throws SystemException if a system exception occurred
425            */
426            public static com.liferay.portlet.messageboards.model.MBThreadFlag findByThreadId_Last(
427                    long threadId,
428                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
429                    throws com.liferay.portal.kernel.exception.SystemException,
430                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
431                    return getPersistence().findByThreadId_Last(threadId, orderByComparator);
432            }
433    
434            /**
435            * Returns the last message boards thread flag in the ordered set where threadId = &#63;.
436            *
437            * @param threadId the thread ID
438            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
439            * @return the last matching message boards thread flag, or <code>null</code> 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 fetchByThreadId_Last(
443                    long threadId,
444                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
445                    throws com.liferay.portal.kernel.exception.SystemException {
446                    return getPersistence().fetchByThreadId_Last(threadId, orderByComparator);
447            }
448    
449            /**
450            * Returns the message boards thread flags before and after the current message boards thread flag in the ordered set where threadId = &#63;.
451            *
452            * @param threadFlagId the primary key of the current message boards thread flag
453            * @param threadId the thread ID
454            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
455            * @return the previous, current, and next message boards thread flag
456            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a message boards thread flag 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.MBThreadFlag[] findByThreadId_PrevAndNext(
460                    long threadFlagId, long threadId,
461                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
462                    throws com.liferay.portal.kernel.exception.SystemException,
463                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
464                    return getPersistence()
465                                       .findByThreadId_PrevAndNext(threadFlagId, threadId,
466                            orderByComparator);
467            }
468    
469            /**
470            * 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.
471            *
472            * @param userId the user ID
473            * @param threadId the thread ID
474            * @return the matching message boards thread flag
475            * @throws com.liferay.portlet.messageboards.NoSuchThreadFlagException if a matching message boards thread flag could not be found
476            * @throws SystemException if a system exception occurred
477            */
478            public static com.liferay.portlet.messageboards.model.MBThreadFlag findByU_T(
479                    long userId, long threadId)
480                    throws com.liferay.portal.kernel.exception.SystemException,
481                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
482                    return getPersistence().findByU_T(userId, threadId);
483            }
484    
485            /**
486            * 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.
487            *
488            * @param userId the user ID
489            * @param threadId the thread ID
490            * @return the matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
491            * @throws SystemException if a system exception occurred
492            */
493            public static com.liferay.portlet.messageboards.model.MBThreadFlag fetchByU_T(
494                    long userId, long threadId)
495                    throws com.liferay.portal.kernel.exception.SystemException {
496                    return getPersistence().fetchByU_T(userId, threadId);
497            }
498    
499            /**
500            * 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.
501            *
502            * @param userId the user ID
503            * @param threadId the thread ID
504            * @param retrieveFromCache whether to use the finder cache
505            * @return the matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
506            * @throws SystemException if a system exception occurred
507            */
508            public static com.liferay.portlet.messageboards.model.MBThreadFlag fetchByU_T(
509                    long userId, long threadId, boolean retrieveFromCache)
510                    throws com.liferay.portal.kernel.exception.SystemException {
511                    return getPersistence().fetchByU_T(userId, threadId, retrieveFromCache);
512            }
513    
514            /**
515            * Returns all the message boards thread flags.
516            *
517            * @return the 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                    throws com.liferay.portal.kernel.exception.SystemException {
522                    return getPersistence().findAll();
523            }
524    
525            /**
526            * Returns a range of all the message boards thread flags.
527            *
528            * <p>
529            * 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.
530            * </p>
531            *
532            * @param start the lower bound of the range of message boards thread flags
533            * @param end the upper bound of the range of message boards thread flags (not inclusive)
534            * @return the range of message boards thread flags
535            * @throws SystemException if a system exception occurred
536            */
537            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findAll(
538                    int start, int end)
539                    throws com.liferay.portal.kernel.exception.SystemException {
540                    return getPersistence().findAll(start, end);
541            }
542    
543            /**
544            * Returns an ordered range of all the message boards thread flags.
545            *
546            * <p>
547            * 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.
548            * </p>
549            *
550            * @param start the lower bound of the range of message boards thread flags
551            * @param end the upper bound of the range of message boards thread flags (not inclusive)
552            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
553            * @return the ordered range of message boards thread flags
554            * @throws SystemException if a system exception occurred
555            */
556            public static java.util.List<com.liferay.portlet.messageboards.model.MBThreadFlag> findAll(
557                    int start, int end,
558                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
559                    throws com.liferay.portal.kernel.exception.SystemException {
560                    return getPersistence().findAll(start, end, orderByComparator);
561            }
562    
563            /**
564            * Removes all the message boards thread flags where userId = &#63; from the database.
565            *
566            * @param userId the user ID
567            * @throws SystemException if a system exception occurred
568            */
569            public static void removeByUserId(long userId)
570                    throws com.liferay.portal.kernel.exception.SystemException {
571                    getPersistence().removeByUserId(userId);
572            }
573    
574            /**
575            * Removes all the message boards thread flags where threadId = &#63; from the database.
576            *
577            * @param threadId the thread ID
578            * @throws SystemException if a system exception occurred
579            */
580            public static void removeByThreadId(long threadId)
581                    throws com.liferay.portal.kernel.exception.SystemException {
582                    getPersistence().removeByThreadId(threadId);
583            }
584    
585            /**
586            * Removes the message boards thread flag where userId = &#63; and threadId = &#63; from the database.
587            *
588            * @param userId the user ID
589            * @param threadId the thread ID
590            * @return the message boards thread flag that was removed
591            * @throws SystemException if a system exception occurred
592            */
593            public static com.liferay.portlet.messageboards.model.MBThreadFlag removeByU_T(
594                    long userId, long threadId)
595                    throws com.liferay.portal.kernel.exception.SystemException,
596                            com.liferay.portlet.messageboards.NoSuchThreadFlagException {
597                    return getPersistence().removeByU_T(userId, threadId);
598            }
599    
600            /**
601            * Removes all the message boards thread flags from the database.
602            *
603            * @throws SystemException if a system exception occurred
604            */
605            public static void removeAll()
606                    throws com.liferay.portal.kernel.exception.SystemException {
607                    getPersistence().removeAll();
608            }
609    
610            /**
611            * Returns the number of message boards thread flags where userId = &#63;.
612            *
613            * @param userId the user ID
614            * @return the number of matching message boards thread flags
615            * @throws SystemException if a system exception occurred
616            */
617            public static int countByUserId(long userId)
618                    throws com.liferay.portal.kernel.exception.SystemException {
619                    return getPersistence().countByUserId(userId);
620            }
621    
622            /**
623            * Returns the number of message boards thread flags where threadId = &#63;.
624            *
625            * @param threadId the thread ID
626            * @return the number of matching message boards thread flags
627            * @throws SystemException if a system exception occurred
628            */
629            public static int countByThreadId(long threadId)
630                    throws com.liferay.portal.kernel.exception.SystemException {
631                    return getPersistence().countByThreadId(threadId);
632            }
633    
634            /**
635            * Returns the number of message boards thread flags where userId = &#63; and threadId = &#63;.
636            *
637            * @param userId the user ID
638            * @param threadId the thread ID
639            * @return the number of matching message boards thread flags
640            * @throws SystemException if a system exception occurred
641            */
642            public static int countByU_T(long userId, long threadId)
643                    throws com.liferay.portal.kernel.exception.SystemException {
644                    return getPersistence().countByU_T(userId, threadId);
645            }
646    
647            /**
648            * Returns the number of message boards thread flags.
649            *
650            * @return the number of message boards thread flags
651            * @throws SystemException if a system exception occurred
652            */
653            public static int countAll()
654                    throws com.liferay.portal.kernel.exception.SystemException {
655                    return getPersistence().countAll();
656            }
657    
658            public static MBThreadFlagPersistence getPersistence() {
659                    if (_persistence == null) {
660                            _persistence = (MBThreadFlagPersistence)PortalBeanLocatorUtil.locate(MBThreadFlagPersistence.class.getName());
661    
662                            ReferenceRegistry.registerReference(MBThreadFlagUtil.class,
663                                    "_persistence");
664                    }
665    
666                    return _persistence;
667            }
668    
669            /**
670             * @deprecated
671             */
672            public void setPersistence(MBThreadFlagPersistence persistence) {
673            }
674    
675            private static MBThreadFlagPersistence _persistence;
676    }