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