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
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
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
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            * Returns 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
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            * Returns 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
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            * Returns all the announcements deliveries where userId = &#63;.
207            *
208            * @param userId the user ID
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            * Returns 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
225            * @param start the lower bound of the range of announcements deliveries
226            * @param end the upper bound of the range of announcements deliveries (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            * Returns 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
244            * @param start the lower bound of the range of announcements deliveries
245            * @param end the upper bound of the range of announcements deliveries (not inclusive)
246            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
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            * Returns 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
266            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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            * Returns 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
287            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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            * Returns 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
309            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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            * 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.
326            *
327            * @param userId the user ID
328            * @param type the type
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            * 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.
342            *
343            * @param userId the user ID
344            * @param type the type
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            * 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.
356            *
357            * @param userId the user ID
358            * @param type the type
359            * @param retrieveFromCache whether to use the finder cache
360            * @return the matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found
361            * @throws SystemException if a system exception occurred
362            */
363            public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByU_T(
364                    long userId, java.lang.String type, boolean retrieveFromCache)
365                    throws com.liferay.portal.kernel.exception.SystemException {
366                    return getPersistence().fetchByU_T(userId, type, retrieveFromCache);
367            }
368    
369            /**
370            * Returns all the announcements deliveries.
371            *
372            * @return the announcements deliveries
373            * @throws SystemException if a system exception occurred
374            */
375            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll()
376                    throws com.liferay.portal.kernel.exception.SystemException {
377                    return getPersistence().findAll();
378            }
379    
380            /**
381            * Returns a range of all the announcements deliveries.
382            *
383            * <p>
384            * 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.
385            * </p>
386            *
387            * @param start the lower bound of the range of announcements deliveries
388            * @param end the upper bound of the range of announcements deliveries (not inclusive)
389            * @return the range of announcements deliveries
390            * @throws SystemException if a system exception occurred
391            */
392            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll(
393                    int start, int end)
394                    throws com.liferay.portal.kernel.exception.SystemException {
395                    return getPersistence().findAll(start, end);
396            }
397    
398            /**
399            * Returns an ordered range of all the announcements deliveries.
400            *
401            * <p>
402            * 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.
403            * </p>
404            *
405            * @param start the lower bound of the range of announcements deliveries
406            * @param end the upper bound of the range of announcements deliveries (not inclusive)
407            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
408            * @return the ordered range of announcements deliveries
409            * @throws SystemException if a system exception occurred
410            */
411            public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll(
412                    int start, int end,
413                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
414                    throws com.liferay.portal.kernel.exception.SystemException {
415                    return getPersistence().findAll(start, end, orderByComparator);
416            }
417    
418            /**
419            * Removes all the announcements deliveries where userId = &#63; from the database.
420            *
421            * @param userId the user ID
422            * @throws SystemException if a system exception occurred
423            */
424            public static void removeByUserId(long userId)
425                    throws com.liferay.portal.kernel.exception.SystemException {
426                    getPersistence().removeByUserId(userId);
427            }
428    
429            /**
430            * Removes the announcements delivery where userId = &#63; and type = &#63; from the database.
431            *
432            * @param userId the user ID
433            * @param type the type
434            * @throws SystemException if a system exception occurred
435            */
436            public static void removeByU_T(long userId, java.lang.String type)
437                    throws com.liferay.portal.kernel.exception.SystemException,
438                            com.liferay.portlet.announcements.NoSuchDeliveryException {
439                    getPersistence().removeByU_T(userId, type);
440            }
441    
442            /**
443            * Removes all the announcements deliveries from the database.
444            *
445            * @throws SystemException if a system exception occurred
446            */
447            public static void removeAll()
448                    throws com.liferay.portal.kernel.exception.SystemException {
449                    getPersistence().removeAll();
450            }
451    
452            /**
453            * Returns the number of announcements deliveries where userId = &#63;.
454            *
455            * @param userId the user ID
456            * @return the number of matching announcements deliveries
457            * @throws SystemException if a system exception occurred
458            */
459            public static int countByUserId(long userId)
460                    throws com.liferay.portal.kernel.exception.SystemException {
461                    return getPersistence().countByUserId(userId);
462            }
463    
464            /**
465            * Returns the number of announcements deliveries where userId = &#63; and type = &#63;.
466            *
467            * @param userId the user ID
468            * @param type the type
469            * @return the number of matching announcements deliveries
470            * @throws SystemException if a system exception occurred
471            */
472            public static int countByU_T(long userId, java.lang.String type)
473                    throws com.liferay.portal.kernel.exception.SystemException {
474                    return getPersistence().countByU_T(userId, type);
475            }
476    
477            /**
478            * Returns the number of announcements deliveries.
479            *
480            * @return the number of announcements deliveries
481            * @throws SystemException if a system exception occurred
482            */
483            public static int countAll()
484                    throws com.liferay.portal.kernel.exception.SystemException {
485                    return getPersistence().countAll();
486            }
487    
488            public static AnnouncementsDeliveryPersistence getPersistence() {
489                    if (_persistence == null) {
490                            _persistence = (AnnouncementsDeliveryPersistence)PortalBeanLocatorUtil.locate(AnnouncementsDeliveryPersistence.class.getName());
491    
492                            ReferenceRegistry.registerReference(AnnouncementsDeliveryUtil.class,
493                                    "_persistence");
494                    }
495    
496                    return _persistence;
497            }
498    
499            public void setPersistence(AnnouncementsDeliveryPersistence persistence) {
500                    _persistence = persistence;
501    
502                    ReferenceRegistry.registerReference(AnnouncementsDeliveryUtil.class,
503                            "_persistence");
504            }
505    
506            private static AnnouncementsDeliveryPersistence _persistence;
507    }