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