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