001    /**
002     * Copyright (c) 2000-2010 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 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.service.ServiceContext;
022    
023    import com.liferay.portlet.announcements.model.AnnouncementsFlag;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the announcements flag service.
029     *
030     * <p>
031     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class.
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see AnnouncementsFlagPersistence
036     * @see AnnouncementsFlagPersistenceImpl
037     * @generated
038     */
039    public class AnnouncementsFlagUtil {
040            /**
041             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
042             */
043            public static void clearCache() {
044                    getPersistence().clearCache();
045            }
046    
047            /**
048             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
049             */
050            public static void clearCache(AnnouncementsFlag announcementsFlag) {
051                    getPersistence().clearCache(announcementsFlag);
052            }
053    
054            /**
055             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
056             */
057            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
058                    throws SystemException {
059                    return getPersistence().countWithDynamicQuery(dynamicQuery);
060            }
061    
062            /**
063             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
064             */
065            public static List<AnnouncementsFlag> findWithDynamicQuery(
066                    DynamicQuery dynamicQuery) throws SystemException {
067                    return getPersistence().findWithDynamicQuery(dynamicQuery);
068            }
069    
070            /**
071             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
072             */
073            public static List<AnnouncementsFlag> findWithDynamicQuery(
074                    DynamicQuery dynamicQuery, int start, int end)
075                    throws SystemException {
076                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
077            }
078    
079            /**
080             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
081             */
082            public static List<AnnouncementsFlag> findWithDynamicQuery(
083                    DynamicQuery dynamicQuery, int start, int end,
084                    OrderByComparator orderByComparator) throws SystemException {
085                    return getPersistence()
086                                       .findWithDynamicQuery(dynamicQuery, start, end,
087                            orderByComparator);
088            }
089    
090            /**
091             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
092             */
093            public static AnnouncementsFlag remove(AnnouncementsFlag announcementsFlag)
094                    throws SystemException {
095                    return getPersistence().remove(announcementsFlag);
096            }
097    
098            /**
099             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
100             */
101            public static AnnouncementsFlag update(
102                    AnnouncementsFlag announcementsFlag, boolean merge)
103                    throws SystemException {
104                    return getPersistence().update(announcementsFlag, merge);
105            }
106    
107            /**
108             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
109             */
110            public static AnnouncementsFlag update(
111                    AnnouncementsFlag announcementsFlag, boolean merge,
112                    ServiceContext serviceContext) throws SystemException {
113                    return getPersistence().update(announcementsFlag, merge, serviceContext);
114            }
115    
116            /**
117            * Caches the announcements flag in the entity cache if it is enabled.
118            *
119            * @param announcementsFlag the announcements flag to cache
120            */
121            public static void cacheResult(
122                    com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag) {
123                    getPersistence().cacheResult(announcementsFlag);
124            }
125    
126            /**
127            * Caches the announcements flags in the entity cache if it is enabled.
128            *
129            * @param announcementsFlags the announcements flags to cache
130            */
131            public static void cacheResult(
132                    java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> announcementsFlags) {
133                    getPersistence().cacheResult(announcementsFlags);
134            }
135    
136            /**
137            * Creates a new announcements flag with the primary key.
138            *
139            * @param flagId the primary key for the new announcements flag
140            * @return the new announcements flag
141            */
142            public static com.liferay.portlet.announcements.model.AnnouncementsFlag create(
143                    long flagId) {
144                    return getPersistence().create(flagId);
145            }
146    
147            /**
148            * Removes the announcements flag with the primary key from the database. Also notifies the appropriate model listeners.
149            *
150            * @param flagId the primary key of the announcements flag to remove
151            * @return the announcements flag that was removed
152            * @throws com.liferay.portlet.announcements.NoSuchFlagException if a announcements flag with the primary key could not be found
153            * @throws SystemException if a system exception occurred
154            */
155            public static com.liferay.portlet.announcements.model.AnnouncementsFlag remove(
156                    long flagId)
157                    throws com.liferay.portal.kernel.exception.SystemException,
158                            com.liferay.portlet.announcements.NoSuchFlagException {
159                    return getPersistence().remove(flagId);
160            }
161    
162            public static com.liferay.portlet.announcements.model.AnnouncementsFlag updateImpl(
163                    com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag,
164                    boolean merge)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    return getPersistence().updateImpl(announcementsFlag, merge);
167            }
168    
169            /**
170            * Finds the announcements flag with the primary key or throws a {@link com.liferay.portlet.announcements.NoSuchFlagException} if it could not be found.
171            *
172            * @param flagId the primary key of the announcements flag to find
173            * @return the announcements flag
174            * @throws com.liferay.portlet.announcements.NoSuchFlagException if a announcements flag with the primary key could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public static com.liferay.portlet.announcements.model.AnnouncementsFlag findByPrimaryKey(
178                    long flagId)
179                    throws com.liferay.portal.kernel.exception.SystemException,
180                            com.liferay.portlet.announcements.NoSuchFlagException {
181                    return getPersistence().findByPrimaryKey(flagId);
182            }
183    
184            /**
185            * Finds the announcements flag with the primary key or returns <code>null</code> if it could not be found.
186            *
187            * @param flagId the primary key of the announcements flag to find
188            * @return the announcements flag, or <code>null</code> if a announcements flag with the primary key could not be found
189            * @throws SystemException if a system exception occurred
190            */
191            public static com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByPrimaryKey(
192                    long flagId) throws com.liferay.portal.kernel.exception.SystemException {
193                    return getPersistence().fetchByPrimaryKey(flagId);
194            }
195    
196            /**
197            * Finds all the announcements flags where entryId = &#63;.
198            *
199            * @param entryId the entry id to search with
200            * @return the matching announcements flags
201            * @throws SystemException if a system exception occurred
202            */
203            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId(
204                    long entryId)
205                    throws com.liferay.portal.kernel.exception.SystemException {
206                    return getPersistence().findByEntryId(entryId);
207            }
208    
209            /**
210            * Finds a range of all the announcements flags where entryId = &#63;.
211            *
212            * <p>
213            * 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.
214            * </p>
215            *
216            * @param entryId the entry id to search with
217            * @param start the lower bound of the range of announcements flags to return
218            * @param end the upper bound of the range of announcements flags to return (not inclusive)
219            * @return the range of matching announcements flags
220            * @throws SystemException if a system exception occurred
221            */
222            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId(
223                    long entryId, int start, int end)
224                    throws com.liferay.portal.kernel.exception.SystemException {
225                    return getPersistence().findByEntryId(entryId, start, end);
226            }
227    
228            /**
229            * Finds an ordered range of all the announcements flags where entryId = &#63;.
230            *
231            * <p>
232            * 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.
233            * </p>
234            *
235            * @param entryId the entry id to search with
236            * @param start the lower bound of the range of announcements flags to return
237            * @param end the upper bound of the range of announcements flags to return (not inclusive)
238            * @param orderByComparator the comparator to order the results by
239            * @return the ordered range of matching announcements flags
240            * @throws SystemException if a system exception occurred
241            */
242            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId(
243                    long entryId, int start, int end,
244                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
245                    throws com.liferay.portal.kernel.exception.SystemException {
246                    return getPersistence()
247                                       .findByEntryId(entryId, start, end, orderByComparator);
248            }
249    
250            /**
251            * Finds the first announcements flag in the ordered set where entryId = &#63;.
252            *
253            * <p>
254            * 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.
255            * </p>
256            *
257            * @param entryId the entry id to search with
258            * @param orderByComparator the comparator to order the set by
259            * @return the first matching announcements flag
260            * @throws com.liferay.portlet.announcements.NoSuchFlagException if a matching announcements flag could not be found
261            * @throws SystemException if a system exception occurred
262            */
263            public static com.liferay.portlet.announcements.model.AnnouncementsFlag findByEntryId_First(
264                    long entryId,
265                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
266                    throws com.liferay.portal.kernel.exception.SystemException,
267                            com.liferay.portlet.announcements.NoSuchFlagException {
268                    return getPersistence().findByEntryId_First(entryId, orderByComparator);
269            }
270    
271            /**
272            * Finds the last announcements flag in the ordered set where entryId = &#63;.
273            *
274            * <p>
275            * 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.
276            * </p>
277            *
278            * @param entryId the entry id to search with
279            * @param orderByComparator the comparator to order the set by
280            * @return the last matching announcements flag
281            * @throws com.liferay.portlet.announcements.NoSuchFlagException if a matching announcements flag could not be found
282            * @throws SystemException if a system exception occurred
283            */
284            public static com.liferay.portlet.announcements.model.AnnouncementsFlag findByEntryId_Last(
285                    long entryId,
286                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
287                    throws com.liferay.portal.kernel.exception.SystemException,
288                            com.liferay.portlet.announcements.NoSuchFlagException {
289                    return getPersistence().findByEntryId_Last(entryId, orderByComparator);
290            }
291    
292            /**
293            * Finds the announcements flags before and after the current announcements flag in the ordered set where entryId = &#63;.
294            *
295            * <p>
296            * 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.
297            * </p>
298            *
299            * @param flagId the primary key of the current announcements flag
300            * @param entryId the entry id to search with
301            * @param orderByComparator the comparator to order the set by
302            * @return the previous, current, and next announcements flag
303            * @throws com.liferay.portlet.announcements.NoSuchFlagException if a announcements flag with the primary key could not be found
304            * @throws SystemException if a system exception occurred
305            */
306            public static com.liferay.portlet.announcements.model.AnnouncementsFlag[] findByEntryId_PrevAndNext(
307                    long flagId, long entryId,
308                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
309                    throws com.liferay.portal.kernel.exception.SystemException,
310                            com.liferay.portlet.announcements.NoSuchFlagException {
311                    return getPersistence()
312                                       .findByEntryId_PrevAndNext(flagId, entryId, orderByComparator);
313            }
314    
315            /**
316            * Finds the announcements flag where userId = &#63; and entryId = &#63; and value = &#63; or throws a {@link com.liferay.portlet.announcements.NoSuchFlagException} if it could not be found.
317            *
318            * @param userId the user id to search with
319            * @param entryId the entry id to search with
320            * @param value the value to search with
321            * @return the matching announcements flag
322            * @throws com.liferay.portlet.announcements.NoSuchFlagException if a matching announcements flag could not be found
323            * @throws SystemException if a system exception occurred
324            */
325            public static com.liferay.portlet.announcements.model.AnnouncementsFlag findByU_E_V(
326                    long userId, long entryId, int value)
327                    throws com.liferay.portal.kernel.exception.SystemException,
328                            com.liferay.portlet.announcements.NoSuchFlagException {
329                    return getPersistence().findByU_E_V(userId, entryId, value);
330            }
331    
332            /**
333            * Finds 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.
334            *
335            * @param userId the user id to search with
336            * @param entryId the entry id to search with
337            * @param value the value to search with
338            * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
339            * @throws SystemException if a system exception occurred
340            */
341            public static com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByU_E_V(
342                    long userId, long entryId, int value)
343                    throws com.liferay.portal.kernel.exception.SystemException {
344                    return getPersistence().fetchByU_E_V(userId, entryId, value);
345            }
346    
347            /**
348            * Finds 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.
349            *
350            * @param userId the user id to search with
351            * @param entryId the entry id to search with
352            * @param value the value to search with
353            * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
354            * @throws SystemException if a system exception occurred
355            */
356            public static com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByU_E_V(
357                    long userId, long entryId, int value, boolean retrieveFromCache)
358                    throws com.liferay.portal.kernel.exception.SystemException {
359                    return getPersistence()
360                                       .fetchByU_E_V(userId, entryId, value, retrieveFromCache);
361            }
362    
363            /**
364            * Finds all the announcements flags.
365            *
366            * @return the announcements flags
367            * @throws SystemException if a system exception occurred
368            */
369            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll()
370                    throws com.liferay.portal.kernel.exception.SystemException {
371                    return getPersistence().findAll();
372            }
373    
374            /**
375            * Finds a range of all the announcements flags.
376            *
377            * <p>
378            * 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.
379            * </p>
380            *
381            * @param start the lower bound of the range of announcements flags to return
382            * @param end the upper bound of the range of announcements flags to return (not inclusive)
383            * @return the range of announcements flags
384            * @throws SystemException if a system exception occurred
385            */
386            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll(
387                    int start, int end)
388                    throws com.liferay.portal.kernel.exception.SystemException {
389                    return getPersistence().findAll(start, end);
390            }
391    
392            /**
393            * Finds an ordered range of all the announcements flags.
394            *
395            * <p>
396            * 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.
397            * </p>
398            *
399            * @param start the lower bound of the range of announcements flags to return
400            * @param end the upper bound of the range of announcements flags to return (not inclusive)
401            * @param orderByComparator the comparator to order the results by
402            * @return the ordered range of announcements flags
403            * @throws SystemException if a system exception occurred
404            */
405            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll(
406                    int start, int end,
407                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
408                    throws com.liferay.portal.kernel.exception.SystemException {
409                    return getPersistence().findAll(start, end, orderByComparator);
410            }
411    
412            /**
413            * Removes all the announcements flags where entryId = &#63; from the database.
414            *
415            * @param entryId the entry id to search with
416            * @throws SystemException if a system exception occurred
417            */
418            public static void removeByEntryId(long entryId)
419                    throws com.liferay.portal.kernel.exception.SystemException {
420                    getPersistence().removeByEntryId(entryId);
421            }
422    
423            /**
424            * Removes the announcements flag where userId = &#63; and entryId = &#63; and value = &#63; from the database.
425            *
426            * @param userId the user id to search with
427            * @param entryId the entry id to search with
428            * @param value the value to search with
429            * @throws SystemException if a system exception occurred
430            */
431            public static void removeByU_E_V(long userId, long entryId, int value)
432                    throws com.liferay.portal.kernel.exception.SystemException,
433                            com.liferay.portlet.announcements.NoSuchFlagException {
434                    getPersistence().removeByU_E_V(userId, entryId, value);
435            }
436    
437            /**
438            * Removes all the announcements flags from the database.
439            *
440            * @throws SystemException if a system exception occurred
441            */
442            public static void removeAll()
443                    throws com.liferay.portal.kernel.exception.SystemException {
444                    getPersistence().removeAll();
445            }
446    
447            /**
448            * Counts all the announcements flags where entryId = &#63;.
449            *
450            * @param entryId the entry id to search with
451            * @return the number of matching announcements flags
452            * @throws SystemException if a system exception occurred
453            */
454            public static int countByEntryId(long entryId)
455                    throws com.liferay.portal.kernel.exception.SystemException {
456                    return getPersistence().countByEntryId(entryId);
457            }
458    
459            /**
460            * Counts all the announcements flags where userId = &#63; and entryId = &#63; and value = &#63;.
461            *
462            * @param userId the user id to search with
463            * @param entryId the entry id to search with
464            * @param value the value to search with
465            * @return the number of matching announcements flags
466            * @throws SystemException if a system exception occurred
467            */
468            public static int countByU_E_V(long userId, long entryId, int value)
469                    throws com.liferay.portal.kernel.exception.SystemException {
470                    return getPersistence().countByU_E_V(userId, entryId, value);
471            }
472    
473            /**
474            * Counts all the announcements flags.
475            *
476            * @return the number of announcements flags
477            * @throws SystemException if a system exception occurred
478            */
479            public static int countAll()
480                    throws com.liferay.portal.kernel.exception.SystemException {
481                    return getPersistence().countAll();
482            }
483    
484            public static AnnouncementsFlagPersistence getPersistence() {
485                    if (_persistence == null) {
486                            _persistence = (AnnouncementsFlagPersistence)PortalBeanLocatorUtil.locate(AnnouncementsFlagPersistence.class.getName());
487                    }
488    
489                    return _persistence;
490            }
491    
492            public void setPersistence(AnnouncementsFlagPersistence persistence) {
493                    _persistence = persistence;
494            }
495    
496            private static AnnouncementsFlagPersistence _persistence;
497    }