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