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