001    /**
002     * Copyright (c) 2000-present 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.portal.service.persistence;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.util.OrderByComparator;
022    import com.liferay.portal.kernel.util.ReferenceRegistry;
023    import com.liferay.portal.model.UserNotificationDelivery;
024    import com.liferay.portal.service.ServiceContext;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the user notification delivery service. This utility wraps {@link com.liferay.portal.service.persistence.impl.UserNotificationDeliveryPersistenceImpl} 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 UserNotificationDeliveryPersistence
037     * @see com.liferay.portal.service.persistence.impl.UserNotificationDeliveryPersistenceImpl
038     * @generated
039     */
040    @ProviderType
041    public class UserNotificationDeliveryUtil {
042            /*
043             * NOTE FOR DEVELOPERS:
044             *
045             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
046             */
047    
048            /**
049             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
050             */
051            public static void clearCache() {
052                    getPersistence().clearCache();
053            }
054    
055            /**
056             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
057             */
058            public static void clearCache(
059                    UserNotificationDelivery userNotificationDelivery) {
060                    getPersistence().clearCache(userNotificationDelivery);
061            }
062    
063            /**
064             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
065             */
066            public static long countWithDynamicQuery(DynamicQuery dynamicQuery) {
067                    return getPersistence().countWithDynamicQuery(dynamicQuery);
068            }
069    
070            /**
071             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
072             */
073            public static List<UserNotificationDelivery> findWithDynamicQuery(
074                    DynamicQuery dynamicQuery) {
075                    return getPersistence().findWithDynamicQuery(dynamicQuery);
076            }
077    
078            /**
079             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
080             */
081            public static List<UserNotificationDelivery> findWithDynamicQuery(
082                    DynamicQuery dynamicQuery, int start, int end) {
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<UserNotificationDelivery> findWithDynamicQuery(
090                    DynamicQuery dynamicQuery, int start, int end,
091                    OrderByComparator<UserNotificationDelivery> orderByComparator) {
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)
099             */
100            public static UserNotificationDelivery update(
101                    UserNotificationDelivery userNotificationDelivery) {
102                    return getPersistence().update(userNotificationDelivery);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
107             */
108            public static UserNotificationDelivery update(
109                    UserNotificationDelivery userNotificationDelivery,
110                    ServiceContext serviceContext) {
111                    return getPersistence().update(userNotificationDelivery, serviceContext);
112            }
113    
114            /**
115            * Returns all the user notification deliveries where userId = &#63;.
116            *
117            * @param userId the user ID
118            * @return the matching user notification deliveries
119            */
120            public static List<UserNotificationDelivery> findByUserId(long userId) {
121                    return getPersistence().findByUserId(userId);
122            }
123    
124            /**
125            * Returns a range of all the user notification deliveries where userId = &#63;.
126            *
127            * <p>
128            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link UserNotificationDeliveryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
129            * </p>
130            *
131            * @param userId the user ID
132            * @param start the lower bound of the range of user notification deliveries
133            * @param end the upper bound of the range of user notification deliveries (not inclusive)
134            * @return the range of matching user notification deliveries
135            */
136            public static List<UserNotificationDelivery> findByUserId(long userId,
137                    int start, int end) {
138                    return getPersistence().findByUserId(userId, start, end);
139            }
140    
141            /**
142            * Returns an ordered range of all the user notification deliveries where userId = &#63;.
143            *
144            * <p>
145            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link UserNotificationDeliveryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
146            * </p>
147            *
148            * @param userId the user ID
149            * @param start the lower bound of the range of user notification deliveries
150            * @param end the upper bound of the range of user notification deliveries (not inclusive)
151            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
152            * @return the ordered range of matching user notification deliveries
153            */
154            public static List<UserNotificationDelivery> findByUserId(long userId,
155                    int start, int end,
156                    OrderByComparator<UserNotificationDelivery> orderByComparator) {
157                    return getPersistence()
158                                       .findByUserId(userId, start, end, orderByComparator);
159            }
160    
161            /**
162            * Returns an ordered range of all the user notification deliveries where userId = &#63;.
163            *
164            * <p>
165            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link UserNotificationDeliveryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
166            * </p>
167            *
168            * @param userId the user ID
169            * @param start the lower bound of the range of user notification deliveries
170            * @param end the upper bound of the range of user notification deliveries (not inclusive)
171            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
172            * @param retrieveFromCache whether to retrieve from the finder cache
173            * @return the ordered range of matching user notification deliveries
174            */
175            public static List<UserNotificationDelivery> findByUserId(long userId,
176                    int start, int end,
177                    OrderByComparator<UserNotificationDelivery> orderByComparator,
178                    boolean retrieveFromCache) {
179                    return getPersistence()
180                                       .findByUserId(userId, start, end, orderByComparator,
181                            retrieveFromCache);
182            }
183    
184            /**
185            * Returns the first user notification delivery in the ordered set where userId = &#63;.
186            *
187            * @param userId the user ID
188            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
189            * @return the first matching user notification delivery
190            * @throws NoSuchUserNotificationDeliveryException if a matching user notification delivery could not be found
191            */
192            public static UserNotificationDelivery findByUserId_First(long userId,
193                    OrderByComparator<UserNotificationDelivery> orderByComparator)
194                    throws com.liferay.portal.exception.NoSuchUserNotificationDeliveryException {
195                    return getPersistence().findByUserId_First(userId, orderByComparator);
196            }
197    
198            /**
199            * Returns the first user notification delivery in the ordered set where userId = &#63;.
200            *
201            * @param userId the user ID
202            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
203            * @return the first matching user notification delivery, or <code>null</code> if a matching user notification delivery could not be found
204            */
205            public static UserNotificationDelivery fetchByUserId_First(long userId,
206                    OrderByComparator<UserNotificationDelivery> orderByComparator) {
207                    return getPersistence().fetchByUserId_First(userId, orderByComparator);
208            }
209    
210            /**
211            * Returns the last user notification delivery in the ordered set where userId = &#63;.
212            *
213            * @param userId the user ID
214            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
215            * @return the last matching user notification delivery
216            * @throws NoSuchUserNotificationDeliveryException if a matching user notification delivery could not be found
217            */
218            public static UserNotificationDelivery findByUserId_Last(long userId,
219                    OrderByComparator<UserNotificationDelivery> orderByComparator)
220                    throws com.liferay.portal.exception.NoSuchUserNotificationDeliveryException {
221                    return getPersistence().findByUserId_Last(userId, orderByComparator);
222            }
223    
224            /**
225            * Returns the last user notification delivery in the ordered set where userId = &#63;.
226            *
227            * @param userId the user ID
228            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
229            * @return the last matching user notification delivery, or <code>null</code> if a matching user notification delivery could not be found
230            */
231            public static UserNotificationDelivery fetchByUserId_Last(long userId,
232                    OrderByComparator<UserNotificationDelivery> orderByComparator) {
233                    return getPersistence().fetchByUserId_Last(userId, orderByComparator);
234            }
235    
236            /**
237            * Returns the user notification deliveries before and after the current user notification delivery in the ordered set where userId = &#63;.
238            *
239            * @param userNotificationDeliveryId the primary key of the current user notification delivery
240            * @param userId the user ID
241            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
242            * @return the previous, current, and next user notification delivery
243            * @throws NoSuchUserNotificationDeliveryException if a user notification delivery with the primary key could not be found
244            */
245            public static UserNotificationDelivery[] findByUserId_PrevAndNext(
246                    long userNotificationDeliveryId, long userId,
247                    OrderByComparator<UserNotificationDelivery> orderByComparator)
248                    throws com.liferay.portal.exception.NoSuchUserNotificationDeliveryException {
249                    return getPersistence()
250                                       .findByUserId_PrevAndNext(userNotificationDeliveryId,
251                            userId, orderByComparator);
252            }
253    
254            /**
255            * Removes all the user notification deliveries where userId = &#63; from the database.
256            *
257            * @param userId the user ID
258            */
259            public static void removeByUserId(long userId) {
260                    getPersistence().removeByUserId(userId);
261            }
262    
263            /**
264            * Returns the number of user notification deliveries where userId = &#63;.
265            *
266            * @param userId the user ID
267            * @return the number of matching user notification deliveries
268            */
269            public static int countByUserId(long userId) {
270                    return getPersistence().countByUserId(userId);
271            }
272    
273            /**
274            * Returns the user notification delivery where userId = &#63; and portletId = &#63; and classNameId = &#63; and notificationType = &#63; and deliveryType = &#63; or throws a {@link NoSuchUserNotificationDeliveryException} if it could not be found.
275            *
276            * @param userId the user ID
277            * @param portletId the portlet ID
278            * @param classNameId the class name ID
279            * @param notificationType the notification type
280            * @param deliveryType the delivery type
281            * @return the matching user notification delivery
282            * @throws NoSuchUserNotificationDeliveryException if a matching user notification delivery could not be found
283            */
284            public static UserNotificationDelivery findByU_P_C_N_D(long userId,
285                    java.lang.String portletId, long classNameId, int notificationType,
286                    int deliveryType)
287                    throws com.liferay.portal.exception.NoSuchUserNotificationDeliveryException {
288                    return getPersistence()
289                                       .findByU_P_C_N_D(userId, portletId, classNameId,
290                            notificationType, deliveryType);
291            }
292    
293            /**
294            * Returns the user notification delivery where userId = &#63; and portletId = &#63; and classNameId = &#63; and notificationType = &#63; and deliveryType = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
295            *
296            * @param userId the user ID
297            * @param portletId the portlet ID
298            * @param classNameId the class name ID
299            * @param notificationType the notification type
300            * @param deliveryType the delivery type
301            * @return the matching user notification delivery, or <code>null</code> if a matching user notification delivery could not be found
302            */
303            public static UserNotificationDelivery fetchByU_P_C_N_D(long userId,
304                    java.lang.String portletId, long classNameId, int notificationType,
305                    int deliveryType) {
306                    return getPersistence()
307                                       .fetchByU_P_C_N_D(userId, portletId, classNameId,
308                            notificationType, deliveryType);
309            }
310    
311            /**
312            * Returns the user notification delivery where userId = &#63; and portletId = &#63; and classNameId = &#63; and notificationType = &#63; and deliveryType = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
313            *
314            * @param userId the user ID
315            * @param portletId the portlet ID
316            * @param classNameId the class name ID
317            * @param notificationType the notification type
318            * @param deliveryType the delivery type
319            * @param retrieveFromCache whether to retrieve from the finder cache
320            * @return the matching user notification delivery, or <code>null</code> if a matching user notification delivery could not be found
321            */
322            public static UserNotificationDelivery fetchByU_P_C_N_D(long userId,
323                    java.lang.String portletId, long classNameId, int notificationType,
324                    int deliveryType, boolean retrieveFromCache) {
325                    return getPersistence()
326                                       .fetchByU_P_C_N_D(userId, portletId, classNameId,
327                            notificationType, deliveryType, retrieveFromCache);
328            }
329    
330            /**
331            * Removes the user notification delivery where userId = &#63; and portletId = &#63; and classNameId = &#63; and notificationType = &#63; and deliveryType = &#63; from the database.
332            *
333            * @param userId the user ID
334            * @param portletId the portlet ID
335            * @param classNameId the class name ID
336            * @param notificationType the notification type
337            * @param deliveryType the delivery type
338            * @return the user notification delivery that was removed
339            */
340            public static UserNotificationDelivery removeByU_P_C_N_D(long userId,
341                    java.lang.String portletId, long classNameId, int notificationType,
342                    int deliveryType)
343                    throws com.liferay.portal.exception.NoSuchUserNotificationDeliveryException {
344                    return getPersistence()
345                                       .removeByU_P_C_N_D(userId, portletId, classNameId,
346                            notificationType, deliveryType);
347            }
348    
349            /**
350            * Returns the number of user notification deliveries where userId = &#63; and portletId = &#63; and classNameId = &#63; and notificationType = &#63; and deliveryType = &#63;.
351            *
352            * @param userId the user ID
353            * @param portletId the portlet ID
354            * @param classNameId the class name ID
355            * @param notificationType the notification type
356            * @param deliveryType the delivery type
357            * @return the number of matching user notification deliveries
358            */
359            public static int countByU_P_C_N_D(long userId, java.lang.String portletId,
360                    long classNameId, int notificationType, int deliveryType) {
361                    return getPersistence()
362                                       .countByU_P_C_N_D(userId, portletId, classNameId,
363                            notificationType, deliveryType);
364            }
365    
366            /**
367            * Caches the user notification delivery in the entity cache if it is enabled.
368            *
369            * @param userNotificationDelivery the user notification delivery
370            */
371            public static void cacheResult(
372                    UserNotificationDelivery userNotificationDelivery) {
373                    getPersistence().cacheResult(userNotificationDelivery);
374            }
375    
376            /**
377            * Caches the user notification deliveries in the entity cache if it is enabled.
378            *
379            * @param userNotificationDeliveries the user notification deliveries
380            */
381            public static void cacheResult(
382                    List<UserNotificationDelivery> userNotificationDeliveries) {
383                    getPersistence().cacheResult(userNotificationDeliveries);
384            }
385    
386            /**
387            * Creates a new user notification delivery with the primary key. Does not add the user notification delivery to the database.
388            *
389            * @param userNotificationDeliveryId the primary key for the new user notification delivery
390            * @return the new user notification delivery
391            */
392            public static UserNotificationDelivery create(
393                    long userNotificationDeliveryId) {
394                    return getPersistence().create(userNotificationDeliveryId);
395            }
396    
397            /**
398            * Removes the user notification delivery with the primary key from the database. Also notifies the appropriate model listeners.
399            *
400            * @param userNotificationDeliveryId the primary key of the user notification delivery
401            * @return the user notification delivery that was removed
402            * @throws NoSuchUserNotificationDeliveryException if a user notification delivery with the primary key could not be found
403            */
404            public static UserNotificationDelivery remove(
405                    long userNotificationDeliveryId)
406                    throws com.liferay.portal.exception.NoSuchUserNotificationDeliveryException {
407                    return getPersistence().remove(userNotificationDeliveryId);
408            }
409    
410            public static UserNotificationDelivery updateImpl(
411                    UserNotificationDelivery userNotificationDelivery) {
412                    return getPersistence().updateImpl(userNotificationDelivery);
413            }
414    
415            /**
416            * Returns the user notification delivery with the primary key or throws a {@link NoSuchUserNotificationDeliveryException} if it could not be found.
417            *
418            * @param userNotificationDeliveryId the primary key of the user notification delivery
419            * @return the user notification delivery
420            * @throws NoSuchUserNotificationDeliveryException if a user notification delivery with the primary key could not be found
421            */
422            public static UserNotificationDelivery findByPrimaryKey(
423                    long userNotificationDeliveryId)
424                    throws com.liferay.portal.exception.NoSuchUserNotificationDeliveryException {
425                    return getPersistence().findByPrimaryKey(userNotificationDeliveryId);
426            }
427    
428            /**
429            * Returns the user notification delivery with the primary key or returns <code>null</code> if it could not be found.
430            *
431            * @param userNotificationDeliveryId the primary key of the user notification delivery
432            * @return the user notification delivery, or <code>null</code> if a user notification delivery with the primary key could not be found
433            */
434            public static UserNotificationDelivery fetchByPrimaryKey(
435                    long userNotificationDeliveryId) {
436                    return getPersistence().fetchByPrimaryKey(userNotificationDeliveryId);
437            }
438    
439            public static java.util.Map<java.io.Serializable, UserNotificationDelivery> fetchByPrimaryKeys(
440                    java.util.Set<java.io.Serializable> primaryKeys) {
441                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
442            }
443    
444            /**
445            * Returns all the user notification deliveries.
446            *
447            * @return the user notification deliveries
448            */
449            public static List<UserNotificationDelivery> findAll() {
450                    return getPersistence().findAll();
451            }
452    
453            /**
454            * Returns a range of all the user notification deliveries.
455            *
456            * <p>
457            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link UserNotificationDeliveryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
458            * </p>
459            *
460            * @param start the lower bound of the range of user notification deliveries
461            * @param end the upper bound of the range of user notification deliveries (not inclusive)
462            * @return the range of user notification deliveries
463            */
464            public static List<UserNotificationDelivery> findAll(int start, int end) {
465                    return getPersistence().findAll(start, end);
466            }
467    
468            /**
469            * Returns an ordered range of all the user notification deliveries.
470            *
471            * <p>
472            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link UserNotificationDeliveryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
473            * </p>
474            *
475            * @param start the lower bound of the range of user notification deliveries
476            * @param end the upper bound of the range of user notification deliveries (not inclusive)
477            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
478            * @return the ordered range of user notification deliveries
479            */
480            public static List<UserNotificationDelivery> findAll(int start, int end,
481                    OrderByComparator<UserNotificationDelivery> orderByComparator) {
482                    return getPersistence().findAll(start, end, orderByComparator);
483            }
484    
485            /**
486            * Returns an ordered range of all the user notification deliveries.
487            *
488            * <p>
489            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link UserNotificationDeliveryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
490            * </p>
491            *
492            * @param start the lower bound of the range of user notification deliveries
493            * @param end the upper bound of the range of user notification deliveries (not inclusive)
494            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
495            * @param retrieveFromCache whether to retrieve from the finder cache
496            * @return the ordered range of user notification deliveries
497            */
498            public static List<UserNotificationDelivery> findAll(int start, int end,
499                    OrderByComparator<UserNotificationDelivery> orderByComparator,
500                    boolean retrieveFromCache) {
501                    return getPersistence()
502                                       .findAll(start, end, orderByComparator, retrieveFromCache);
503            }
504    
505            /**
506            * Removes all the user notification deliveries from the database.
507            */
508            public static void removeAll() {
509                    getPersistence().removeAll();
510            }
511    
512            /**
513            * Returns the number of user notification deliveries.
514            *
515            * @return the number of user notification deliveries
516            */
517            public static int countAll() {
518                    return getPersistence().countAll();
519            }
520    
521            public static UserNotificationDeliveryPersistence getPersistence() {
522                    if (_persistence == null) {
523                            _persistence = (UserNotificationDeliveryPersistence)PortalBeanLocatorUtil.locate(UserNotificationDeliveryPersistence.class.getName());
524    
525                            ReferenceRegistry.registerReference(UserNotificationDeliveryUtil.class,
526                                    "_persistence");
527                    }
528    
529                    return _persistence;
530            }
531    
532            private static UserNotificationDeliveryPersistence _persistence;
533    }