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