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.exception.NoSuchUserNotificationDeliveryException;
020    import com.liferay.portal.model.UserNotificationDelivery;
021    
022    /**
023     * The persistence interface for the user notification delivery service.
024     *
025     * <p>
026     * Caching information and settings can be found in <code>portal.properties</code>
027     * </p>
028     *
029     * @author Brian Wing Shun Chan
030     * @see com.liferay.portal.service.persistence.impl.UserNotificationDeliveryPersistenceImpl
031     * @see UserNotificationDeliveryUtil
032     * @generated
033     */
034    @ProviderType
035    public interface UserNotificationDeliveryPersistence extends BasePersistence<UserNotificationDelivery> {
036            /*
037             * NOTE FOR DEVELOPERS:
038             *
039             * Never modify or reference this interface directly. Always use {@link UserNotificationDeliveryUtil} to access the user notification delivery persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
040             */
041    
042            /**
043            * Returns all the user notification deliveries where userId = &#63;.
044            *
045            * @param userId the user ID
046            * @return the matching user notification deliveries
047            */
048            public java.util.List<UserNotificationDelivery> findByUserId(long userId);
049    
050            /**
051            * Returns a range of all the user notification deliveries where userId = &#63;.
052            *
053            * <p>
054            * 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.
055            * </p>
056            *
057            * @param userId the user ID
058            * @param start the lower bound of the range of user notification deliveries
059            * @param end the upper bound of the range of user notification deliveries (not inclusive)
060            * @return the range of matching user notification deliveries
061            */
062            public java.util.List<UserNotificationDelivery> findByUserId(long userId,
063                    int start, int end);
064    
065            /**
066            * Returns an ordered range of all the user notification deliveries where userId = &#63;.
067            *
068            * <p>
069            * 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.
070            * </p>
071            *
072            * @param userId the user ID
073            * @param start the lower bound of the range of user notification deliveries
074            * @param end the upper bound of the range of user notification deliveries (not inclusive)
075            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
076            * @return the ordered range of matching user notification deliveries
077            */
078            public java.util.List<UserNotificationDelivery> findByUserId(long userId,
079                    int start, int end,
080                    com.liferay.portal.kernel.util.OrderByComparator<UserNotificationDelivery> orderByComparator);
081    
082            /**
083            * Returns an ordered range of all the user notification deliveries where userId = &#63;.
084            *
085            * <p>
086            * 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.
087            * </p>
088            *
089            * @param userId the user ID
090            * @param start the lower bound of the range of user notification deliveries
091            * @param end the upper bound of the range of user notification deliveries (not inclusive)
092            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
093            * @param retrieveFromCache whether to retrieve from the finder cache
094            * @return the ordered range of matching user notification deliveries
095            */
096            public java.util.List<UserNotificationDelivery> findByUserId(long userId,
097                    int start, int end,
098                    com.liferay.portal.kernel.util.OrderByComparator<UserNotificationDelivery> orderByComparator,
099                    boolean retrieveFromCache);
100    
101            /**
102            * Returns the first user notification delivery in the ordered set where userId = &#63;.
103            *
104            * @param userId the user ID
105            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
106            * @return the first matching user notification delivery
107            * @throws NoSuchUserNotificationDeliveryException if a matching user notification delivery could not be found
108            */
109            public UserNotificationDelivery findByUserId_First(long userId,
110                    com.liferay.portal.kernel.util.OrderByComparator<UserNotificationDelivery> orderByComparator)
111                    throws NoSuchUserNotificationDeliveryException;
112    
113            /**
114            * Returns the first user notification delivery in the ordered set where userId = &#63;.
115            *
116            * @param userId the user ID
117            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
118            * @return the first matching user notification delivery, or <code>null</code> if a matching user notification delivery could not be found
119            */
120            public UserNotificationDelivery fetchByUserId_First(long userId,
121                    com.liferay.portal.kernel.util.OrderByComparator<UserNotificationDelivery> orderByComparator);
122    
123            /**
124            * Returns the last user notification delivery in the ordered set where userId = &#63;.
125            *
126            * @param userId the user ID
127            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
128            * @return the last matching user notification delivery
129            * @throws NoSuchUserNotificationDeliveryException if a matching user notification delivery could not be found
130            */
131            public UserNotificationDelivery findByUserId_Last(long userId,
132                    com.liferay.portal.kernel.util.OrderByComparator<UserNotificationDelivery> orderByComparator)
133                    throws NoSuchUserNotificationDeliveryException;
134    
135            /**
136            * Returns the last user notification delivery in the ordered set where userId = &#63;.
137            *
138            * @param userId the user ID
139            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
140            * @return the last matching user notification delivery, or <code>null</code> if a matching user notification delivery could not be found
141            */
142            public UserNotificationDelivery fetchByUserId_Last(long userId,
143                    com.liferay.portal.kernel.util.OrderByComparator<UserNotificationDelivery> orderByComparator);
144    
145            /**
146            * Returns the user notification deliveries before and after the current user notification delivery in the ordered set where userId = &#63;.
147            *
148            * @param userNotificationDeliveryId the primary key of the current user notification delivery
149            * @param userId the user ID
150            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
151            * @return the previous, current, and next user notification delivery
152            * @throws NoSuchUserNotificationDeliveryException if a user notification delivery with the primary key could not be found
153            */
154            public UserNotificationDelivery[] findByUserId_PrevAndNext(
155                    long userNotificationDeliveryId, long userId,
156                    com.liferay.portal.kernel.util.OrderByComparator<UserNotificationDelivery> orderByComparator)
157                    throws NoSuchUserNotificationDeliveryException;
158    
159            /**
160            * Removes all the user notification deliveries where userId = &#63; from the database.
161            *
162            * @param userId the user ID
163            */
164            public void removeByUserId(long userId);
165    
166            /**
167            * Returns the number of user notification deliveries where userId = &#63;.
168            *
169            * @param userId the user ID
170            * @return the number of matching user notification deliveries
171            */
172            public int countByUserId(long userId);
173    
174            /**
175            * 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.
176            *
177            * @param userId the user ID
178            * @param portletId the portlet ID
179            * @param classNameId the class name ID
180            * @param notificationType the notification type
181            * @param deliveryType the delivery type
182            * @return the matching user notification delivery
183            * @throws NoSuchUserNotificationDeliveryException if a matching user notification delivery could not be found
184            */
185            public UserNotificationDelivery findByU_P_C_N_D(long userId,
186                    java.lang.String portletId, long classNameId, int notificationType,
187                    int deliveryType) throws NoSuchUserNotificationDeliveryException;
188    
189            /**
190            * 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.
191            *
192            * @param userId the user ID
193            * @param portletId the portlet ID
194            * @param classNameId the class name ID
195            * @param notificationType the notification type
196            * @param deliveryType the delivery type
197            * @return the matching user notification delivery, or <code>null</code> if a matching user notification delivery could not be found
198            */
199            public UserNotificationDelivery fetchByU_P_C_N_D(long userId,
200                    java.lang.String portletId, long classNameId, int notificationType,
201                    int deliveryType);
202    
203            /**
204            * 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.
205            *
206            * @param userId the user ID
207            * @param portletId the portlet ID
208            * @param classNameId the class name ID
209            * @param notificationType the notification type
210            * @param deliveryType the delivery type
211            * @param retrieveFromCache whether to retrieve from the finder cache
212            * @return the matching user notification delivery, or <code>null</code> if a matching user notification delivery could not be found
213            */
214            public UserNotificationDelivery fetchByU_P_C_N_D(long userId,
215                    java.lang.String portletId, long classNameId, int notificationType,
216                    int deliveryType, boolean retrieveFromCache);
217    
218            /**
219            * Removes the user notification delivery where userId = &#63; and portletId = &#63; and classNameId = &#63; and notificationType = &#63; and deliveryType = &#63; from the database.
220            *
221            * @param userId the user ID
222            * @param portletId the portlet ID
223            * @param classNameId the class name ID
224            * @param notificationType the notification type
225            * @param deliveryType the delivery type
226            * @return the user notification delivery that was removed
227            */
228            public UserNotificationDelivery removeByU_P_C_N_D(long userId,
229                    java.lang.String portletId, long classNameId, int notificationType,
230                    int deliveryType) throws NoSuchUserNotificationDeliveryException;
231    
232            /**
233            * Returns the number of user notification deliveries where userId = &#63; and portletId = &#63; and classNameId = &#63; and notificationType = &#63; and deliveryType = &#63;.
234            *
235            * @param userId the user ID
236            * @param portletId the portlet ID
237            * @param classNameId the class name ID
238            * @param notificationType the notification type
239            * @param deliveryType the delivery type
240            * @return the number of matching user notification deliveries
241            */
242            public int countByU_P_C_N_D(long userId, java.lang.String portletId,
243                    long classNameId, int notificationType, int deliveryType);
244    
245            /**
246            * Caches the user notification delivery in the entity cache if it is enabled.
247            *
248            * @param userNotificationDelivery the user notification delivery
249            */
250            public void cacheResult(UserNotificationDelivery userNotificationDelivery);
251    
252            /**
253            * Caches the user notification deliveries in the entity cache if it is enabled.
254            *
255            * @param userNotificationDeliveries the user notification deliveries
256            */
257            public void cacheResult(
258                    java.util.List<UserNotificationDelivery> userNotificationDeliveries);
259    
260            /**
261            * Creates a new user notification delivery with the primary key. Does not add the user notification delivery to the database.
262            *
263            * @param userNotificationDeliveryId the primary key for the new user notification delivery
264            * @return the new user notification delivery
265            */
266            public UserNotificationDelivery create(long userNotificationDeliveryId);
267    
268            /**
269            * Removes the user notification delivery with the primary key from the database. Also notifies the appropriate model listeners.
270            *
271            * @param userNotificationDeliveryId the primary key of the user notification delivery
272            * @return the user notification delivery that was removed
273            * @throws NoSuchUserNotificationDeliveryException if a user notification delivery with the primary key could not be found
274            */
275            public UserNotificationDelivery remove(long userNotificationDeliveryId)
276                    throws NoSuchUserNotificationDeliveryException;
277    
278            public UserNotificationDelivery updateImpl(
279                    UserNotificationDelivery userNotificationDelivery);
280    
281            /**
282            * Returns the user notification delivery with the primary key or throws a {@link NoSuchUserNotificationDeliveryException} if it could not be found.
283            *
284            * @param userNotificationDeliveryId the primary key of the user notification delivery
285            * @return the user notification delivery
286            * @throws NoSuchUserNotificationDeliveryException if a user notification delivery with the primary key could not be found
287            */
288            public UserNotificationDelivery findByPrimaryKey(
289                    long userNotificationDeliveryId)
290                    throws NoSuchUserNotificationDeliveryException;
291    
292            /**
293            * Returns the user notification delivery with the primary key or returns <code>null</code> if it could not be found.
294            *
295            * @param userNotificationDeliveryId the primary key of the user notification delivery
296            * @return the user notification delivery, or <code>null</code> if a user notification delivery with the primary key could not be found
297            */
298            public UserNotificationDelivery fetchByPrimaryKey(
299                    long userNotificationDeliveryId);
300    
301            @Override
302            public java.util.Map<java.io.Serializable, UserNotificationDelivery> fetchByPrimaryKeys(
303                    java.util.Set<java.io.Serializable> primaryKeys);
304    
305            /**
306            * Returns all the user notification deliveries.
307            *
308            * @return the user notification deliveries
309            */
310            public java.util.List<UserNotificationDelivery> findAll();
311    
312            /**
313            * Returns a range of all the user notification deliveries.
314            *
315            * <p>
316            * 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.
317            * </p>
318            *
319            * @param start the lower bound of the range of user notification deliveries
320            * @param end the upper bound of the range of user notification deliveries (not inclusive)
321            * @return the range of user notification deliveries
322            */
323            public java.util.List<UserNotificationDelivery> findAll(int start, int end);
324    
325            /**
326            * Returns an ordered range of all the user notification deliveries.
327            *
328            * <p>
329            * 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.
330            * </p>
331            *
332            * @param start the lower bound of the range of user notification deliveries
333            * @param end the upper bound of the range of user notification deliveries (not inclusive)
334            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
335            * @return the ordered range of user notification deliveries
336            */
337            public java.util.List<UserNotificationDelivery> findAll(int start, int end,
338                    com.liferay.portal.kernel.util.OrderByComparator<UserNotificationDelivery> orderByComparator);
339    
340            /**
341            * Returns an ordered range of all the user notification deliveries.
342            *
343            * <p>
344            * 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.
345            * </p>
346            *
347            * @param start the lower bound of the range of user notification deliveries
348            * @param end the upper bound of the range of user notification deliveries (not inclusive)
349            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
350            * @param retrieveFromCache whether to retrieve from the finder cache
351            * @return the ordered range of user notification deliveries
352            */
353            public java.util.List<UserNotificationDelivery> findAll(int start, int end,
354                    com.liferay.portal.kernel.util.OrderByComparator<UserNotificationDelivery> orderByComparator,
355                    boolean retrieveFromCache);
356    
357            /**
358            * Removes all the user notification deliveries from the database.
359            */
360            public void removeAll();
361    
362            /**
363            * Returns the number of user notification deliveries.
364            *
365            * @return the number of user notification deliveries
366            */
367            public int countAll();
368    }