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.AnnouncementsDelivery;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the announcements delivery 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 AnnouncementsDeliveryPersistence
036     * @see AnnouncementsDeliveryPersistenceImpl
037     * @generated
038     */
039    public class AnnouncementsDeliveryUtil {
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(AnnouncementsDelivery announcementsDelivery) {
051                    getPersistence().clearCache(announcementsDelivery);
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<AnnouncementsDelivery> 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<AnnouncementsDelivery> 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<AnnouncementsDelivery> 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 AnnouncementsDelivery remove(
094                    AnnouncementsDelivery announcementsDelivery) throws SystemException {
095                    return getPersistence().remove(announcementsDelivery);
096            }
097    
098            /**
099             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
100             */
101            public static AnnouncementsDelivery update(
102                    AnnouncementsDelivery announcementsDelivery, boolean merge)
103                    throws SystemException {
104                    return getPersistence().update(announcementsDelivery, merge);
105            }
106    
107            /**
108             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
109             */
110            public static AnnouncementsDelivery update(
111                    AnnouncementsDelivery announcementsDelivery, boolean merge,
112                    ServiceContext serviceContext) throws SystemException {
113                    return getPersistence()
114                                       .update(announcementsDelivery, merge, serviceContext);
115            }
116    
117            /**
118            * Caches the announcements delivery in the entity cache if it is enabled.
119            *
120            * @param announcementsDelivery the announcements delivery to cache
121            */
122            public static void cacheResult(
123                    com.liferay.portlet.announcements.model.AnnouncementsDelivery announcementsDelivery) {
124                    getPersistence().cacheResult(announcementsDelivery);
125            }
126    
127            /**
128            * Caches the announcements deliveries in the entity cache if it is enabled.
129            *
130            * @param announcementsDeliveries the announcements deliveries to cache
131            */
132            public static void cacheResult(
133                    java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDeliveries) {
134                    getPersistence().cacheResult(announcementsDeliveries);
135            }
136    
137            /**
138            * Creates a new announcements delivery with the primary key.
139            *
140            * @param deliveryId the primary key for the new announcements delivery
141            * @return the new announcements delivery
142            */
143            public static com.liferay.portlet.announcements.model.AnnouncementsDelivery create(
144                    long deliveryId) {
145                    return getPersistence().create(deliveryId);
146            }
147    
148            /**
149            * Removes the announcements delivery with the primary key from the database. Also notifies the appropriate model listeners.
150            *
151            * @param deliveryId the primary key of the announcements delivery to remove
152            * @return the announcements delivery that was removed
153            * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a announcements delivery with the primary key could not be found
154            * @throws SystemException if a system exception occurred
155            */
156            public static com.liferay.portlet.announcements.model.AnnouncementsDelivery remove(
157                    long deliveryId)
158                    throws com.liferay.portal.kernel.exception.SystemException,
159                            com.liferay.portlet.announcements.NoSuchDeliveryException {
160                    return getPersistence().remove(deliveryId);
161            }
162    
163            public static com.liferay.portlet.announcements.model.AnnouncementsDelivery updateImpl(
164                    com.liferay.portlet.announcements.model.AnnouncementsDelivery announcementsDelivery,
165                    boolean merge)
166                    throws com.liferay.portal.kernel.exception.SystemException {
167                    return getPersistence().updateImpl(announcementsDelivery, merge);
168            }
169    
170            /**
171            * Finds the announcements delivery with the primary key or throws a {@link com.liferay.portlet.announcements.NoSuchDeliveryException} if it could not be found.
172            *
173            * @param deliveryId the primary key of the announcements delivery to find
174            * @return the announcements delivery
175            * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a announcements delivery with the primary key could not be found
176            * @throws SystemException if a system exception occurred
177            */
178            public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByPrimaryKey(
179                    long deliveryId)
180                    throws com.liferay.portal.kernel.exception.SystemException,
181                            com.liferay.portlet.announcements.NoSuchDeliveryException {
182                    return getPersistence().findByPrimaryKey(deliveryId);
183            }
184    
185            /**
186            * Finds the announcements delivery with the primary key or returns <code>null</code> if it could not be found.
187            *
188            * @param deliveryId the primary key of the announcements delivery to find
189            * @return the announcements delivery, or <code>null</code> if a announcements delivery with the primary key could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByPrimaryKey(
193                    long deliveryId)
194                    throws com.liferay.portal.kernel.exception.SystemException {
195                    return getPersistence().fetchByPrimaryKey(deliveryId);
196            }
197    
198            /**
199            * Finds all the announcements deliveries where userId = &#63;.
200            *
201            * @param userId the user id to search with
202            * @return the matching announcements deliveries
203            * @throws SystemException if a system exception occurred
204            */
205            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findByUserId(
206                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
207                    return getPersistence().findByUserId(userId);
208            }
209    
210            /**
211            * Finds a range of all the announcements deliveries where userId = &#63;.
212            *
213            * <p>
214            * 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.
215            * </p>
216            *
217            * @param userId the user id to search with
218            * @param start the lower bound of the range of announcements deliveries to return
219            * @param end the upper bound of the range of announcements deliveries to return (not inclusive)
220            * @return the range of matching announcements deliveries
221            * @throws SystemException if a system exception occurred
222            */
223            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findByUserId(
224                    long userId, int start, int end)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getPersistence().findByUserId(userId, start, end);
227            }
228    
229            /**
230            * Finds an ordered range of all the announcements deliveries where userId = &#63;.
231            *
232            * <p>
233            * 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.
234            * </p>
235            *
236            * @param userId the user id to search with
237            * @param start the lower bound of the range of announcements deliveries to return
238            * @param end the upper bound of the range of announcements deliveries to return (not inclusive)
239            * @param orderByComparator the comparator to order the results by
240            * @return the ordered range of matching announcements deliveries
241            * @throws SystemException if a system exception occurred
242            */
243            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findByUserId(
244                    long userId, int start, int end,
245                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
246                    throws com.liferay.portal.kernel.exception.SystemException {
247                    return getPersistence()
248                                       .findByUserId(userId, start, end, orderByComparator);
249            }
250    
251            /**
252            * Finds the first announcements delivery in the ordered set where userId = &#63;.
253            *
254            * <p>
255            * 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.
256            * </p>
257            *
258            * @param userId the user id to search with
259            * @param orderByComparator the comparator to order the set by
260            * @return the first matching announcements delivery
261            * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a matching announcements delivery could not be found
262            * @throws SystemException if a system exception occurred
263            */
264            public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByUserId_First(
265                    long userId,
266                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
267                    throws com.liferay.portal.kernel.exception.SystemException,
268                            com.liferay.portlet.announcements.NoSuchDeliveryException {
269                    return getPersistence().findByUserId_First(userId, orderByComparator);
270            }
271    
272            /**
273            * Finds the last announcements delivery in the ordered set where userId = &#63;.
274            *
275            * <p>
276            * 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.
277            * </p>
278            *
279            * @param userId the user id to search with
280            * @param orderByComparator the comparator to order the set by
281            * @return the last matching announcements delivery
282            * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a matching announcements delivery could not be found
283            * @throws SystemException if a system exception occurred
284            */
285            public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByUserId_Last(
286                    long userId,
287                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
288                    throws com.liferay.portal.kernel.exception.SystemException,
289                            com.liferay.portlet.announcements.NoSuchDeliveryException {
290                    return getPersistence().findByUserId_Last(userId, orderByComparator);
291            }
292    
293            /**
294            * Finds the announcements deliveries before and after the current announcements delivery in the ordered set where userId = &#63;.
295            *
296            * <p>
297            * 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.
298            * </p>
299            *
300            * @param deliveryId the primary key of the current announcements delivery
301            * @param userId the user id to search with
302            * @param orderByComparator the comparator to order the set by
303            * @return the previous, current, and next announcements delivery
304            * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a announcements delivery with the primary key could not be found
305            * @throws SystemException if a system exception occurred
306            */
307            public static com.liferay.portlet.announcements.model.AnnouncementsDelivery[] findByUserId_PrevAndNext(
308                    long deliveryId, long userId,
309                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
310                    throws com.liferay.portal.kernel.exception.SystemException,
311                            com.liferay.portlet.announcements.NoSuchDeliveryException {
312                    return getPersistence()
313                                       .findByUserId_PrevAndNext(deliveryId, userId,
314                            orderByComparator);
315            }
316    
317            /**
318            * Finds the announcements delivery where userId = &#63; and type = &#63; or throws a {@link com.liferay.portlet.announcements.NoSuchDeliveryException} if it could not be found.
319            *
320            * @param userId the user id to search with
321            * @param type the type to search with
322            * @return the matching announcements delivery
323            * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a matching announcements delivery could not be found
324            * @throws SystemException if a system exception occurred
325            */
326            public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByU_T(
327                    long userId, java.lang.String type)
328                    throws com.liferay.portal.kernel.exception.SystemException,
329                            com.liferay.portlet.announcements.NoSuchDeliveryException {
330                    return getPersistence().findByU_T(userId, type);
331            }
332    
333            /**
334            * Finds the announcements delivery where userId = &#63; and type = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
335            *
336            * @param userId the user id to search with
337            * @param type the type to search with
338            * @return the matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found
339            * @throws SystemException if a system exception occurred
340            */
341            public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByU_T(
342                    long userId, java.lang.String type)
343                    throws com.liferay.portal.kernel.exception.SystemException {
344                    return getPersistence().fetchByU_T(userId, type);
345            }
346    
347            /**
348            * Finds the announcements delivery where userId = &#63; and type = &#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 type the type to search with
352            * @return the matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found
353            * @throws SystemException if a system exception occurred
354            */
355            public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByU_T(
356                    long userId, java.lang.String type, boolean retrieveFromCache)
357                    throws com.liferay.portal.kernel.exception.SystemException {
358                    return getPersistence().fetchByU_T(userId, type, retrieveFromCache);
359            }
360    
361            /**
362            * Finds all the announcements deliveries.
363            *
364            * @return the announcements deliveries
365            * @throws SystemException if a system exception occurred
366            */
367            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll()
368                    throws com.liferay.portal.kernel.exception.SystemException {
369                    return getPersistence().findAll();
370            }
371    
372            /**
373            * Finds a range of all the announcements deliveries.
374            *
375            * <p>
376            * 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.
377            * </p>
378            *
379            * @param start the lower bound of the range of announcements deliveries to return
380            * @param end the upper bound of the range of announcements deliveries to return (not inclusive)
381            * @return the range of announcements deliveries
382            * @throws SystemException if a system exception occurred
383            */
384            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll(
385                    int start, int end)
386                    throws com.liferay.portal.kernel.exception.SystemException {
387                    return getPersistence().findAll(start, end);
388            }
389    
390            /**
391            * Finds an ordered range of all the announcements deliveries.
392            *
393            * <p>
394            * 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.
395            * </p>
396            *
397            * @param start the lower bound of the range of announcements deliveries to return
398            * @param end the upper bound of the range of announcements deliveries to return (not inclusive)
399            * @param orderByComparator the comparator to order the results by
400            * @return the ordered range of announcements deliveries
401            * @throws SystemException if a system exception occurred
402            */
403            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll(
404                    int start, int end,
405                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
406                    throws com.liferay.portal.kernel.exception.SystemException {
407                    return getPersistence().findAll(start, end, orderByComparator);
408            }
409    
410            /**
411            * Removes all the announcements deliveries where userId = &#63; from the database.
412            *
413            * @param userId the user id to search with
414            * @throws SystemException if a system exception occurred
415            */
416            public static void removeByUserId(long userId)
417                    throws com.liferay.portal.kernel.exception.SystemException {
418                    getPersistence().removeByUserId(userId);
419            }
420    
421            /**
422            * Removes the announcements delivery where userId = &#63; and type = &#63; from the database.
423            *
424            * @param userId the user id to search with
425            * @param type the type to search with
426            * @throws SystemException if a system exception occurred
427            */
428            public static void removeByU_T(long userId, java.lang.String type)
429                    throws com.liferay.portal.kernel.exception.SystemException,
430                            com.liferay.portlet.announcements.NoSuchDeliveryException {
431                    getPersistence().removeByU_T(userId, type);
432            }
433    
434            /**
435            * Removes all the announcements deliveries from the database.
436            *
437            * @throws SystemException if a system exception occurred
438            */
439            public static void removeAll()
440                    throws com.liferay.portal.kernel.exception.SystemException {
441                    getPersistence().removeAll();
442            }
443    
444            /**
445            * Counts all the announcements deliveries where userId = &#63;.
446            *
447            * @param userId the user id to search with
448            * @return the number of matching announcements deliveries
449            * @throws SystemException if a system exception occurred
450            */
451            public static int countByUserId(long userId)
452                    throws com.liferay.portal.kernel.exception.SystemException {
453                    return getPersistence().countByUserId(userId);
454            }
455    
456            /**
457            * Counts all the announcements deliveries where userId = &#63; and type = &#63;.
458            *
459            * @param userId the user id to search with
460            * @param type the type to search with
461            * @return the number of matching announcements deliveries
462            * @throws SystemException if a system exception occurred
463            */
464            public static int countByU_T(long userId, java.lang.String type)
465                    throws com.liferay.portal.kernel.exception.SystemException {
466                    return getPersistence().countByU_T(userId, type);
467            }
468    
469            /**
470            * Counts all the announcements deliveries.
471            *
472            * @return the number of announcements deliveries
473            * @throws SystemException if a system exception occurred
474            */
475            public static int countAll()
476                    throws com.liferay.portal.kernel.exception.SystemException {
477                    return getPersistence().countAll();
478            }
479    
480            public static AnnouncementsDeliveryPersistence getPersistence() {
481                    if (_persistence == null) {
482                            _persistence = (AnnouncementsDeliveryPersistence)PortalBeanLocatorUtil.locate(AnnouncementsDeliveryPersistence.class.getName());
483                    }
484    
485                    return _persistence;
486            }
487    
488            public void setPersistence(AnnouncementsDeliveryPersistence persistence) {
489                    _persistence = persistence;
490            }
491    
492            private static AnnouncementsDeliveryPersistence _persistence;
493    }