001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.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                    boolean merge)
081                    throws com.liferay.portal.kernel.exception.SystemException;
082    
083            /**
084            * Returns the message boards discussion with the primary key or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found.
085            *
086            * @param discussionId the primary key of the message boards discussion
087            * @return the message boards discussion
088            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
089            * @throws SystemException if a system exception occurred
090            */
091            public com.liferay.portlet.messageboards.model.MBDiscussion findByPrimaryKey(
092                    long discussionId)
093                    throws com.liferay.portal.kernel.exception.SystemException,
094                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
095    
096            /**
097            * Returns the message boards discussion with the primary key or returns <code>null</code> if it could not be found.
098            *
099            * @param discussionId the primary key of the message boards discussion
100            * @return the message boards discussion, or <code>null</code> if a message boards discussion with the primary key could not be found
101            * @throws SystemException if a system exception occurred
102            */
103            public com.liferay.portlet.messageboards.model.MBDiscussion fetchByPrimaryKey(
104                    long discussionId)
105                    throws com.liferay.portal.kernel.exception.SystemException;
106    
107            /**
108            * Returns all the message boards discussions where classNameId = &#63;.
109            *
110            * @param classNameId the class name ID
111            * @return the matching message boards discussions
112            * @throws SystemException if a system exception occurred
113            */
114            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
115                    long classNameId)
116                    throws com.liferay.portal.kernel.exception.SystemException;
117    
118            /**
119            * Returns a range of all the message boards discussions where classNameId = &#63;.
120            *
121            * <p>
122            * 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.
123            * </p>
124            *
125            * @param classNameId the class name ID
126            * @param start the lower bound of the range of message boards discussions
127            * @param end the upper bound of the range of message boards discussions (not inclusive)
128            * @return the range of matching message boards discussions
129            * @throws SystemException if a system exception occurred
130            */
131            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
132                    long classNameId, int start, int end)
133                    throws com.liferay.portal.kernel.exception.SystemException;
134    
135            /**
136            * Returns an ordered range of all the message boards discussions where classNameId = &#63;.
137            *
138            * <p>
139            * 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.
140            * </p>
141            *
142            * @param classNameId the class name ID
143            * @param start the lower bound of the range of message boards discussions
144            * @param end the upper bound of the range of message boards discussions (not inclusive)
145            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
146            * @return the ordered range of matching message boards discussions
147            * @throws SystemException if a system exception occurred
148            */
149            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
150                    long classNameId, int start, int end,
151                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
152                    throws com.liferay.portal.kernel.exception.SystemException;
153    
154            /**
155            * Returns the first message boards discussion in the ordered set where classNameId = &#63;.
156            *
157            * @param classNameId the class name ID
158            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
159            * @return the first matching message boards discussion
160            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
161            * @throws SystemException if a system exception occurred
162            */
163            public com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
164                    long classNameId,
165                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
166                    throws com.liferay.portal.kernel.exception.SystemException,
167                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
168    
169            /**
170            * Returns the first message boards discussion in the ordered set where classNameId = &#63;.
171            *
172            * @param classNameId the class name ID
173            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
174            * @return the first matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public com.liferay.portlet.messageboards.model.MBDiscussion fetchByClassNameId_First(
178                    long classNameId,
179                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
180                    throws com.liferay.portal.kernel.exception.SystemException;
181    
182            /**
183            * Returns the last message boards discussion in the ordered set where classNameId = &#63;.
184            *
185            * @param classNameId the class name ID
186            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
187            * @return the last matching message boards discussion
188            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
189            * @throws SystemException if a system exception occurred
190            */
191            public com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
192                    long classNameId,
193                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
194                    throws com.liferay.portal.kernel.exception.SystemException,
195                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
196    
197            /**
198            * Returns the last message boards discussion in the ordered set where classNameId = &#63;.
199            *
200            * @param classNameId the class name ID
201            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
202            * @return the last matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
203            * @throws SystemException if a system exception occurred
204            */
205            public com.liferay.portlet.messageboards.model.MBDiscussion fetchByClassNameId_Last(
206                    long classNameId,
207                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
208                    throws com.liferay.portal.kernel.exception.SystemException;
209    
210            /**
211            * Returns the message boards discussions before and after the current message boards discussion in the ordered set where classNameId = &#63;.
212            *
213            * @param discussionId the primary key of the current message boards discussion
214            * @param classNameId the class name ID
215            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
216            * @return the previous, current, and next message boards discussion
217            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found
218            * @throws SystemException if a system exception occurred
219            */
220            public com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
221                    long discussionId, long classNameId,
222                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
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 throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found.
228            *
229            * @param threadId the thread ID
230            * @return the matching message boards discussion
231            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found
232            * @throws SystemException if a system exception occurred
233            */
234            public com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId(
235                    long threadId)
236                    throws com.liferay.portal.kernel.exception.SystemException,
237                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
238    
239            /**
240            * Returns the message boards discussion where threadId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
241            *
242            * @param threadId the thread ID
243            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
244            * @throws SystemException if a system exception occurred
245            */
246            public com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
247                    long threadId)
248                    throws com.liferay.portal.kernel.exception.SystemException;
249    
250            /**
251            * Returns the message boards discussion where threadId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
252            *
253            * @param threadId the thread ID
254            * @param retrieveFromCache whether to use the finder cache
255            * @return the matching message boards discussion, or <code>null</code> 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 fetchByThreadId(
259                    long threadId, boolean retrieveFromCache)
260                    throws com.liferay.portal.kernel.exception.SystemException;
261    
262            /**
263            * 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.
264            *
265            * @param classNameId the class name ID
266            * @param classPK the class p k
267            * @return the matching message boards discussion
268            * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException 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 findByC_C(
272                    long classNameId, long classPK)
273                    throws com.liferay.portal.kernel.exception.SystemException,
274                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
275    
276            /**
277            * 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.
278            *
279            * @param classNameId the class name ID
280            * @param classPK the class p k
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)
286                    throws com.liferay.portal.kernel.exception.SystemException;
287    
288            /**
289            * 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.
290            *
291            * @param classNameId the class name ID
292            * @param classPK the class p k
293            * @param retrieveFromCache whether to use the finder cache
294            * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found
295            * @throws SystemException if a system exception occurred
296            */
297            public com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
298                    long classNameId, long classPK, boolean retrieveFromCache)
299                    throws com.liferay.portal.kernel.exception.SystemException;
300    
301            /**
302            * Returns all the message boards discussions.
303            *
304            * @return the 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                    throws com.liferay.portal.kernel.exception.SystemException;
309    
310            /**
311            * Returns a range of all the message boards discussions.
312            *
313            * <p>
314            * 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.
315            * </p>
316            *
317            * @param start the lower bound of the range of message boards discussions
318            * @param end the upper bound of the range of message boards discussions (not inclusive)
319            * @return the range of message boards discussions
320            * @throws SystemException if a system exception occurred
321            */
322            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
323                    int start, int end)
324                    throws com.liferay.portal.kernel.exception.SystemException;
325    
326            /**
327            * Returns an ordered range of all the message boards discussions.
328            *
329            * <p>
330            * 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.
331            * </p>
332            *
333            * @param start the lower bound of the range of message boards discussions
334            * @param end the upper bound of the range of message boards discussions (not inclusive)
335            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
336            * @return the ordered range of message boards discussions
337            * @throws SystemException if a system exception occurred
338            */
339            public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
340                    int start, int end,
341                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
342                    throws com.liferay.portal.kernel.exception.SystemException;
343    
344            /**
345            * Removes all the message boards discussions where classNameId = &#63; from the database.
346            *
347            * @param classNameId the class name ID
348            * @throws SystemException if a system exception occurred
349            */
350            public void removeByClassNameId(long classNameId)
351                    throws com.liferay.portal.kernel.exception.SystemException;
352    
353            /**
354            * Removes the message boards discussion where threadId = &#63; from the database.
355            *
356            * @param threadId the thread ID
357            * @return the message boards discussion that was removed
358            * @throws SystemException if a system exception occurred
359            */
360            public com.liferay.portlet.messageboards.model.MBDiscussion removeByThreadId(
361                    long threadId)
362                    throws com.liferay.portal.kernel.exception.SystemException,
363                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
364    
365            /**
366            * Removes the message boards discussion where classNameId = &#63; and classPK = &#63; from the database.
367            *
368            * @param classNameId the class name ID
369            * @param classPK the class p k
370            * @return the message boards discussion that was removed
371            * @throws SystemException if a system exception occurred
372            */
373            public com.liferay.portlet.messageboards.model.MBDiscussion removeByC_C(
374                    long classNameId, long classPK)
375                    throws com.liferay.portal.kernel.exception.SystemException,
376                            com.liferay.portlet.messageboards.NoSuchDiscussionException;
377    
378            /**
379            * Removes all the message boards discussions from the database.
380            *
381            * @throws SystemException if a system exception occurred
382            */
383            public void removeAll()
384                    throws com.liferay.portal.kernel.exception.SystemException;
385    
386            /**
387            * Returns the number of message boards discussions where classNameId = &#63;.
388            *
389            * @param classNameId the class name ID
390            * @return the number of matching message boards discussions
391            * @throws SystemException if a system exception occurred
392            */
393            public int countByClassNameId(long classNameId)
394                    throws com.liferay.portal.kernel.exception.SystemException;
395    
396            /**
397            * Returns the number of message boards discussions where threadId = &#63;.
398            *
399            * @param threadId the thread ID
400            * @return the number of matching message boards discussions
401            * @throws SystemException if a system exception occurred
402            */
403            public int countByThreadId(long threadId)
404                    throws com.liferay.portal.kernel.exception.SystemException;
405    
406            /**
407            * Returns the number of message boards discussions where classNameId = &#63; and classPK = &#63;.
408            *
409            * @param classNameId the class name ID
410            * @param classPK the class p k
411            * @return the number of matching message boards discussions
412            * @throws SystemException if a system exception occurred
413            */
414            public int countByC_C(long classNameId, long classPK)
415                    throws com.liferay.portal.kernel.exception.SystemException;
416    
417            /**
418            * Returns the number of message boards discussions.
419            *
420            * @return the number of message boards discussions
421            * @throws SystemException if a system exception occurred
422            */
423            public int countAll()
424                    throws com.liferay.portal.kernel.exception.SystemException;
425    }