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