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