001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.util.OrderByComparator;
022    import com.liferay.portal.kernel.util.ReferenceRegistry;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import com.liferay.portlet.messageboards.model.MBThreadFlag;
026    
027    import java.util.List;
028    
029    /**
030     * The persistence utility for the message boards thread flag service. This utility wraps {@link com.liferay.portlet.messageboards.service.persistence.impl.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.
031     *
032     * <p>
033     * Caching information and settings can be found in <code>portal.properties</code>
034     * </p>
035     *
036     * @author Brian Wing Shun Chan
037     * @see MBThreadFlagPersistence
038     * @see com.liferay.portlet.messageboards.service.persistence.impl.MBThreadFlagPersistenceImpl
039     * @generated
040     */
041    @ProviderType
042    public class MBThreadFlagUtil {
043            /*
044             * NOTE FOR DEVELOPERS:
045             *
046             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
047             */
048    
049            /**
050             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
051             */
052            public static void clearCache() {
053                    getPersistence().clearCache();
054            }
055    
056            /**
057             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
058             */
059            public static void clearCache(MBThreadFlag mbThreadFlag) {
060                    getPersistence().clearCache(mbThreadFlag);
061            }
062    
063            /**
064             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
065             */
066            public static long countWithDynamicQuery(DynamicQuery dynamicQuery) {
067                    return getPersistence().countWithDynamicQuery(dynamicQuery);
068            }
069    
070            /**
071             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
072             */
073            public static List<MBThreadFlag> findWithDynamicQuery(
074                    DynamicQuery dynamicQuery) {
075                    return getPersistence().findWithDynamicQuery(dynamicQuery);
076            }
077    
078            /**
079             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
080             */
081            public static List<MBThreadFlag> findWithDynamicQuery(
082                    DynamicQuery dynamicQuery, int start, int end) {
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<MBThreadFlag> orderByComparator) {
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                    return getPersistence().update(mbThreadFlag);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
106             */
107            public static MBThreadFlag update(MBThreadFlag mbThreadFlag,
108                    ServiceContext serviceContext) {
109                    return getPersistence().update(mbThreadFlag, serviceContext);
110            }
111    
112            /**
113            * Returns all the message boards thread flags where uuid = &#63;.
114            *
115            * @param uuid the uuid
116            * @return the matching message boards thread flags
117            */
118            public static List<MBThreadFlag> findByUuid(java.lang.String uuid) {
119                    return getPersistence().findByUuid(uuid);
120            }
121    
122            /**
123            * Returns a range of all the message boards thread flags where uuid = &#63;.
124            *
125            * <p>
126            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link MBThreadFlagModelImpl}. 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.
127            * </p>
128            *
129            * @param uuid the uuid
130            * @param start the lower bound of the range of message boards thread flags
131            * @param end the upper bound of the range of message boards thread flags (not inclusive)
132            * @return the range of matching message boards thread flags
133            */
134            public static List<MBThreadFlag> findByUuid(java.lang.String uuid,
135                    int start, int end) {
136                    return getPersistence().findByUuid(uuid, start, end);
137            }
138    
139            /**
140            * Returns an ordered range of all the message boards thread flags where uuid = &#63;.
141            *
142            * <p>
143            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link MBThreadFlagModelImpl}. 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.
144            * </p>
145            *
146            * @param uuid the uuid
147            * @param start the lower bound of the range of message boards thread flags
148            * @param end the upper bound of the range of message boards thread flags (not inclusive)
149            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
150            * @return the ordered range of matching message boards thread flags
151            */
152            public static List<MBThreadFlag> findByUuid(java.lang.String uuid,
153                    int start, int end, OrderByComparator<MBThreadFlag> orderByComparator) {
154                    return getPersistence().findByUuid(uuid, start, end, orderByComparator);
155            }
156    
157            /**
158            * Returns the first message boards thread flag in the ordered set where uuid = &#63;.
159            *
160            * @param uuid the uuid
161            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
162            * @return the first matching message boards thread flag
163            * @throws NoSuchThreadFlagException if a matching message boards thread flag could not be found
164            */
165            public static MBThreadFlag findByUuid_First(java.lang.String uuid,
166                    OrderByComparator<MBThreadFlag> orderByComparator)
167                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
168                    return getPersistence().findByUuid_First(uuid, orderByComparator);
169            }
170    
171            /**
172            * Returns the first message boards thread flag in the ordered set where uuid = &#63;.
173            *
174            * @param uuid the uuid
175            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
176            * @return the first matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
177            */
178            public static MBThreadFlag fetchByUuid_First(java.lang.String uuid,
179                    OrderByComparator<MBThreadFlag> orderByComparator) {
180                    return getPersistence().fetchByUuid_First(uuid, orderByComparator);
181            }
182    
183            /**
184            * Returns the last message boards thread flag in the ordered set where uuid = &#63;.
185            *
186            * @param uuid the uuid
187            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
188            * @return the last matching message boards thread flag
189            * @throws NoSuchThreadFlagException if a matching message boards thread flag could not be found
190            */
191            public static MBThreadFlag findByUuid_Last(java.lang.String uuid,
192                    OrderByComparator<MBThreadFlag> orderByComparator)
193                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
194                    return getPersistence().findByUuid_Last(uuid, orderByComparator);
195            }
196    
197            /**
198            * Returns the last message boards thread flag in the ordered set where uuid = &#63;.
199            *
200            * @param uuid the uuid
201            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
202            * @return the last matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
203            */
204            public static MBThreadFlag fetchByUuid_Last(java.lang.String uuid,
205                    OrderByComparator<MBThreadFlag> orderByComparator) {
206                    return getPersistence().fetchByUuid_Last(uuid, orderByComparator);
207            }
208    
209            /**
210            * Returns the message boards thread flags before and after the current message boards thread flag in the ordered set where uuid = &#63;.
211            *
212            * @param threadFlagId the primary key of the current message boards thread flag
213            * @param uuid the uuid
214            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
215            * @return the previous, current, and next message boards thread flag
216            * @throws NoSuchThreadFlagException if a message boards thread flag with the primary key could not be found
217            */
218            public static MBThreadFlag[] findByUuid_PrevAndNext(long threadFlagId,
219                    java.lang.String uuid, OrderByComparator<MBThreadFlag> orderByComparator)
220                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
221                    return getPersistence()
222                                       .findByUuid_PrevAndNext(threadFlagId, uuid, orderByComparator);
223            }
224    
225            /**
226            * Removes all the message boards thread flags where uuid = &#63; from the database.
227            *
228            * @param uuid the uuid
229            */
230            public static void removeByUuid(java.lang.String uuid) {
231                    getPersistence().removeByUuid(uuid);
232            }
233    
234            /**
235            * Returns the number of message boards thread flags where uuid = &#63;.
236            *
237            * @param uuid the uuid
238            * @return the number of matching message boards thread flags
239            */
240            public static int countByUuid(java.lang.String uuid) {
241                    return getPersistence().countByUuid(uuid);
242            }
243    
244            /**
245            * Returns the message boards thread flag where uuid = &#63; and groupId = &#63; or throws a {@link NoSuchThreadFlagException} if it could not be found.
246            *
247            * @param uuid the uuid
248            * @param groupId the group ID
249            * @return the matching message boards thread flag
250            * @throws NoSuchThreadFlagException if a matching message boards thread flag could not be found
251            */
252            public static MBThreadFlag findByUUID_G(java.lang.String uuid, long groupId)
253                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
254                    return getPersistence().findByUUID_G(uuid, groupId);
255            }
256    
257            /**
258            * Returns the message boards thread flag where uuid = &#63; and groupId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
259            *
260            * @param uuid the uuid
261            * @param groupId the group ID
262            * @return the matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
263            */
264            public static MBThreadFlag fetchByUUID_G(java.lang.String uuid, long groupId) {
265                    return getPersistence().fetchByUUID_G(uuid, groupId);
266            }
267    
268            /**
269            * Returns the message boards thread flag where uuid = &#63; and groupId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
270            *
271            * @param uuid the uuid
272            * @param groupId the group ID
273            * @param retrieveFromCache whether to use the finder cache
274            * @return the matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
275            */
276            public static MBThreadFlag fetchByUUID_G(java.lang.String uuid,
277                    long groupId, boolean retrieveFromCache) {
278                    return getPersistence().fetchByUUID_G(uuid, groupId, retrieveFromCache);
279            }
280    
281            /**
282            * Removes the message boards thread flag where uuid = &#63; and groupId = &#63; from the database.
283            *
284            * @param uuid the uuid
285            * @param groupId the group ID
286            * @return the message boards thread flag that was removed
287            */
288            public static MBThreadFlag removeByUUID_G(java.lang.String uuid,
289                    long groupId)
290                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
291                    return getPersistence().removeByUUID_G(uuid, groupId);
292            }
293    
294            /**
295            * Returns the number of message boards thread flags where uuid = &#63; and groupId = &#63;.
296            *
297            * @param uuid the uuid
298            * @param groupId the group ID
299            * @return the number of matching message boards thread flags
300            */
301            public static int countByUUID_G(java.lang.String uuid, long groupId) {
302                    return getPersistence().countByUUID_G(uuid, groupId);
303            }
304    
305            /**
306            * Returns all the message boards thread flags where uuid = &#63; and companyId = &#63;.
307            *
308            * @param uuid the uuid
309            * @param companyId the company ID
310            * @return the matching message boards thread flags
311            */
312            public static List<MBThreadFlag> findByUuid_C(java.lang.String uuid,
313                    long companyId) {
314                    return getPersistence().findByUuid_C(uuid, companyId);
315            }
316    
317            /**
318            * Returns a range of all the message boards thread flags where uuid = &#63; and companyId = &#63;.
319            *
320            * <p>
321            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link MBThreadFlagModelImpl}. 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.
322            * </p>
323            *
324            * @param uuid the uuid
325            * @param companyId the company ID
326            * @param start the lower bound of the range of message boards thread flags
327            * @param end the upper bound of the range of message boards thread flags (not inclusive)
328            * @return the range of matching message boards thread flags
329            */
330            public static List<MBThreadFlag> findByUuid_C(java.lang.String uuid,
331                    long companyId, int start, int end) {
332                    return getPersistence().findByUuid_C(uuid, companyId, start, end);
333            }
334    
335            /**
336            * Returns an ordered range of all the message boards thread flags where uuid = &#63; and companyId = &#63;.
337            *
338            * <p>
339            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link MBThreadFlagModelImpl}. 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.
340            * </p>
341            *
342            * @param uuid the uuid
343            * @param companyId the company ID
344            * @param start the lower bound of the range of message boards thread flags
345            * @param end the upper bound of the range of message boards thread flags (not inclusive)
346            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
347            * @return the ordered range of matching message boards thread flags
348            */
349            public static List<MBThreadFlag> findByUuid_C(java.lang.String uuid,
350                    long companyId, int start, int end,
351                    OrderByComparator<MBThreadFlag> orderByComparator) {
352                    return getPersistence()
353                                       .findByUuid_C(uuid, companyId, start, end, orderByComparator);
354            }
355    
356            /**
357            * Returns the first message boards thread flag in the ordered set where uuid = &#63; and companyId = &#63;.
358            *
359            * @param uuid the uuid
360            * @param companyId the company ID
361            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
362            * @return the first matching message boards thread flag
363            * @throws NoSuchThreadFlagException if a matching message boards thread flag could not be found
364            */
365            public static MBThreadFlag findByUuid_C_First(java.lang.String uuid,
366                    long companyId, OrderByComparator<MBThreadFlag> orderByComparator)
367                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
368                    return getPersistence()
369                                       .findByUuid_C_First(uuid, companyId, orderByComparator);
370            }
371    
372            /**
373            * Returns the first message boards thread flag in the ordered set where uuid = &#63; and companyId = &#63;.
374            *
375            * @param uuid the uuid
376            * @param companyId the company ID
377            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
378            * @return the first matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
379            */
380            public static MBThreadFlag fetchByUuid_C_First(java.lang.String uuid,
381                    long companyId, OrderByComparator<MBThreadFlag> orderByComparator) {
382                    return getPersistence()
383                                       .fetchByUuid_C_First(uuid, companyId, orderByComparator);
384            }
385    
386            /**
387            * Returns the last message boards thread flag in the ordered set where uuid = &#63; and companyId = &#63;.
388            *
389            * @param uuid the uuid
390            * @param companyId the company ID
391            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
392            * @return the last matching message boards thread flag
393            * @throws NoSuchThreadFlagException if a matching message boards thread flag could not be found
394            */
395            public static MBThreadFlag findByUuid_C_Last(java.lang.String uuid,
396                    long companyId, OrderByComparator<MBThreadFlag> orderByComparator)
397                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
398                    return getPersistence()
399                                       .findByUuid_C_Last(uuid, companyId, orderByComparator);
400            }
401    
402            /**
403            * Returns the last message boards thread flag in the ordered set where uuid = &#63; and companyId = &#63;.
404            *
405            * @param uuid the uuid
406            * @param companyId the company ID
407            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
408            * @return the last matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
409            */
410            public static MBThreadFlag fetchByUuid_C_Last(java.lang.String uuid,
411                    long companyId, OrderByComparator<MBThreadFlag> orderByComparator) {
412                    return getPersistence()
413                                       .fetchByUuid_C_Last(uuid, companyId, orderByComparator);
414            }
415    
416            /**
417            * Returns the message boards thread flags before and after the current message boards thread flag in the ordered set where uuid = &#63; and companyId = &#63;.
418            *
419            * @param threadFlagId the primary key of the current message boards thread flag
420            * @param uuid the uuid
421            * @param companyId the company ID
422            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
423            * @return the previous, current, and next message boards thread flag
424            * @throws NoSuchThreadFlagException if a message boards thread flag with the primary key could not be found
425            */
426            public static MBThreadFlag[] findByUuid_C_PrevAndNext(long threadFlagId,
427                    java.lang.String uuid, long companyId,
428                    OrderByComparator<MBThreadFlag> orderByComparator)
429                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
430                    return getPersistence()
431                                       .findByUuid_C_PrevAndNext(threadFlagId, uuid, companyId,
432                            orderByComparator);
433            }
434    
435            /**
436            * Removes all the message boards thread flags where uuid = &#63; and companyId = &#63; from the database.
437            *
438            * @param uuid the uuid
439            * @param companyId the company ID
440            */
441            public static void removeByUuid_C(java.lang.String uuid, long companyId) {
442                    getPersistence().removeByUuid_C(uuid, companyId);
443            }
444    
445            /**
446            * Returns the number of message boards thread flags where uuid = &#63; and companyId = &#63;.
447            *
448            * @param uuid the uuid
449            * @param companyId the company ID
450            * @return the number of matching message boards thread flags
451            */
452            public static int countByUuid_C(java.lang.String uuid, long companyId) {
453                    return getPersistence().countByUuid_C(uuid, companyId);
454            }
455    
456            /**
457            * Returns all the message boards thread flags where userId = &#63;.
458            *
459            * @param userId the user ID
460            * @return the matching message boards thread flags
461            */
462            public static List<MBThreadFlag> findByUserId(long userId) {
463                    return getPersistence().findByUserId(userId);
464            }
465    
466            /**
467            * Returns a range of all the message boards thread flags where userId = &#63;.
468            *
469            * <p>
470            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link MBThreadFlagModelImpl}. 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.
471            * </p>
472            *
473            * @param userId the user ID
474            * @param start the lower bound of the range of message boards thread flags
475            * @param end the upper bound of the range of message boards thread flags (not inclusive)
476            * @return the range of matching message boards thread flags
477            */
478            public static List<MBThreadFlag> findByUserId(long userId, int start,
479                    int end) {
480                    return getPersistence().findByUserId(userId, start, end);
481            }
482    
483            /**
484            * Returns an ordered range of all the message boards thread flags where userId = &#63;.
485            *
486            * <p>
487            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link MBThreadFlagModelImpl}. 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.
488            * </p>
489            *
490            * @param userId the user ID
491            * @param start the lower bound of the range of message boards thread flags
492            * @param end the upper bound of the range of message boards thread flags (not inclusive)
493            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
494            * @return the ordered range of matching message boards thread flags
495            */
496            public static List<MBThreadFlag> findByUserId(long userId, int start,
497                    int end, OrderByComparator<MBThreadFlag> orderByComparator) {
498                    return getPersistence()
499                                       .findByUserId(userId, start, end, orderByComparator);
500            }
501    
502            /**
503            * Returns the first message boards thread flag in the ordered set where userId = &#63;.
504            *
505            * @param userId the user ID
506            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
507            * @return the first matching message boards thread flag
508            * @throws NoSuchThreadFlagException if a matching message boards thread flag could not be found
509            */
510            public static MBThreadFlag findByUserId_First(long userId,
511                    OrderByComparator<MBThreadFlag> orderByComparator)
512                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
513                    return getPersistence().findByUserId_First(userId, orderByComparator);
514            }
515    
516            /**
517            * Returns the first message boards thread flag in the ordered set where userId = &#63;.
518            *
519            * @param userId the user ID
520            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
521            * @return the first matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
522            */
523            public static MBThreadFlag fetchByUserId_First(long userId,
524                    OrderByComparator<MBThreadFlag> orderByComparator) {
525                    return getPersistence().fetchByUserId_First(userId, orderByComparator);
526            }
527    
528            /**
529            * Returns the last message boards thread flag in the ordered set where userId = &#63;.
530            *
531            * @param userId the user ID
532            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
533            * @return the last matching message boards thread flag
534            * @throws NoSuchThreadFlagException if a matching message boards thread flag could not be found
535            */
536            public static MBThreadFlag findByUserId_Last(long userId,
537                    OrderByComparator<MBThreadFlag> orderByComparator)
538                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
539                    return getPersistence().findByUserId_Last(userId, orderByComparator);
540            }
541    
542            /**
543            * Returns the last message boards thread flag in the ordered set where userId = &#63;.
544            *
545            * @param userId the user ID
546            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
547            * @return the last matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
548            */
549            public static MBThreadFlag fetchByUserId_Last(long userId,
550                    OrderByComparator<MBThreadFlag> orderByComparator) {
551                    return getPersistence().fetchByUserId_Last(userId, orderByComparator);
552            }
553    
554            /**
555            * Returns the message boards thread flags before and after the current message boards thread flag in the ordered set where userId = &#63;.
556            *
557            * @param threadFlagId the primary key of the current message boards thread flag
558            * @param userId the user ID
559            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
560            * @return the previous, current, and next message boards thread flag
561            * @throws NoSuchThreadFlagException if a message boards thread flag with the primary key could not be found
562            */
563            public static MBThreadFlag[] findByUserId_PrevAndNext(long threadFlagId,
564                    long userId, OrderByComparator<MBThreadFlag> orderByComparator)
565                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
566                    return getPersistence()
567                                       .findByUserId_PrevAndNext(threadFlagId, userId,
568                            orderByComparator);
569            }
570    
571            /**
572            * Removes all the message boards thread flags where userId = &#63; from the database.
573            *
574            * @param userId the user ID
575            */
576            public static void removeByUserId(long userId) {
577                    getPersistence().removeByUserId(userId);
578            }
579    
580            /**
581            * Returns the number of message boards thread flags where userId = &#63;.
582            *
583            * @param userId the user ID
584            * @return the number of matching message boards thread flags
585            */
586            public static int countByUserId(long userId) {
587                    return getPersistence().countByUserId(userId);
588            }
589    
590            /**
591            * Returns all the message boards thread flags where threadId = &#63;.
592            *
593            * @param threadId the thread ID
594            * @return the matching message boards thread flags
595            */
596            public static List<MBThreadFlag> findByThreadId(long threadId) {
597                    return getPersistence().findByThreadId(threadId);
598            }
599    
600            /**
601            * Returns a range of all the message boards thread flags where threadId = &#63;.
602            *
603            * <p>
604            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link MBThreadFlagModelImpl}. 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.
605            * </p>
606            *
607            * @param threadId the thread ID
608            * @param start the lower bound of the range of message boards thread flags
609            * @param end the upper bound of the range of message boards thread flags (not inclusive)
610            * @return the range of matching message boards thread flags
611            */
612            public static List<MBThreadFlag> findByThreadId(long threadId, int start,
613                    int end) {
614                    return getPersistence().findByThreadId(threadId, start, end);
615            }
616    
617            /**
618            * Returns an ordered range of all the message boards thread flags where threadId = &#63;.
619            *
620            * <p>
621            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link MBThreadFlagModelImpl}. 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.
622            * </p>
623            *
624            * @param threadId the thread ID
625            * @param start the lower bound of the range of message boards thread flags
626            * @param end the upper bound of the range of message boards thread flags (not inclusive)
627            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
628            * @return the ordered range of matching message boards thread flags
629            */
630            public static List<MBThreadFlag> findByThreadId(long threadId, int start,
631                    int end, OrderByComparator<MBThreadFlag> orderByComparator) {
632                    return getPersistence()
633                                       .findByThreadId(threadId, start, end, orderByComparator);
634            }
635    
636            /**
637            * Returns the first message boards thread flag in the ordered set where threadId = &#63;.
638            *
639            * @param threadId the thread ID
640            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
641            * @return the first matching message boards thread flag
642            * @throws NoSuchThreadFlagException if a matching message boards thread flag could not be found
643            */
644            public static MBThreadFlag findByThreadId_First(long threadId,
645                    OrderByComparator<MBThreadFlag> orderByComparator)
646                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
647                    return getPersistence().findByThreadId_First(threadId, orderByComparator);
648            }
649    
650            /**
651            * Returns the first message boards thread flag in the ordered set where threadId = &#63;.
652            *
653            * @param threadId the thread ID
654            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
655            * @return the first matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
656            */
657            public static MBThreadFlag fetchByThreadId_First(long threadId,
658                    OrderByComparator<MBThreadFlag> orderByComparator) {
659                    return getPersistence()
660                                       .fetchByThreadId_First(threadId, orderByComparator);
661            }
662    
663            /**
664            * Returns the last message boards thread flag in the ordered set where threadId = &#63;.
665            *
666            * @param threadId the thread ID
667            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
668            * @return the last matching message boards thread flag
669            * @throws NoSuchThreadFlagException if a matching message boards thread flag could not be found
670            */
671            public static MBThreadFlag findByThreadId_Last(long threadId,
672                    OrderByComparator<MBThreadFlag> orderByComparator)
673                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
674                    return getPersistence().findByThreadId_Last(threadId, orderByComparator);
675            }
676    
677            /**
678            * Returns the last message boards thread flag in the ordered set where threadId = &#63;.
679            *
680            * @param threadId the thread ID
681            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
682            * @return the last matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
683            */
684            public static MBThreadFlag fetchByThreadId_Last(long threadId,
685                    OrderByComparator<MBThreadFlag> orderByComparator) {
686                    return getPersistence().fetchByThreadId_Last(threadId, orderByComparator);
687            }
688    
689            /**
690            * Returns the message boards thread flags before and after the current message boards thread flag in the ordered set where threadId = &#63;.
691            *
692            * @param threadFlagId the primary key of the current message boards thread flag
693            * @param threadId the thread ID
694            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
695            * @return the previous, current, and next message boards thread flag
696            * @throws NoSuchThreadFlagException if a message boards thread flag with the primary key could not be found
697            */
698            public static MBThreadFlag[] findByThreadId_PrevAndNext(long threadFlagId,
699                    long threadId, OrderByComparator<MBThreadFlag> orderByComparator)
700                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
701                    return getPersistence()
702                                       .findByThreadId_PrevAndNext(threadFlagId, threadId,
703                            orderByComparator);
704            }
705    
706            /**
707            * Removes all the message boards thread flags where threadId = &#63; from the database.
708            *
709            * @param threadId the thread ID
710            */
711            public static void removeByThreadId(long threadId) {
712                    getPersistence().removeByThreadId(threadId);
713            }
714    
715            /**
716            * Returns the number of message boards thread flags where threadId = &#63;.
717            *
718            * @param threadId the thread ID
719            * @return the number of matching message boards thread flags
720            */
721            public static int countByThreadId(long threadId) {
722                    return getPersistence().countByThreadId(threadId);
723            }
724    
725            /**
726            * Returns the message boards thread flag where userId = &#63; and threadId = &#63; or throws a {@link NoSuchThreadFlagException} if it could not be found.
727            *
728            * @param userId the user ID
729            * @param threadId the thread ID
730            * @return the matching message boards thread flag
731            * @throws NoSuchThreadFlagException if a matching message boards thread flag could not be found
732            */
733            public static MBThreadFlag findByU_T(long userId, long threadId)
734                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
735                    return getPersistence().findByU_T(userId, threadId);
736            }
737    
738            /**
739            * 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.
740            *
741            * @param userId the user ID
742            * @param threadId the thread ID
743            * @return the matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
744            */
745            public static MBThreadFlag fetchByU_T(long userId, long threadId) {
746                    return getPersistence().fetchByU_T(userId, threadId);
747            }
748    
749            /**
750            * 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.
751            *
752            * @param userId the user ID
753            * @param threadId the thread ID
754            * @param retrieveFromCache whether to use the finder cache
755            * @return the matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
756            */
757            public static MBThreadFlag fetchByU_T(long userId, long threadId,
758                    boolean retrieveFromCache) {
759                    return getPersistence().fetchByU_T(userId, threadId, retrieveFromCache);
760            }
761    
762            /**
763            * Removes the message boards thread flag where userId = &#63; and threadId = &#63; from the database.
764            *
765            * @param userId the user ID
766            * @param threadId the thread ID
767            * @return the message boards thread flag that was removed
768            */
769            public static MBThreadFlag removeByU_T(long userId, long threadId)
770                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
771                    return getPersistence().removeByU_T(userId, threadId);
772            }
773    
774            /**
775            * Returns the number of message boards thread flags where userId = &#63; and threadId = &#63;.
776            *
777            * @param userId the user ID
778            * @param threadId the thread ID
779            * @return the number of matching message boards thread flags
780            */
781            public static int countByU_T(long userId, long threadId) {
782                    return getPersistence().countByU_T(userId, threadId);
783            }
784    
785            /**
786            * Caches the message boards thread flag in the entity cache if it is enabled.
787            *
788            * @param mbThreadFlag the message boards thread flag
789            */
790            public static void cacheResult(MBThreadFlag mbThreadFlag) {
791                    getPersistence().cacheResult(mbThreadFlag);
792            }
793    
794            /**
795            * Caches the message boards thread flags in the entity cache if it is enabled.
796            *
797            * @param mbThreadFlags the message boards thread flags
798            */
799            public static void cacheResult(List<MBThreadFlag> mbThreadFlags) {
800                    getPersistence().cacheResult(mbThreadFlags);
801            }
802    
803            /**
804            * Creates a new message boards thread flag with the primary key. Does not add the message boards thread flag to the database.
805            *
806            * @param threadFlagId the primary key for the new message boards thread flag
807            * @return the new message boards thread flag
808            */
809            public static MBThreadFlag create(long threadFlagId) {
810                    return getPersistence().create(threadFlagId);
811            }
812    
813            /**
814            * Removes the message boards thread flag with the primary key from the database. Also notifies the appropriate model listeners.
815            *
816            * @param threadFlagId the primary key of the message boards thread flag
817            * @return the message boards thread flag that was removed
818            * @throws NoSuchThreadFlagException if a message boards thread flag with the primary key could not be found
819            */
820            public static MBThreadFlag remove(long threadFlagId)
821                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
822                    return getPersistence().remove(threadFlagId);
823            }
824    
825            public static MBThreadFlag updateImpl(MBThreadFlag mbThreadFlag) {
826                    return getPersistence().updateImpl(mbThreadFlag);
827            }
828    
829            /**
830            * Returns the message boards thread flag with the primary key or throws a {@link NoSuchThreadFlagException} if it could not be found.
831            *
832            * @param threadFlagId the primary key of the message boards thread flag
833            * @return the message boards thread flag
834            * @throws NoSuchThreadFlagException if a message boards thread flag with the primary key could not be found
835            */
836            public static MBThreadFlag findByPrimaryKey(long threadFlagId)
837                    throws com.liferay.portlet.messageboards.NoSuchThreadFlagException {
838                    return getPersistence().findByPrimaryKey(threadFlagId);
839            }
840    
841            /**
842            * Returns the message boards thread flag with the primary key or returns <code>null</code> if it could not be found.
843            *
844            * @param threadFlagId the primary key of the message boards thread flag
845            * @return the message boards thread flag, or <code>null</code> if a message boards thread flag with the primary key could not be found
846            */
847            public static MBThreadFlag fetchByPrimaryKey(long threadFlagId) {
848                    return getPersistence().fetchByPrimaryKey(threadFlagId);
849            }
850    
851            public static java.util.Map<java.io.Serializable, MBThreadFlag> fetchByPrimaryKeys(
852                    java.util.Set<java.io.Serializable> primaryKeys) {
853                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
854            }
855    
856            /**
857            * Returns all the message boards thread flags.
858            *
859            * @return the message boards thread flags
860            */
861            public static List<MBThreadFlag> findAll() {
862                    return getPersistence().findAll();
863            }
864    
865            /**
866            * Returns a range of all the message boards thread flags.
867            *
868            * <p>
869            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link MBThreadFlagModelImpl}. 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.
870            * </p>
871            *
872            * @param start the lower bound of the range of message boards thread flags
873            * @param end the upper bound of the range of message boards thread flags (not inclusive)
874            * @return the range of message boards thread flags
875            */
876            public static List<MBThreadFlag> findAll(int start, int end) {
877                    return getPersistence().findAll(start, end);
878            }
879    
880            /**
881            * Returns an ordered range of all the message boards thread flags.
882            *
883            * <p>
884            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link MBThreadFlagModelImpl}. 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.
885            * </p>
886            *
887            * @param start the lower bound of the range of message boards thread flags
888            * @param end the upper bound of the range of message boards thread flags (not inclusive)
889            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
890            * @return the ordered range of message boards thread flags
891            */
892            public static List<MBThreadFlag> findAll(int start, int end,
893                    OrderByComparator<MBThreadFlag> orderByComparator) {
894                    return getPersistence().findAll(start, end, orderByComparator);
895            }
896    
897            /**
898            * Removes all the message boards thread flags from the database.
899            */
900            public static void removeAll() {
901                    getPersistence().removeAll();
902            }
903    
904            /**
905            * Returns the number of message boards thread flags.
906            *
907            * @return the number of message boards thread flags
908            */
909            public static int countAll() {
910                    return getPersistence().countAll();
911            }
912    
913            public static MBThreadFlagPersistence getPersistence() {
914                    if (_persistence == null) {
915                            _persistence = (MBThreadFlagPersistence)PortalBeanLocatorUtil.locate(MBThreadFlagPersistence.class.getName());
916    
917                            ReferenceRegistry.registerReference(MBThreadFlagUtil.class,
918                                    "_persistence");
919                    }
920    
921                    return _persistence;
922            }
923    
924            /**
925             * @deprecated As of 6.2.0
926             */
927            @Deprecated
928            public void setPersistence(MBThreadFlagPersistence persistence) {
929            }
930    
931            private static MBThreadFlagPersistence _persistence;
932    }