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 the first user notification delivery in the ordered set where userId = &#63;.
163            *
164            * @param userId the user ID
165            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
166            * @return the first matching user notification delivery
167            * @throws NoSuchUserNotificationDeliveryException if a matching user notification delivery could not be found
168            */
169            public static UserNotificationDelivery findByUserId_First(long userId,
170                    OrderByComparator<UserNotificationDelivery> orderByComparator)
171                    throws com.liferay.portal.NoSuchUserNotificationDeliveryException {
172                    return getPersistence().findByUserId_First(userId, orderByComparator);
173            }
174    
175            /**
176            * Returns the first user notification delivery in the ordered set where userId = &#63;.
177            *
178            * @param userId the user ID
179            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
180            * @return the first matching user notification delivery, or <code>null</code> if a matching user notification delivery could not be found
181            */
182            public static UserNotificationDelivery fetchByUserId_First(long userId,
183                    OrderByComparator<UserNotificationDelivery> orderByComparator) {
184                    return getPersistence().fetchByUserId_First(userId, orderByComparator);
185            }
186    
187            /**
188            * Returns the last user notification delivery in the ordered set where userId = &#63;.
189            *
190            * @param userId the user ID
191            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
192            * @return the last matching user notification delivery
193            * @throws NoSuchUserNotificationDeliveryException if a matching user notification delivery could not be found
194            */
195            public static UserNotificationDelivery findByUserId_Last(long userId,
196                    OrderByComparator<UserNotificationDelivery> orderByComparator)
197                    throws com.liferay.portal.NoSuchUserNotificationDeliveryException {
198                    return getPersistence().findByUserId_Last(userId, orderByComparator);
199            }
200    
201            /**
202            * Returns the last user notification delivery in the ordered set where userId = &#63;.
203            *
204            * @param userId the user ID
205            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
206            * @return the last matching user notification delivery, or <code>null</code> if a matching user notification delivery could not be found
207            */
208            public static UserNotificationDelivery fetchByUserId_Last(long userId,
209                    OrderByComparator<UserNotificationDelivery> orderByComparator) {
210                    return getPersistence().fetchByUserId_Last(userId, orderByComparator);
211            }
212    
213            /**
214            * Returns the user notification deliveries before and after the current user notification delivery in the ordered set where userId = &#63;.
215            *
216            * @param userNotificationDeliveryId the primary key of the current user notification delivery
217            * @param userId the user ID
218            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
219            * @return the previous, current, and next user notification delivery
220            * @throws NoSuchUserNotificationDeliveryException if a user notification delivery with the primary key could not be found
221            */
222            public static UserNotificationDelivery[] findByUserId_PrevAndNext(
223                    long userNotificationDeliveryId, long userId,
224                    OrderByComparator<UserNotificationDelivery> orderByComparator)
225                    throws com.liferay.portal.NoSuchUserNotificationDeliveryException {
226                    return getPersistence()
227                                       .findByUserId_PrevAndNext(userNotificationDeliveryId,
228                            userId, orderByComparator);
229            }
230    
231            /**
232            * Removes all the user notification deliveries where userId = &#63; from the database.
233            *
234            * @param userId the user ID
235            */
236            public static void removeByUserId(long userId) {
237                    getPersistence().removeByUserId(userId);
238            }
239    
240            /**
241            * Returns the number of user notification deliveries where userId = &#63;.
242            *
243            * @param userId the user ID
244            * @return the number of matching user notification deliveries
245            */
246            public static int countByUserId(long userId) {
247                    return getPersistence().countByUserId(userId);
248            }
249    
250            /**
251            * 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.
252            *
253            * @param userId the user ID
254            * @param portletId the portlet ID
255            * @param classNameId the class name ID
256            * @param notificationType the notification type
257            * @param deliveryType the delivery type
258            * @return the matching user notification delivery
259            * @throws NoSuchUserNotificationDeliveryException if a matching user notification delivery could not be found
260            */
261            public static UserNotificationDelivery findByU_P_C_N_D(long userId,
262                    java.lang.String portletId, long classNameId, int notificationType,
263                    int deliveryType)
264                    throws com.liferay.portal.NoSuchUserNotificationDeliveryException {
265                    return getPersistence()
266                                       .findByU_P_C_N_D(userId, portletId, classNameId,
267                            notificationType, deliveryType);
268            }
269    
270            /**
271            * 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.
272            *
273            * @param userId the user ID
274            * @param portletId the portlet ID
275            * @param classNameId the class name ID
276            * @param notificationType the notification type
277            * @param deliveryType the delivery type
278            * @return the matching user notification delivery, or <code>null</code> if a matching user notification delivery could not be found
279            */
280            public static UserNotificationDelivery fetchByU_P_C_N_D(long userId,
281                    java.lang.String portletId, long classNameId, int notificationType,
282                    int deliveryType) {
283                    return getPersistence()
284                                       .fetchByU_P_C_N_D(userId, portletId, classNameId,
285                            notificationType, deliveryType);
286            }
287    
288            /**
289            * 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.
290            *
291            * @param userId the user ID
292            * @param portletId the portlet ID
293            * @param classNameId the class name ID
294            * @param notificationType the notification type
295            * @param deliveryType the delivery type
296            * @param retrieveFromCache whether to use the finder cache
297            * @return the matching user notification delivery, or <code>null</code> if a matching user notification delivery could not be found
298            */
299            public static UserNotificationDelivery fetchByU_P_C_N_D(long userId,
300                    java.lang.String portletId, long classNameId, int notificationType,
301                    int deliveryType, boolean retrieveFromCache) {
302                    return getPersistence()
303                                       .fetchByU_P_C_N_D(userId, portletId, classNameId,
304                            notificationType, deliveryType, retrieveFromCache);
305            }
306    
307            /**
308            * Removes the user notification delivery where userId = &#63; and portletId = &#63; and classNameId = &#63; and notificationType = &#63; and deliveryType = &#63; from the database.
309            *
310            * @param userId the user ID
311            * @param portletId the portlet ID
312            * @param classNameId the class name ID
313            * @param notificationType the notification type
314            * @param deliveryType the delivery type
315            * @return the user notification delivery that was removed
316            */
317            public static UserNotificationDelivery removeByU_P_C_N_D(long userId,
318                    java.lang.String portletId, long classNameId, int notificationType,
319                    int deliveryType)
320                    throws com.liferay.portal.NoSuchUserNotificationDeliveryException {
321                    return getPersistence()
322                                       .removeByU_P_C_N_D(userId, portletId, classNameId,
323                            notificationType, deliveryType);
324            }
325    
326            /**
327            * Returns the number of user notification deliveries where userId = &#63; and portletId = &#63; and classNameId = &#63; and notificationType = &#63; and deliveryType = &#63;.
328            *
329            * @param userId the user ID
330            * @param portletId the portlet ID
331            * @param classNameId the class name ID
332            * @param notificationType the notification type
333            * @param deliveryType the delivery type
334            * @return the number of matching user notification deliveries
335            */
336            public static int countByU_P_C_N_D(long userId, java.lang.String portletId,
337                    long classNameId, int notificationType, int deliveryType) {
338                    return getPersistence()
339                                       .countByU_P_C_N_D(userId, portletId, classNameId,
340                            notificationType, deliveryType);
341            }
342    
343            /**
344            * Caches the user notification delivery in the entity cache if it is enabled.
345            *
346            * @param userNotificationDelivery the user notification delivery
347            */
348            public static void cacheResult(
349                    UserNotificationDelivery userNotificationDelivery) {
350                    getPersistence().cacheResult(userNotificationDelivery);
351            }
352    
353            /**
354            * Caches the user notification deliveries in the entity cache if it is enabled.
355            *
356            * @param userNotificationDeliveries the user notification deliveries
357            */
358            public static void cacheResult(
359                    List<UserNotificationDelivery> userNotificationDeliveries) {
360                    getPersistence().cacheResult(userNotificationDeliveries);
361            }
362    
363            /**
364            * Creates a new user notification delivery with the primary key. Does not add the user notification delivery to the database.
365            *
366            * @param userNotificationDeliveryId the primary key for the new user notification delivery
367            * @return the new user notification delivery
368            */
369            public static UserNotificationDelivery create(
370                    long userNotificationDeliveryId) {
371                    return getPersistence().create(userNotificationDeliveryId);
372            }
373    
374            /**
375            * Removes the user notification delivery with the primary key from the database. Also notifies the appropriate model listeners.
376            *
377            * @param userNotificationDeliveryId the primary key of the user notification delivery
378            * @return the user notification delivery that was removed
379            * @throws NoSuchUserNotificationDeliveryException if a user notification delivery with the primary key could not be found
380            */
381            public static UserNotificationDelivery remove(
382                    long userNotificationDeliveryId)
383                    throws com.liferay.portal.NoSuchUserNotificationDeliveryException {
384                    return getPersistence().remove(userNotificationDeliveryId);
385            }
386    
387            public static UserNotificationDelivery updateImpl(
388                    UserNotificationDelivery userNotificationDelivery) {
389                    return getPersistence().updateImpl(userNotificationDelivery);
390            }
391    
392            /**
393            * Returns the user notification delivery with the primary key or throws a {@link NoSuchUserNotificationDeliveryException} if it could not be found.
394            *
395            * @param userNotificationDeliveryId the primary key of the user notification delivery
396            * @return the user notification delivery
397            * @throws NoSuchUserNotificationDeliveryException if a user notification delivery with the primary key could not be found
398            */
399            public static UserNotificationDelivery findByPrimaryKey(
400                    long userNotificationDeliveryId)
401                    throws com.liferay.portal.NoSuchUserNotificationDeliveryException {
402                    return getPersistence().findByPrimaryKey(userNotificationDeliveryId);
403            }
404    
405            /**
406            * Returns the user notification delivery with the primary key or returns <code>null</code> if it could not be found.
407            *
408            * @param userNotificationDeliveryId the primary key of the user notification delivery
409            * @return the user notification delivery, or <code>null</code> if a user notification delivery with the primary key could not be found
410            */
411            public static UserNotificationDelivery fetchByPrimaryKey(
412                    long userNotificationDeliveryId) {
413                    return getPersistence().fetchByPrimaryKey(userNotificationDeliveryId);
414            }
415    
416            public static java.util.Map<java.io.Serializable, UserNotificationDelivery> fetchByPrimaryKeys(
417                    java.util.Set<java.io.Serializable> primaryKeys) {
418                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
419            }
420    
421            /**
422            * Returns all the user notification deliveries.
423            *
424            * @return the user notification deliveries
425            */
426            public static List<UserNotificationDelivery> findAll() {
427                    return getPersistence().findAll();
428            }
429    
430            /**
431            * Returns a range of all the user notification deliveries.
432            *
433            * <p>
434            * 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.
435            * </p>
436            *
437            * @param start the lower bound of the range of user notification deliveries
438            * @param end the upper bound of the range of user notification deliveries (not inclusive)
439            * @return the range of user notification deliveries
440            */
441            public static List<UserNotificationDelivery> findAll(int start, int end) {
442                    return getPersistence().findAll(start, end);
443            }
444    
445            /**
446            * Returns an ordered range of all the user notification deliveries.
447            *
448            * <p>
449            * 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.
450            * </p>
451            *
452            * @param start the lower bound of the range of user notification deliveries
453            * @param end the upper bound of the range of user notification deliveries (not inclusive)
454            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
455            * @return the ordered range of user notification deliveries
456            */
457            public static List<UserNotificationDelivery> findAll(int start, int end,
458                    OrderByComparator<UserNotificationDelivery> orderByComparator) {
459                    return getPersistence().findAll(start, end, orderByComparator);
460            }
461    
462            /**
463            * Removes all the user notification deliveries from the database.
464            */
465            public static void removeAll() {
466                    getPersistence().removeAll();
467            }
468    
469            /**
470            * Returns the number of user notification deliveries.
471            *
472            * @return the number of user notification deliveries
473            */
474            public static int countAll() {
475                    return getPersistence().countAll();
476            }
477    
478            public static UserNotificationDeliveryPersistence getPersistence() {
479                    if (_persistence == null) {
480                            _persistence = (UserNotificationDeliveryPersistence)PortalBeanLocatorUtil.locate(UserNotificationDeliveryPersistence.class.getName());
481    
482                            ReferenceRegistry.registerReference(UserNotificationDeliveryUtil.class,
483                                    "_persistence");
484                    }
485    
486                    return _persistence;
487            }
488    
489            /**
490             * @deprecated As of 6.2.0
491             */
492            @Deprecated
493            public void setPersistence(UserNotificationDeliveryPersistence persistence) {
494            }
495    
496            private static UserNotificationDeliveryPersistence _persistence;
497    }