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