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.portlet.announcements.service.persistence;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.service.persistence.BasePersistence;
020    
021    import com.liferay.portlet.announcements.model.AnnouncementsFlag;
022    
023    /**
024     * The persistence interface for the announcements flag service.
025     *
026     * <p>
027     * Caching information and settings can be found in <code>portal.properties</code>
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see com.liferay.portlet.announcements.service.persistence.impl.AnnouncementsFlagPersistenceImpl
032     * @see AnnouncementsFlagUtil
033     * @generated
034     */
035    @ProviderType
036    public interface AnnouncementsFlagPersistence extends BasePersistence<AnnouncementsFlag> {
037            /*
038             * NOTE FOR DEVELOPERS:
039             *
040             * 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.
041             */
042    
043            /**
044            * Returns all the announcements flags where entryId = &#63;.
045            *
046            * @param entryId the entry ID
047            * @return the matching announcements flags
048            */
049            public java.util.List<AnnouncementsFlag> findByEntryId(long entryId);
050    
051            /**
052            * Returns a range of all the announcements flags where entryId = &#63;.
053            *
054            * <p>
055            * 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.
056            * </p>
057            *
058            * @param entryId the entry ID
059            * @param start the lower bound of the range of announcements flags
060            * @param end the upper bound of the range of announcements flags (not inclusive)
061            * @return the range of matching announcements flags
062            */
063            public java.util.List<AnnouncementsFlag> findByEntryId(long entryId,
064                    int start, int end);
065    
066            /**
067            * Returns an ordered range of all the announcements flags where entryId = &#63;.
068            *
069            * <p>
070            * 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.
071            * </p>
072            *
073            * @param entryId the entry ID
074            * @param start the lower bound of the range of announcements flags
075            * @param end the upper bound of the range of announcements flags (not inclusive)
076            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
077            * @return the ordered range of matching announcements flags
078            */
079            public java.util.List<AnnouncementsFlag> findByEntryId(long entryId,
080                    int start, int end,
081                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator);
082    
083            /**
084            * Returns an ordered range of all the announcements flags where entryId = &#63;.
085            *
086            * <p>
087            * 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.
088            * </p>
089            *
090            * @param entryId the entry ID
091            * @param start the lower bound of the range of announcements flags
092            * @param end the upper bound of the range of announcements flags (not inclusive)
093            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
094            * @param retrieveFromCache whether to retrieve from the finder cache
095            * @return the ordered range of matching announcements flags
096            */
097            public java.util.List<AnnouncementsFlag> findByEntryId(long entryId,
098                    int start, int end,
099                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator,
100                    boolean retrieveFromCache);
101    
102            /**
103            * Returns the first announcements flag in the ordered set where entryId = &#63;.
104            *
105            * @param entryId the entry ID
106            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
107            * @return the first matching announcements flag
108            * @throws NoSuchFlagException if a matching announcements flag could not be found
109            */
110            public AnnouncementsFlag findByEntryId_First(long entryId,
111                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator)
112                    throws com.liferay.portlet.announcements.exception.NoSuchFlagException;
113    
114            /**
115            * Returns the first announcements flag in the ordered set where entryId = &#63;.
116            *
117            * @param entryId the entry ID
118            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
119            * @return the first matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
120            */
121            public AnnouncementsFlag fetchByEntryId_First(long entryId,
122                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator);
123    
124            /**
125            * Returns the last announcements flag in the ordered set where entryId = &#63;.
126            *
127            * @param entryId the entry ID
128            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
129            * @return the last matching announcements flag
130            * @throws NoSuchFlagException if a matching announcements flag could not be found
131            */
132            public AnnouncementsFlag findByEntryId_Last(long entryId,
133                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator)
134                    throws com.liferay.portlet.announcements.exception.NoSuchFlagException;
135    
136            /**
137            * Returns the last announcements flag in the ordered set where entryId = &#63;.
138            *
139            * @param entryId the entry ID
140            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
141            * @return the last matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
142            */
143            public AnnouncementsFlag fetchByEntryId_Last(long entryId,
144                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator);
145    
146            /**
147            * Returns the announcements flags before and after the current announcements flag in the ordered set where entryId = &#63;.
148            *
149            * @param flagId the primary key of the current announcements flag
150            * @param entryId the entry ID
151            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
152            * @return the previous, current, and next announcements flag
153            * @throws NoSuchFlagException if a announcements flag with the primary key could not be found
154            */
155            public AnnouncementsFlag[] findByEntryId_PrevAndNext(long flagId,
156                    long entryId,
157                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator)
158                    throws com.liferay.portlet.announcements.exception.NoSuchFlagException;
159    
160            /**
161            * Removes all the announcements flags where entryId = &#63; from the database.
162            *
163            * @param entryId the entry ID
164            */
165            public void removeByEntryId(long entryId);
166    
167            /**
168            * Returns the number of announcements flags where entryId = &#63;.
169            *
170            * @param entryId the entry ID
171            * @return the number of matching announcements flags
172            */
173            public int countByEntryId(long entryId);
174    
175            /**
176            * Returns the announcements flag where userId = &#63; and entryId = &#63; and value = &#63; or throws a {@link NoSuchFlagException} if it could not be found.
177            *
178            * @param userId the user ID
179            * @param entryId the entry ID
180            * @param value the value
181            * @return the matching announcements flag
182            * @throws NoSuchFlagException if a matching announcements flag could not be found
183            */
184            public AnnouncementsFlag findByU_E_V(long userId, long entryId, int value)
185                    throws com.liferay.portlet.announcements.exception.NoSuchFlagException;
186    
187            /**
188            * 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.
189            *
190            * @param userId the user ID
191            * @param entryId the entry ID
192            * @param value the value
193            * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
194            */
195            public AnnouncementsFlag fetchByU_E_V(long userId, long entryId, int value);
196    
197            /**
198            * 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.
199            *
200            * @param userId the user ID
201            * @param entryId the entry ID
202            * @param value the value
203            * @param retrieveFromCache whether to retrieve from the finder cache
204            * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
205            */
206            public AnnouncementsFlag fetchByU_E_V(long userId, long entryId, int value,
207                    boolean retrieveFromCache);
208    
209            /**
210            * Removes the announcements flag where userId = &#63; and entryId = &#63; and value = &#63; from the database.
211            *
212            * @param userId the user ID
213            * @param entryId the entry ID
214            * @param value the value
215            * @return the announcements flag that was removed
216            */
217            public AnnouncementsFlag removeByU_E_V(long userId, long entryId, int value)
218                    throws com.liferay.portlet.announcements.exception.NoSuchFlagException;
219    
220            /**
221            * Returns the number of announcements flags where userId = &#63; and entryId = &#63; and value = &#63;.
222            *
223            * @param userId the user ID
224            * @param entryId the entry ID
225            * @param value the value
226            * @return the number of matching announcements flags
227            */
228            public int countByU_E_V(long userId, long entryId, int value);
229    
230            /**
231            * Caches the announcements flag in the entity cache if it is enabled.
232            *
233            * @param announcementsFlag the announcements flag
234            */
235            public void cacheResult(AnnouncementsFlag announcementsFlag);
236    
237            /**
238            * Caches the announcements flags in the entity cache if it is enabled.
239            *
240            * @param announcementsFlags the announcements flags
241            */
242            public void cacheResult(
243                    java.util.List<AnnouncementsFlag> announcementsFlags);
244    
245            /**
246            * Creates a new announcements flag with the primary key. Does not add the announcements flag to the database.
247            *
248            * @param flagId the primary key for the new announcements flag
249            * @return the new announcements flag
250            */
251            public AnnouncementsFlag create(long flagId);
252    
253            /**
254            * Removes the announcements flag with the primary key from the database. Also notifies the appropriate model listeners.
255            *
256            * @param flagId the primary key of the announcements flag
257            * @return the announcements flag that was removed
258            * @throws NoSuchFlagException if a announcements flag with the primary key could not be found
259            */
260            public AnnouncementsFlag remove(long flagId)
261                    throws com.liferay.portlet.announcements.exception.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 com.liferay.portlet.announcements.exception.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    }