001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 to cache
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 to cache
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 to remove
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            * Finds 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 to find
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            * Finds 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 to find
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            * Finds all the message boards discussions where classNameId = &#63;.
110            *
111            * @param classNameId the class name ID to search with
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            * Finds 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 to search with
127            * @param start the lower bound of the range of message boards discussions to return
128            * @param end the upper bound of the range of message boards discussions to return (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            * Finds 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 to search with
144            * @param start the lower bound of the range of message boards discussions to return
145            * @param end the upper bound of the range of message boards discussions to return (not inclusive)
146            * @param orderByComparator the comparator to order the results by
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            * Finds 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 to search with
163            * @param orderByComparator the comparator to order the set by
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            * Finds 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 to search with
182            * @param orderByComparator the comparator to order the set by
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            * Finds 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 to search with
202            * @param orderByComparator the comparator to order the set by
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            * Finds 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 to search with
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            * Finds 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 to search with
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            * Finds 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 to search with
241            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
242            * @throws SystemException if a system exception occurred
243            */
244            public com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
245                    long threadId, boolean retrieveFromCache)
246                    throws com.liferay.portal.kernel.exception.SystemException;
247    
248            /**
249            * 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.
250            *
251            * @param classNameId the class name ID to search with
252            * @param classPK the class p k to search with
253            * @return the matching message boards discussion
254            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException 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 findByC_C(
258                    long classNameId, long classPK)
259                    throws com.liferay.portal.kernel.exception.SystemException,
260                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
261    
262            /**
263            * 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.
264            *
265            * @param classNameId the class name ID to search with
266            * @param classPK the class p k to search with
267            * @return the matching message boards discussion, or <code>null</code> 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 fetchByC_C(
271                    long classNameId, long classPK)
272                    throws com.liferay.portal.kernel.exception.SystemException;
273    
274            /**
275            * 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.
276            *
277            * @param classNameId the class name ID to search with
278            * @param classPK the class p k to search with
279            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
280            * @throws SystemException if a system exception occurred
281            */
282            public com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
283                    long classNameId, long classPK, boolean retrieveFromCache)
284                    throws com.liferay.portal.kernel.exception.SystemException;
285    
286            /**
287            * Finds all the message boards discussions.
288            *
289            * @return the message boards discussions
290            * @throws SystemException if a system exception occurred
291            */
292            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
293                    throws com.liferay.portal.kernel.exception.SystemException;
294    
295            /**
296            * Finds a range of all the message boards discussions.
297            *
298            * <p>
299            * 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.
300            * </p>
301            *
302            * @param start the lower bound of the range of message boards discussions to return
303            * @param end the upper bound of the range of message boards discussions to return (not inclusive)
304            * @return the range of message boards discussions
305            * @throws SystemException if a system exception occurred
306            */
307            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
308                    int start, int end)
309                    throws com.liferay.portal.kernel.exception.SystemException;
310    
311            /**
312            * Finds an ordered range of all the message boards discussions.
313            *
314            * <p>
315            * 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.
316            * </p>
317            *
318            * @param start the lower bound of the range of message boards discussions to return
319            * @param end the upper bound of the range of message boards discussions to return (not inclusive)
320            * @param orderByComparator the comparator to order the results by
321            * @return the ordered range of message boards discussions
322            * @throws SystemException if a system exception occurred
323            */
324            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
325                    int start, int end,
326                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
327                    throws com.liferay.portal.kernel.exception.SystemException;
328    
329            /**
330            * Removes all the message boards discussions where classNameId = &#63; from the database.
331            *
332            * @param classNameId the class name ID to search with
333            * @throws SystemException if a system exception occurred
334            */
335            public void removeByClassNameId(long classNameId)
336                    throws com.liferay.portal.kernel.exception.SystemException;
337    
338            /**
339            * Removes the message boards discussion where threadId = &#63; from the database.
340            *
341            * @param threadId the thread ID to search with
342            * @throws SystemException if a system exception occurred
343            */
344            public void removeByThreadId(long threadId)
345                    throws com.liferay.portal.kernel.exception.SystemException,
346                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
347    
348            /**
349            * Removes the message boards discussion where classNameId = &#63; and classPK = &#63; from the database.
350            *
351            * @param classNameId the class name ID to search with
352            * @param classPK the class p k to search with
353            * @throws SystemException if a system exception occurred
354            */
355            public void removeByC_C(long classNameId, long classPK)
356                    throws com.liferay.portal.kernel.exception.SystemException,
357                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
358    
359            /**
360            * Removes all the message boards discussions from the database.
361            *
362            * @throws SystemException if a system exception occurred
363            */
364            public void removeAll()
365                    throws com.liferay.portal.kernel.exception.SystemException;
366    
367            /**
368            * Counts all the message boards discussions where classNameId = &#63;.
369            *
370            * @param classNameId the class name ID to search with
371            * @return the number of matching message boards discussions
372            * @throws SystemException if a system exception occurred
373            */
374            public int countByClassNameId(long classNameId)
375                    throws com.liferay.portal.kernel.exception.SystemException;
376    
377            /**
378            * Counts all the message boards discussions where threadId = &#63;.
379            *
380            * @param threadId the thread ID to search with
381            * @return the number of matching message boards discussions
382            * @throws SystemException if a system exception occurred
383            */
384            public int countByThreadId(long threadId)
385                    throws com.liferay.portal.kernel.exception.SystemException;
386    
387            /**
388            * Counts all the message boards discussions where classNameId = &#63; and classPK = &#63;.
389            *
390            * @param classNameId the class name ID to search with
391            * @param classPK the class p k to search with
392            * @return the number of matching message boards discussions
393            * @throws SystemException if a system exception occurred
394            */
395            public int countByC_C(long classNameId, long classPK)
396                    throws com.liferay.portal.kernel.exception.SystemException;
397    
398            /**
399            * Counts all the message boards discussions.
400            *
401            * @return the number of message boards discussions
402            * @throws SystemException if a system exception occurred
403            */
404            public int countAll()
405                    throws com.liferay.portal.kernel.exception.SystemException;
406    
407            public MBDiscussion remove(MBDiscussion mbDiscussion)
408                    throws SystemException;
409    }