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.messageboards.service.persistence;
016    
017    import com.liferay.portal.service.persistence.BasePersistence;
018    
019    import com.liferay.portlet.messageboards.model.MBDiscussion;
020    
021    /**
022     * The persistence interface for the message boards discussion service.
023     *
024     * <p>
025     * Never modify or reference this interface directly. Always use {@link MBDiscussionUtil} to access the message boards discussion 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 MBDiscussionPersistenceImpl
034     * @see MBDiscussionUtil
035     * @generated
036     */
037    public interface MBDiscussionPersistence extends BasePersistence<MBDiscussion> {
038            /**
039            * Caches the message boards discussion in the entity cache if it is enabled.
040            *
041            * @param mbDiscussion the message boards discussion to cache
042            */
043            public void cacheResult(
044                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion);
045    
046            /**
047            * Caches the message boards discussions in the entity cache if it is enabled.
048            *
049            * @param mbDiscussions the message boards discussions to cache
050            */
051            public void cacheResult(
052                    java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> mbDiscussions);
053    
054            /**
055            * Creates a new message boards discussion with the primary key. Does not add the message boards discussion to the database.
056            *
057            * @param discussionId the primary key for the new message boards discussion
058            * @return the new message boards discussion
059            */
060            public com.liferay.portlet.messageboards.model.MBDiscussion create(
061                    long discussionId);
062    
063            /**
064            * Removes the message boards discussion with the primary key from the database. Also notifies the appropriate model listeners.
065            *
066            * @param discussionId the primary key of the message boards discussion to remove
067            * @return the message boards discussion that was removed
068            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
069            * @throws SystemException if a system exception occurred
070            */
071            public com.liferay.portlet.messageboards.model.MBDiscussion remove(
072                    long discussionId)
073                    throws com.liferay.portal.kernel.exception.SystemException,
074                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
075    
076            public com.liferay.portlet.messageboards.model.MBDiscussion updateImpl(
077                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion,
078                    boolean merge)
079                    throws com.liferay.portal.kernel.exception.SystemException;
080    
081            /**
082            * Finds the message boards discussion with the primary key or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found.
083            *
084            * @param discussionId the primary key of the message boards discussion to find
085            * @return the message boards discussion
086            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
087            * @throws SystemException if a system exception occurred
088            */
089            public com.liferay.portlet.messageboards.model.MBDiscussion findByPrimaryKey(
090                    long discussionId)
091                    throws com.liferay.portal.kernel.exception.SystemException,
092                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
093    
094            /**
095            * Finds the message boards discussion with the primary key or returns <code>null</code> if it could not be found.
096            *
097            * @param discussionId the primary key of the message boards discussion to find
098            * @return the message boards discussion, or <code>null</code> if a message boards discussion with the primary key could not be found
099            * @throws SystemException if a system exception occurred
100            */
101            public com.liferay.portlet.messageboards.model.MBDiscussion fetchByPrimaryKey(
102                    long discussionId)
103                    throws com.liferay.portal.kernel.exception.SystemException;
104    
105            /**
106            * Finds all the message boards discussions where classNameId = &#63;.
107            *
108            * @param classNameId the class name id to search with
109            * @return the matching message boards discussions
110            * @throws SystemException if a system exception occurred
111            */
112            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
113                    long classNameId)
114                    throws com.liferay.portal.kernel.exception.SystemException;
115    
116            /**
117            * Finds a range of all the message boards discussions where classNameId = &#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 classNameId the class name id to search with
124            * @param start the lower bound of the range of message boards discussions to return
125            * @param end the upper bound of the range of message boards discussions to return (not inclusive)
126            * @return the range of matching message boards discussions
127            * @throws SystemException if a system exception occurred
128            */
129            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
130                    long classNameId, int start, int end)
131                    throws com.liferay.portal.kernel.exception.SystemException;
132    
133            /**
134            * Finds an ordered range of all the message boards discussions where classNameId = &#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 classNameId the class name id to search with
141            * @param start the lower bound of the range of message boards discussions to return
142            * @param end the upper bound of the range of message boards discussions to return (not inclusive)
143            * @param orderByComparator the comparator to order the results by
144            * @return the ordered range of matching message boards discussions
145            * @throws SystemException if a system exception occurred
146            */
147            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
148                    long classNameId, int start, int end,
149                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
150                    throws com.liferay.portal.kernel.exception.SystemException;
151    
152            /**
153            * Finds the first message boards discussion in the ordered set where classNameId = &#63;.
154            *
155            * <p>
156            * 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.
157            * </p>
158            *
159            * @param classNameId the class name id to search with
160            * @param orderByComparator the comparator to order the set by
161            * @return the first matching message boards discussion
162            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
163            * @throws SystemException if a system exception occurred
164            */
165            public com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
166                    long classNameId,
167                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
168                    throws com.liferay.portal.kernel.exception.SystemException,
169                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
170    
171            /**
172            * Finds the last message boards discussion in the ordered set where classNameId = &#63;.
173            *
174            * <p>
175            * 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.
176            * </p>
177            *
178            * @param classNameId the class name id to search with
179            * @param orderByComparator the comparator to order the set by
180            * @return the last matching message boards discussion
181            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
182            * @throws SystemException if a system exception occurred
183            */
184            public com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
185                    long classNameId,
186                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
187                    throws com.liferay.portal.kernel.exception.SystemException,
188                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
189    
190            /**
191            * Finds the message boards discussions before and after the current message boards discussion in the ordered set where classNameId = &#63;.
192            *
193            * <p>
194            * 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.
195            * </p>
196            *
197            * @param discussionId the primary key of the current message boards discussion
198            * @param classNameId the class name id to search with
199            * @param orderByComparator the comparator to order the set by
200            * @return the previous, current, and next message boards discussion
201            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
202            * @throws SystemException if a system exception occurred
203            */
204            public com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
205                    long discussionId, long classNameId,
206                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
207                    throws com.liferay.portal.kernel.exception.SystemException,
208                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
209    
210            /**
211            * Finds the message boards discussion where threadId = &#63; or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found.
212            *
213            * @param threadId the thread id to search with
214            * @return the matching message boards discussion
215            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
216            * @throws SystemException if a system exception occurred
217            */
218            public com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId(
219                    long threadId)
220                    throws com.liferay.portal.kernel.exception.SystemException,
221                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
222    
223            /**
224            * Finds the message boards discussion where threadId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
225            *
226            * @param threadId the thread id to search with
227            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
228            * @throws SystemException if a system exception occurred
229            */
230            public com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
231                    long threadId)
232                    throws com.liferay.portal.kernel.exception.SystemException;
233    
234            /**
235            * Finds the message boards discussion where threadId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
236            *
237            * @param threadId the thread id to search with
238            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
239            * @throws SystemException if a system exception occurred
240            */
241            public com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
242                    long threadId, boolean retrieveFromCache)
243                    throws com.liferay.portal.kernel.exception.SystemException;
244    
245            /**
246            * Finds the message boards discussion where classNameId = &#63; and classPK = &#63; or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found.
247            *
248            * @param classNameId the class name id to search with
249            * @param classPK the class p k to search with
250            * @return the matching message boards discussion
251            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
252            * @throws SystemException if a system exception occurred
253            */
254            public com.liferay.portlet.messageboards.model.MBDiscussion findByC_C(
255                    long classNameId, long classPK)
256                    throws com.liferay.portal.kernel.exception.SystemException,
257                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
258    
259            /**
260            * Finds the message boards discussion where classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
261            *
262            * @param classNameId the class name id to search with
263            * @param classPK the class p k to search with
264            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
265            * @throws SystemException if a system exception occurred
266            */
267            public com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
268                    long classNameId, long classPK)
269                    throws com.liferay.portal.kernel.exception.SystemException;
270    
271            /**
272            * Finds the message boards discussion where classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
273            *
274            * @param classNameId the class name id to search with
275            * @param classPK the class p k to search with
276            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
277            * @throws SystemException if a system exception occurred
278            */
279            public com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
280                    long classNameId, long classPK, boolean retrieveFromCache)
281                    throws com.liferay.portal.kernel.exception.SystemException;
282    
283            /**
284            * Finds all the message boards discussions.
285            *
286            * @return the message boards discussions
287            * @throws SystemException if a system exception occurred
288            */
289            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
290                    throws com.liferay.portal.kernel.exception.SystemException;
291    
292            /**
293            * Finds a range of all the message boards discussions.
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 message boards discussions to return
300            * @param end the upper bound of the range of message boards discussions to return (not inclusive)
301            * @return the range of message boards discussions
302            * @throws SystemException if a system exception occurred
303            */
304            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
305                    int start, int end)
306                    throws com.liferay.portal.kernel.exception.SystemException;
307    
308            /**
309            * Finds an ordered range of all the message boards discussions.
310            *
311            * <p>
312            * 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.
313            * </p>
314            *
315            * @param start the lower bound of the range of message boards discussions to return
316            * @param end the upper bound of the range of message boards discussions to return (not inclusive)
317            * @param orderByComparator the comparator to order the results by
318            * @return the ordered range of message boards discussions
319            * @throws SystemException if a system exception occurred
320            */
321            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
322                    int start, int end,
323                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
324                    throws com.liferay.portal.kernel.exception.SystemException;
325    
326            /**
327            * Removes all the message boards discussions where classNameId = &#63; from the database.
328            *
329            * @param classNameId the class name id to search with
330            * @throws SystemException if a system exception occurred
331            */
332            public void removeByClassNameId(long classNameId)
333                    throws com.liferay.portal.kernel.exception.SystemException;
334    
335            /**
336            * Removes the message boards discussion where threadId = &#63; from the database.
337            *
338            * @param threadId the thread id to search with
339            * @throws SystemException if a system exception occurred
340            */
341            public void removeByThreadId(long threadId)
342                    throws com.liferay.portal.kernel.exception.SystemException,
343                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
344    
345            /**
346            * Removes the message boards discussion where classNameId = &#63; and classPK = &#63; from the database.
347            *
348            * @param classNameId the class name id to search with
349            * @param classPK the class p k to search with
350            * @throws SystemException if a system exception occurred
351            */
352            public void removeByC_C(long classNameId, long classPK)
353                    throws com.liferay.portal.kernel.exception.SystemException,
354                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
355    
356            /**
357            * Removes all the message boards discussions from the database.
358            *
359            * @throws SystemException if a system exception occurred
360            */
361            public void removeAll()
362                    throws com.liferay.portal.kernel.exception.SystemException;
363    
364            /**
365            * Counts all the message boards discussions where classNameId = &#63;.
366            *
367            * @param classNameId the class name id to search with
368            * @return the number of matching message boards discussions
369            * @throws SystemException if a system exception occurred
370            */
371            public int countByClassNameId(long classNameId)
372                    throws com.liferay.portal.kernel.exception.SystemException;
373    
374            /**
375            * Counts all the message boards discussions where threadId = &#63;.
376            *
377            * @param threadId the thread id to search with
378            * @return the number of matching message boards discussions
379            * @throws SystemException if a system exception occurred
380            */
381            public int countByThreadId(long threadId)
382                    throws com.liferay.portal.kernel.exception.SystemException;
383    
384            /**
385            * Counts all the message boards discussions where classNameId = &#63; and classPK = &#63;.
386            *
387            * @param classNameId the class name id to search with
388            * @param classPK the class p k to search with
389            * @return the number of matching message boards discussions
390            * @throws SystemException if a system exception occurred
391            */
392            public int countByC_C(long classNameId, long classPK)
393                    throws com.liferay.portal.kernel.exception.SystemException;
394    
395            /**
396            * Counts all the message boards discussions.
397            *
398            * @return the number of message boards discussions
399            * @throws SystemException if a system exception occurred
400            */
401            public int countAll()
402                    throws com.liferay.portal.kernel.exception.SystemException;
403    }