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 the first announcements flag in the ordered set where entryId = &#63;.
085            *
086            * @param entryId the entry ID
087            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
088            * @return the first matching announcements flag
089            * @throws NoSuchFlagException if a matching announcements flag could not be found
090            */
091            public AnnouncementsFlag findByEntryId_First(long entryId,
092                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator)
093                    throws com.liferay.portlet.announcements.NoSuchFlagException;
094    
095            /**
096            * Returns the first announcements flag in the ordered set where entryId = &#63;.
097            *
098            * @param entryId the entry ID
099            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
100            * @return the first matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
101            */
102            public AnnouncementsFlag fetchByEntryId_First(long entryId,
103                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator);
104    
105            /**
106            * Returns the last announcements flag in the ordered set where entryId = &#63;.
107            *
108            * @param entryId the entry ID
109            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
110            * @return the last matching announcements flag
111            * @throws NoSuchFlagException if a matching announcements flag could not be found
112            */
113            public AnnouncementsFlag findByEntryId_Last(long entryId,
114                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator)
115                    throws com.liferay.portlet.announcements.NoSuchFlagException;
116    
117            /**
118            * Returns the last announcements flag in the ordered set where entryId = &#63;.
119            *
120            * @param entryId the entry ID
121            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
122            * @return the last matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
123            */
124            public AnnouncementsFlag fetchByEntryId_Last(long entryId,
125                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator);
126    
127            /**
128            * Returns the announcements flags before and after the current announcements flag in the ordered set where entryId = &#63;.
129            *
130            * @param flagId the primary key of the current announcements flag
131            * @param entryId the entry ID
132            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
133            * @return the previous, current, and next announcements flag
134            * @throws NoSuchFlagException if a announcements flag with the primary key could not be found
135            */
136            public AnnouncementsFlag[] findByEntryId_PrevAndNext(long flagId,
137                    long entryId,
138                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator)
139                    throws com.liferay.portlet.announcements.NoSuchFlagException;
140    
141            /**
142            * Removes all the announcements flags where entryId = &#63; from the database.
143            *
144            * @param entryId the entry ID
145            */
146            public void removeByEntryId(long entryId);
147    
148            /**
149            * Returns the number of announcements flags where entryId = &#63;.
150            *
151            * @param entryId the entry ID
152            * @return the number of matching announcements flags
153            */
154            public int countByEntryId(long entryId);
155    
156            /**
157            * Returns the announcements flag where userId = &#63; and entryId = &#63; and value = &#63; or throws a {@link NoSuchFlagException} if it could not be found.
158            *
159            * @param userId the user ID
160            * @param entryId the entry ID
161            * @param value the value
162            * @return the matching announcements flag
163            * @throws NoSuchFlagException if a matching announcements flag could not be found
164            */
165            public AnnouncementsFlag findByU_E_V(long userId, long entryId, int value)
166                    throws com.liferay.portlet.announcements.NoSuchFlagException;
167    
168            /**
169            * 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.
170            *
171            * @param userId the user ID
172            * @param entryId the entry ID
173            * @param value the value
174            * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
175            */
176            public AnnouncementsFlag fetchByU_E_V(long userId, long entryId, int value);
177    
178            /**
179            * 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.
180            *
181            * @param userId the user ID
182            * @param entryId the entry ID
183            * @param value the value
184            * @param retrieveFromCache whether to use the finder cache
185            * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
186            */
187            public AnnouncementsFlag fetchByU_E_V(long userId, long entryId, int value,
188                    boolean retrieveFromCache);
189    
190            /**
191            * Removes the announcements flag where userId = &#63; and entryId = &#63; and value = &#63; from the database.
192            *
193            * @param userId the user ID
194            * @param entryId the entry ID
195            * @param value the value
196            * @return the announcements flag that was removed
197            */
198            public AnnouncementsFlag removeByU_E_V(long userId, long entryId, int value)
199                    throws com.liferay.portlet.announcements.NoSuchFlagException;
200    
201            /**
202            * Returns the number of announcements flags where userId = &#63; and entryId = &#63; and value = &#63;.
203            *
204            * @param userId the user ID
205            * @param entryId the entry ID
206            * @param value the value
207            * @return the number of matching announcements flags
208            */
209            public int countByU_E_V(long userId, long entryId, int value);
210    
211            /**
212            * Caches the announcements flag in the entity cache if it is enabled.
213            *
214            * @param announcementsFlag the announcements flag
215            */
216            public void cacheResult(AnnouncementsFlag announcementsFlag);
217    
218            /**
219            * Caches the announcements flags in the entity cache if it is enabled.
220            *
221            * @param announcementsFlags the announcements flags
222            */
223            public void cacheResult(
224                    java.util.List<AnnouncementsFlag> announcementsFlags);
225    
226            /**
227            * Creates a new announcements flag with the primary key. Does not add the announcements flag to the database.
228            *
229            * @param flagId the primary key for the new announcements flag
230            * @return the new announcements flag
231            */
232            public AnnouncementsFlag create(long flagId);
233    
234            /**
235            * Removes the announcements flag with the primary key from the database. Also notifies the appropriate model listeners.
236            *
237            * @param flagId the primary key of the announcements flag
238            * @return the announcements flag that was removed
239            * @throws NoSuchFlagException if a announcements flag with the primary key could not be found
240            */
241            public AnnouncementsFlag remove(long flagId)
242                    throws com.liferay.portlet.announcements.NoSuchFlagException;
243    
244            public AnnouncementsFlag updateImpl(AnnouncementsFlag announcementsFlag);
245    
246            /**
247            * Returns the announcements flag with the primary key or throws a {@link NoSuchFlagException} if it could not be found.
248            *
249            * @param flagId the primary key of the announcements flag
250            * @return the announcements flag
251            * @throws NoSuchFlagException if a announcements flag with the primary key could not be found
252            */
253            public AnnouncementsFlag findByPrimaryKey(long flagId)
254                    throws com.liferay.portlet.announcements.NoSuchFlagException;
255    
256            /**
257            * Returns the announcements flag with the primary key or returns <code>null</code> if it could not be found.
258            *
259            * @param flagId the primary key of the announcements flag
260            * @return the announcements flag, or <code>null</code> if a announcements flag with the primary key could not be found
261            */
262            public AnnouncementsFlag fetchByPrimaryKey(long flagId);
263    
264            @Override
265            public java.util.Map<java.io.Serializable, AnnouncementsFlag> fetchByPrimaryKeys(
266                    java.util.Set<java.io.Serializable> primaryKeys);
267    
268            /**
269            * Returns all the announcements flags.
270            *
271            * @return the announcements flags
272            */
273            public java.util.List<AnnouncementsFlag> findAll();
274    
275            /**
276            * Returns a range of all the announcements flags.
277            *
278            * <p>
279            * 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.
280            * </p>
281            *
282            * @param start the lower bound of the range of announcements flags
283            * @param end the upper bound of the range of announcements flags (not inclusive)
284            * @return the range of announcements flags
285            */
286            public java.util.List<AnnouncementsFlag> findAll(int start, int end);
287    
288            /**
289            * Returns an ordered range of all the announcements flags.
290            *
291            * <p>
292            * 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.
293            * </p>
294            *
295            * @param start the lower bound of the range of announcements flags
296            * @param end the upper bound of the range of announcements flags (not inclusive)
297            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
298            * @return the ordered range of announcements flags
299            */
300            public java.util.List<AnnouncementsFlag> findAll(int start, int end,
301                    com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsFlag> orderByComparator);
302    
303            /**
304            * Removes all the announcements flags from the database.
305            */
306            public void removeAll();
307    
308            /**
309            * Returns the number of announcements flags.
310            *
311            * @return the number of announcements flags
312            */
313            public int countAll();
314    }