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.announcements.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.announcements.model.AnnouncementsFlag;
026    
027    import java.util.List;
028    
029    /**
030     * The persistence utility for the announcements flag service. This utility wraps {@link com.liferay.portlet.announcements.service.persistence.impl.AnnouncementsFlagPersistenceImpl} 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 AnnouncementsFlagPersistence
038     * @see com.liferay.portlet.announcements.service.persistence.impl.AnnouncementsFlagPersistenceImpl
039     * @generated
040     */
041    @ProviderType
042    public class AnnouncementsFlagUtil {
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(AnnouncementsFlag announcementsFlag) {
060                    getPersistence().clearCache(announcementsFlag);
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<AnnouncementsFlag> 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<AnnouncementsFlag> 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<AnnouncementsFlag> findWithDynamicQuery(
090                    DynamicQuery dynamicQuery, int start, int end,
091                    OrderByComparator<AnnouncementsFlag> 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 AnnouncementsFlag update(AnnouncementsFlag announcementsFlag) {
101                    return getPersistence().update(announcementsFlag);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
106             */
107            public static AnnouncementsFlag update(
108                    AnnouncementsFlag announcementsFlag, ServiceContext serviceContext) {
109                    return getPersistence().update(announcementsFlag, serviceContext);
110            }
111    
112            /**
113            * Returns all the announcements flags where entryId = &#63;.
114            *
115            * @param entryId the entry ID
116            * @return the matching announcements flags
117            */
118            public static List<AnnouncementsFlag> findByEntryId(long entryId) {
119                    return getPersistence().findByEntryId(entryId);
120            }
121    
122            /**
123            * Returns a range of all the announcements flags where entryId = &#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 AnnouncementsFlagModelImpl}. 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 entryId the entry ID
130            * @param start the lower bound of the range of announcements flags
131            * @param end the upper bound of the range of announcements flags (not inclusive)
132            * @return the range of matching announcements flags
133            */
134            public static List<AnnouncementsFlag> findByEntryId(long entryId,
135                    int start, int end) {
136                    return getPersistence().findByEntryId(entryId, start, end);
137            }
138    
139            /**
140            * Returns an ordered range of all the announcements flags where entryId = &#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 AnnouncementsFlagModelImpl}. 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 entryId the entry ID
147            * @param start the lower bound of the range of announcements flags
148            * @param end the upper bound of the range of announcements flags (not inclusive)
149            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
150            * @return the ordered range of matching announcements flags
151            */
152            public static List<AnnouncementsFlag> findByEntryId(long entryId,
153                    int start, int end,
154                    OrderByComparator<AnnouncementsFlag> orderByComparator) {
155                    return getPersistence()
156                                       .findByEntryId(entryId, start, end, orderByComparator);
157            }
158    
159            /**
160            * Returns the first announcements flag in the ordered set where entryId = &#63;.
161            *
162            * @param entryId the entry ID
163            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
164            * @return the first matching announcements flag
165            * @throws NoSuchFlagException if a matching announcements flag could not be found
166            */
167            public static AnnouncementsFlag findByEntryId_First(long entryId,
168                    OrderByComparator<AnnouncementsFlag> orderByComparator)
169                    throws com.liferay.portlet.announcements.NoSuchFlagException {
170                    return getPersistence().findByEntryId_First(entryId, orderByComparator);
171            }
172    
173            /**
174            * Returns the first announcements flag in the ordered set where entryId = &#63;.
175            *
176            * @param entryId the entry ID
177            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
178            * @return the first matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
179            */
180            public static AnnouncementsFlag fetchByEntryId_First(long entryId,
181                    OrderByComparator<AnnouncementsFlag> orderByComparator) {
182                    return getPersistence().fetchByEntryId_First(entryId, orderByComparator);
183            }
184    
185            /**
186            * Returns the last announcements flag in the ordered set where entryId = &#63;.
187            *
188            * @param entryId the entry ID
189            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
190            * @return the last matching announcements flag
191            * @throws NoSuchFlagException if a matching announcements flag could not be found
192            */
193            public static AnnouncementsFlag findByEntryId_Last(long entryId,
194                    OrderByComparator<AnnouncementsFlag> orderByComparator)
195                    throws com.liferay.portlet.announcements.NoSuchFlagException {
196                    return getPersistence().findByEntryId_Last(entryId, orderByComparator);
197            }
198    
199            /**
200            * Returns the last announcements flag in the ordered set where entryId = &#63;.
201            *
202            * @param entryId the entry ID
203            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
204            * @return the last matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
205            */
206            public static AnnouncementsFlag fetchByEntryId_Last(long entryId,
207                    OrderByComparator<AnnouncementsFlag> orderByComparator) {
208                    return getPersistence().fetchByEntryId_Last(entryId, orderByComparator);
209            }
210    
211            /**
212            * Returns the announcements flags before and after the current announcements flag in the ordered set where entryId = &#63;.
213            *
214            * @param flagId the primary key of the current announcements flag
215            * @param entryId the entry ID
216            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
217            * @return the previous, current, and next announcements flag
218            * @throws NoSuchFlagException if a announcements flag with the primary key could not be found
219            */
220            public static AnnouncementsFlag[] findByEntryId_PrevAndNext(long flagId,
221                    long entryId, OrderByComparator<AnnouncementsFlag> orderByComparator)
222                    throws com.liferay.portlet.announcements.NoSuchFlagException {
223                    return getPersistence()
224                                       .findByEntryId_PrevAndNext(flagId, entryId, orderByComparator);
225            }
226    
227            /**
228            * Removes all the announcements flags where entryId = &#63; from the database.
229            *
230            * @param entryId the entry ID
231            */
232            public static void removeByEntryId(long entryId) {
233                    getPersistence().removeByEntryId(entryId);
234            }
235    
236            /**
237            * Returns the number of announcements flags where entryId = &#63;.
238            *
239            * @param entryId the entry ID
240            * @return the number of matching announcements flags
241            */
242            public static int countByEntryId(long entryId) {
243                    return getPersistence().countByEntryId(entryId);
244            }
245    
246            /**
247            * Returns the announcements flag where userId = &#63; and entryId = &#63; and value = &#63; or throws a {@link NoSuchFlagException} if it could not be found.
248            *
249            * @param userId the user ID
250            * @param entryId the entry ID
251            * @param value the value
252            * @return the matching announcements flag
253            * @throws NoSuchFlagException if a matching announcements flag could not be found
254            */
255            public static AnnouncementsFlag findByU_E_V(long userId, long entryId,
256                    int value) throws com.liferay.portlet.announcements.NoSuchFlagException {
257                    return getPersistence().findByU_E_V(userId, entryId, value);
258            }
259    
260            /**
261            * Returns the announcements flag where userId = &#63; and entryId = &#63; and value = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
262            *
263            * @param userId the user ID
264            * @param entryId the entry ID
265            * @param value the value
266            * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
267            */
268            public static AnnouncementsFlag fetchByU_E_V(long userId, long entryId,
269                    int value) {
270                    return getPersistence().fetchByU_E_V(userId, entryId, value);
271            }
272    
273            /**
274            * Returns the announcements flag where userId = &#63; and entryId = &#63; and value = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
275            *
276            * @param userId the user ID
277            * @param entryId the entry ID
278            * @param value the value
279            * @param retrieveFromCache whether to use the finder cache
280            * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
281            */
282            public static AnnouncementsFlag fetchByU_E_V(long userId, long entryId,
283                    int value, boolean retrieveFromCache) {
284                    return getPersistence()
285                                       .fetchByU_E_V(userId, entryId, value, retrieveFromCache);
286            }
287    
288            /**
289            * Removes the announcements flag where userId = &#63; and entryId = &#63; and value = &#63; from the database.
290            *
291            * @param userId the user ID
292            * @param entryId the entry ID
293            * @param value the value
294            * @return the announcements flag that was removed
295            */
296            public static AnnouncementsFlag removeByU_E_V(long userId, long entryId,
297                    int value) throws com.liferay.portlet.announcements.NoSuchFlagException {
298                    return getPersistence().removeByU_E_V(userId, entryId, value);
299            }
300    
301            /**
302            * Returns the number of announcements flags where userId = &#63; and entryId = &#63; and value = &#63;.
303            *
304            * @param userId the user ID
305            * @param entryId the entry ID
306            * @param value the value
307            * @return the number of matching announcements flags
308            */
309            public static int countByU_E_V(long userId, long entryId, int value) {
310                    return getPersistence().countByU_E_V(userId, entryId, value);
311            }
312    
313            /**
314            * Caches the announcements flag in the entity cache if it is enabled.
315            *
316            * @param announcementsFlag the announcements flag
317            */
318            public static void cacheResult(AnnouncementsFlag announcementsFlag) {
319                    getPersistence().cacheResult(announcementsFlag);
320            }
321    
322            /**
323            * Caches the announcements flags in the entity cache if it is enabled.
324            *
325            * @param announcementsFlags the announcements flags
326            */
327            public static void cacheResult(List<AnnouncementsFlag> announcementsFlags) {
328                    getPersistence().cacheResult(announcementsFlags);
329            }
330    
331            /**
332            * Creates a new announcements flag with the primary key. Does not add the announcements flag to the database.
333            *
334            * @param flagId the primary key for the new announcements flag
335            * @return the new announcements flag
336            */
337            public static AnnouncementsFlag create(long flagId) {
338                    return getPersistence().create(flagId);
339            }
340    
341            /**
342            * Removes the announcements flag with the primary key from the database. Also notifies the appropriate model listeners.
343            *
344            * @param flagId the primary key of the announcements flag
345            * @return the announcements flag that was removed
346            * @throws NoSuchFlagException if a announcements flag with the primary key could not be found
347            */
348            public static AnnouncementsFlag remove(long flagId)
349                    throws com.liferay.portlet.announcements.NoSuchFlagException {
350                    return getPersistence().remove(flagId);
351            }
352    
353            public static AnnouncementsFlag updateImpl(
354                    AnnouncementsFlag announcementsFlag) {
355                    return getPersistence().updateImpl(announcementsFlag);
356            }
357    
358            /**
359            * Returns the announcements flag with the primary key or throws a {@link NoSuchFlagException} if it could not be found.
360            *
361            * @param flagId the primary key of the announcements flag
362            * @return the announcements flag
363            * @throws NoSuchFlagException if a announcements flag with the primary key could not be found
364            */
365            public static AnnouncementsFlag findByPrimaryKey(long flagId)
366                    throws com.liferay.portlet.announcements.NoSuchFlagException {
367                    return getPersistence().findByPrimaryKey(flagId);
368            }
369    
370            /**
371            * Returns the announcements flag with the primary key or returns <code>null</code> if it could not be found.
372            *
373            * @param flagId the primary key of the announcements flag
374            * @return the announcements flag, or <code>null</code> if a announcements flag with the primary key could not be found
375            */
376            public static AnnouncementsFlag fetchByPrimaryKey(long flagId) {
377                    return getPersistence().fetchByPrimaryKey(flagId);
378            }
379    
380            public static java.util.Map<java.io.Serializable, AnnouncementsFlag> fetchByPrimaryKeys(
381                    java.util.Set<java.io.Serializable> primaryKeys) {
382                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
383            }
384    
385            /**
386            * Returns all the announcements flags.
387            *
388            * @return the announcements flags
389            */
390            public static List<AnnouncementsFlag> findAll() {
391                    return getPersistence().findAll();
392            }
393    
394            /**
395            * Returns a range of all the announcements flags.
396            *
397            * <p>
398            * 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 AnnouncementsFlagModelImpl}. 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.
399            * </p>
400            *
401            * @param start the lower bound of the range of announcements flags
402            * @param end the upper bound of the range of announcements flags (not inclusive)
403            * @return the range of announcements flags
404            */
405            public static List<AnnouncementsFlag> findAll(int start, int end) {
406                    return getPersistence().findAll(start, end);
407            }
408    
409            /**
410            * Returns an ordered range of all the announcements flags.
411            *
412            * <p>
413            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link 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 AnnouncementsFlagModelImpl}. 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.
414            * </p>
415            *
416            * @param start the lower bound of the range of announcements flags
417            * @param end the upper bound of the range of announcements flags (not inclusive)
418            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
419            * @return the ordered range of announcements flags
420            */
421            public static List<AnnouncementsFlag> findAll(int start, int end,
422                    OrderByComparator<AnnouncementsFlag> orderByComparator) {
423                    return getPersistence().findAll(start, end, orderByComparator);
424            }
425    
426            /**
427            * Removes all the announcements flags from the database.
428            */
429            public static void removeAll() {
430                    getPersistence().removeAll();
431            }
432    
433            /**
434            * Returns the number of announcements flags.
435            *
436            * @return the number of announcements flags
437            */
438            public static int countAll() {
439                    return getPersistence().countAll();
440            }
441    
442            public static AnnouncementsFlagPersistence getPersistence() {
443                    if (_persistence == null) {
444                            _persistence = (AnnouncementsFlagPersistence)PortalBeanLocatorUtil.locate(AnnouncementsFlagPersistence.class.getName());
445    
446                            ReferenceRegistry.registerReference(AnnouncementsFlagUtil.class,
447                                    "_persistence");
448                    }
449    
450                    return _persistence;
451            }
452    
453            /**
454             * @deprecated As of 6.2.0
455             */
456            @Deprecated
457            public void setPersistence(AnnouncementsFlagPersistence persistence) {
458            }
459    
460            private static AnnouncementsFlagPersistence _persistence;
461    }