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