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