001    /**
002     * Copyright (c) 2000-2013 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 com.liferay.portal.service.persistence.BasePersistence;
018    
019    import com.liferay.portlet.announcements.model.AnnouncementsFlag;
020    
021    /**
022     * The persistence interface for the announcements flag 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 AnnouncementsFlagPersistenceImpl
030     * @see AnnouncementsFlagUtil
031     * @generated
032     */
033    public interface AnnouncementsFlagPersistence extends BasePersistence<AnnouncementsFlag> {
034            /*
035             * NOTE FOR DEVELOPERS:
036             *
037             * 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.
038             */
039    
040            /**
041            * Returns all the announcements flags where entryId = &#63;.
042            *
043            * @param entryId the entry ID
044            * @return the matching announcements flags
045            * @throws SystemException if a system exception occurred
046            */
047            public java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId(
048                    long entryId)
049                    throws com.liferay.portal.kernel.exception.SystemException;
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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.announcements.model.impl.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            * @throws SystemException if a system exception occurred
063            */
064            public java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId(
065                    long entryId, int start, int end)
066                    throws com.liferay.portal.kernel.exception.SystemException;
067    
068            /**
069            * Returns an ordered range of all the announcements flags where entryId = &#63;.
070            *
071            * <p>
072            * 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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.announcements.model.impl.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.
073            * </p>
074            *
075            * @param entryId the entry ID
076            * @param start the lower bound of the range of announcements flags
077            * @param end the upper bound of the range of announcements flags (not inclusive)
078            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
079            * @return the ordered range of matching announcements flags
080            * @throws SystemException if a system exception occurred
081            */
082            public java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId(
083                    long entryId, int start, int end,
084                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
085                    throws com.liferay.portal.kernel.exception.SystemException;
086    
087            /**
088            * Returns the first announcements flag in the ordered set where entryId = &#63;.
089            *
090            * @param entryId the entry ID
091            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
092            * @return the first matching announcements flag
093            * @throws com.liferay.portlet.announcements.NoSuchFlagException if a matching announcements flag could not be found
094            * @throws SystemException if a system exception occurred
095            */
096            public com.liferay.portlet.announcements.model.AnnouncementsFlag findByEntryId_First(
097                    long entryId,
098                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
099                    throws com.liferay.portal.kernel.exception.SystemException,
100                            com.liferay.portlet.announcements.NoSuchFlagException;
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, or <code>null</code> if a matching announcements flag could not be found
108            * @throws SystemException if a system exception occurred
109            */
110            public com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByEntryId_First(
111                    long entryId,
112                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
113                    throws com.liferay.portal.kernel.exception.SystemException;
114    
115            /**
116            * Returns the last 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 last matching announcements flag
121            * @throws com.liferay.portlet.announcements.NoSuchFlagException if a matching announcements flag could not be found
122            * @throws SystemException if a system exception occurred
123            */
124            public com.liferay.portlet.announcements.model.AnnouncementsFlag findByEntryId_Last(
125                    long entryId,
126                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
127                    throws com.liferay.portal.kernel.exception.SystemException,
128                            com.liferay.portlet.announcements.NoSuchFlagException;
129    
130            /**
131            * Returns the last announcements flag in the ordered set where entryId = &#63;.
132            *
133            * @param entryId the entry ID
134            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
135            * @return the last matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
136            * @throws SystemException if a system exception occurred
137            */
138            public com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByEntryId_Last(
139                    long entryId,
140                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
141                    throws com.liferay.portal.kernel.exception.SystemException;
142    
143            /**
144            * Returns the announcements flags before and after the current announcements flag in the ordered set where entryId = &#63;.
145            *
146            * @param flagId the primary key of the current announcements flag
147            * @param entryId the entry ID
148            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
149            * @return the previous, current, and next announcements flag
150            * @throws com.liferay.portlet.announcements.NoSuchFlagException if a announcements flag with the primary key could not be found
151            * @throws SystemException if a system exception occurred
152            */
153            public com.liferay.portlet.announcements.model.AnnouncementsFlag[] findByEntryId_PrevAndNext(
154                    long flagId, long entryId,
155                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
156                    throws com.liferay.portal.kernel.exception.SystemException,
157                            com.liferay.portlet.announcements.NoSuchFlagException;
158    
159            /**
160            * Removes all the announcements flags where entryId = &#63; from the database.
161            *
162            * @param entryId the entry ID
163            * @throws SystemException if a system exception occurred
164            */
165            public void removeByEntryId(long entryId)
166                    throws com.liferay.portal.kernel.exception.SystemException;
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            * @throws SystemException if a system exception occurred
174            */
175            public int countByEntryId(long entryId)
176                    throws com.liferay.portal.kernel.exception.SystemException;
177    
178            /**
179            * Returns the announcements flag where userId = &#63; and entryId = &#63; and value = &#63; or throws a {@link com.liferay.portlet.announcements.NoSuchFlagException} if it could not be found.
180            *
181            * @param userId the user ID
182            * @param entryId the entry ID
183            * @param value the value
184            * @return the matching announcements flag
185            * @throws com.liferay.portlet.announcements.NoSuchFlagException if a matching announcements flag could not be found
186            * @throws SystemException if a system exception occurred
187            */
188            public com.liferay.portlet.announcements.model.AnnouncementsFlag findByU_E_V(
189                    long userId, long entryId, int value)
190                    throws com.liferay.portal.kernel.exception.SystemException,
191                            com.liferay.portlet.announcements.NoSuchFlagException;
192    
193            /**
194            * 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.
195            *
196            * @param userId the user ID
197            * @param entryId the entry ID
198            * @param value the value
199            * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
200            * @throws SystemException if a system exception occurred
201            */
202            public com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByU_E_V(
203                    long userId, long entryId, int value)
204                    throws com.liferay.portal.kernel.exception.SystemException;
205    
206            /**
207            * 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.
208            *
209            * @param userId the user ID
210            * @param entryId the entry ID
211            * @param value the value
212            * @param retrieveFromCache whether to use the finder cache
213            * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found
214            * @throws SystemException if a system exception occurred
215            */
216            public com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByU_E_V(
217                    long userId, long entryId, int value, boolean retrieveFromCache)
218                    throws com.liferay.portal.kernel.exception.SystemException;
219    
220            /**
221            * Removes the announcements flag where userId = &#63; and entryId = &#63; and value = &#63; from the database.
222            *
223            * @param userId the user ID
224            * @param entryId the entry ID
225            * @param value the value
226            * @return the announcements flag that was removed
227            * @throws SystemException if a system exception occurred
228            */
229            public com.liferay.portlet.announcements.model.AnnouncementsFlag removeByU_E_V(
230                    long userId, long entryId, int value)
231                    throws com.liferay.portal.kernel.exception.SystemException,
232                            com.liferay.portlet.announcements.NoSuchFlagException;
233    
234            /**
235            * Returns the number of announcements flags where userId = &#63; and entryId = &#63; and value = &#63;.
236            *
237            * @param userId the user ID
238            * @param entryId the entry ID
239            * @param value the value
240            * @return the number of matching announcements flags
241            * @throws SystemException if a system exception occurred
242            */
243            public int countByU_E_V(long userId, long entryId, int value)
244                    throws com.liferay.portal.kernel.exception.SystemException;
245    
246            /**
247            * Caches the announcements flag in the entity cache if it is enabled.
248            *
249            * @param announcementsFlag the announcements flag
250            */
251            public void cacheResult(
252                    com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag);
253    
254            /**
255            * Caches the announcements flags in the entity cache if it is enabled.
256            *
257            * @param announcementsFlags the announcements flags
258            */
259            public void cacheResult(
260                    java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> announcementsFlags);
261    
262            /**
263            * Creates a new announcements flag with the primary key. Does not add the announcements flag to the database.
264            *
265            * @param flagId the primary key for the new announcements flag
266            * @return the new announcements flag
267            */
268            public com.liferay.portlet.announcements.model.AnnouncementsFlag create(
269                    long flagId);
270    
271            /**
272            * Removes the announcements flag with the primary key from the database. Also notifies the appropriate model listeners.
273            *
274            * @param flagId the primary key of the announcements flag
275            * @return the announcements flag that was removed
276            * @throws com.liferay.portlet.announcements.NoSuchFlagException if a announcements flag with the primary key could not be found
277            * @throws SystemException if a system exception occurred
278            */
279            public com.liferay.portlet.announcements.model.AnnouncementsFlag remove(
280                    long flagId)
281                    throws com.liferay.portal.kernel.exception.SystemException,
282                            com.liferay.portlet.announcements.NoSuchFlagException;
283    
284            public com.liferay.portlet.announcements.model.AnnouncementsFlag updateImpl(
285                    com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag)
286                    throws com.liferay.portal.kernel.exception.SystemException;
287    
288            /**
289            * Returns the announcements flag with the primary key or throws a {@link com.liferay.portlet.announcements.NoSuchFlagException} if it could not be found.
290            *
291            * @param flagId the primary key of the announcements flag
292            * @return the announcements flag
293            * @throws com.liferay.portlet.announcements.NoSuchFlagException if a announcements flag with the primary key could not be found
294            * @throws SystemException if a system exception occurred
295            */
296            public com.liferay.portlet.announcements.model.AnnouncementsFlag findByPrimaryKey(
297                    long flagId)
298                    throws com.liferay.portal.kernel.exception.SystemException,
299                            com.liferay.portlet.announcements.NoSuchFlagException;
300    
301            /**
302            * Returns the announcements flag with the primary key or returns <code>null</code> if it could not be found.
303            *
304            * @param flagId the primary key of the announcements flag
305            * @return the announcements flag, or <code>null</code> if a announcements flag with the primary key could not be found
306            * @throws SystemException if a system exception occurred
307            */
308            public com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByPrimaryKey(
309                    long flagId) throws com.liferay.portal.kernel.exception.SystemException;
310    
311            /**
312            * Returns all the announcements flags.
313            *
314            * @return the announcements flags
315            * @throws SystemException if a system exception occurred
316            */
317            public java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll()
318                    throws com.liferay.portal.kernel.exception.SystemException;
319    
320            /**
321            * Returns a range of all the announcements flags.
322            *
323            * <p>
324            * 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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.announcements.model.impl.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.
325            * </p>
326            *
327            * @param start the lower bound of the range of announcements flags
328            * @param end the upper bound of the range of announcements flags (not inclusive)
329            * @return the range of announcements flags
330            * @throws SystemException if a system exception occurred
331            */
332            public java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll(
333                    int start, int end)
334                    throws com.liferay.portal.kernel.exception.SystemException;
335    
336            /**
337            * Returns an ordered range of all the announcements flags.
338            *
339            * <p>
340            * 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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.announcements.model.impl.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.
341            * </p>
342            *
343            * @param start the lower bound of the range of announcements flags
344            * @param end the upper bound of the range of announcements flags (not inclusive)
345            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
346            * @return the ordered range of announcements flags
347            * @throws SystemException if a system exception occurred
348            */
349            public java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll(
350                    int start, int end,
351                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
352                    throws com.liferay.portal.kernel.exception.SystemException;
353    
354            /**
355            * Removes all the announcements flags from the database.
356            *
357            * @throws SystemException if a system exception occurred
358            */
359            public void removeAll()
360                    throws com.liferay.portal.kernel.exception.SystemException;
361    
362            /**
363            * Returns the number of announcements flags.
364            *
365            * @return the number of announcements flags
366            * @throws SystemException if a system exception occurred
367            */
368            public int countAll()
369                    throws com.liferay.portal.kernel.exception.SystemException;
370    }