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