1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.messageboards.service.persistence;
24  
25  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.Propagation;
28  import com.liferay.portal.kernel.annotation.Transactional;
29  import com.liferay.portal.service.persistence.BasePersistence;
30  
31  /**
32   * <a href="MBMessagePersistence.java.html"><b><i>View Source</i></b></a>
33   *
34   * @author Brian Wing Shun Chan
35   *
36   */
37  @Transactional(rollbackFor =  {
38      PortalException.class, SystemException.class})
39  public interface MBMessagePersistence extends BasePersistence {
40      public com.liferay.portlet.messageboards.model.MBMessage create(
41          long messageId);
42  
43      public com.liferay.portlet.messageboards.model.MBMessage remove(
44          long messageId)
45          throws com.liferay.portal.SystemException,
46              com.liferay.portlet.messageboards.NoSuchMessageException;
47  
48      public com.liferay.portlet.messageboards.model.MBMessage remove(
49          com.liferay.portlet.messageboards.model.MBMessage mbMessage)
50          throws com.liferay.portal.SystemException;
51  
52      /**
53       * @deprecated Use <code>update(MBMessage mbMessage, boolean merge)</code>.
54       */
55      public com.liferay.portlet.messageboards.model.MBMessage update(
56          com.liferay.portlet.messageboards.model.MBMessage mbMessage)
57          throws com.liferay.portal.SystemException;
58  
59      /**
60       * Add, update, or merge, the entity. This method also calls the model
61       * listeners to trigger the proper events associated with adding, deleting,
62       * or updating an entity.
63       *
64       * @param        mbMessage the entity to add, update, or merge
65       * @param        merge boolean value for whether to merge the entity. The
66       *                default value is false. Setting merge to true is more
67       *                expensive and should only be true when mbMessage is
68       *                transient. See LEP-5473 for a detailed discussion of this
69       *                method.
70       * @return        true if the portlet can be displayed via Ajax
71       */
72      public com.liferay.portlet.messageboards.model.MBMessage update(
73          com.liferay.portlet.messageboards.model.MBMessage mbMessage,
74          boolean merge) throws com.liferay.portal.SystemException;
75  
76      public com.liferay.portlet.messageboards.model.MBMessage updateImpl(
77          com.liferay.portlet.messageboards.model.MBMessage mbMessage,
78          boolean merge) throws com.liferay.portal.SystemException;
79  
80      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
81      public com.liferay.portlet.messageboards.model.MBMessage findByPrimaryKey(
82          long messageId)
83          throws com.liferay.portal.SystemException,
84              com.liferay.portlet.messageboards.NoSuchMessageException;
85  
86      public com.liferay.portlet.messageboards.model.MBMessage fetchByPrimaryKey(
87          long messageId) throws com.liferay.portal.SystemException;
88  
89      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
90      public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByUuid(
91          java.lang.String uuid) throws com.liferay.portal.SystemException;
92  
93      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
94      public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByUuid(
95          java.lang.String uuid, int start, int end)
96          throws com.liferay.portal.SystemException;
97  
98      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
99      public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByUuid(
100         java.lang.String uuid, int start, int end,
101         com.liferay.portal.kernel.util.OrderByComparator obc)
102         throws com.liferay.portal.SystemException;
103 
104     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
105     public com.liferay.portlet.messageboards.model.MBMessage findByUuid_First(
106         java.lang.String uuid,
107         com.liferay.portal.kernel.util.OrderByComparator obc)
108         throws com.liferay.portal.SystemException,
109             com.liferay.portlet.messageboards.NoSuchMessageException;
110 
111     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
112     public com.liferay.portlet.messageboards.model.MBMessage findByUuid_Last(
113         java.lang.String uuid,
114         com.liferay.portal.kernel.util.OrderByComparator obc)
115         throws com.liferay.portal.SystemException,
116             com.liferay.portlet.messageboards.NoSuchMessageException;
117 
118     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
119     public com.liferay.portlet.messageboards.model.MBMessage[] findByUuid_PrevAndNext(
120         long messageId, java.lang.String uuid,
121         com.liferay.portal.kernel.util.OrderByComparator obc)
122         throws com.liferay.portal.SystemException,
123             com.liferay.portlet.messageboards.NoSuchMessageException;
124 
125     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
126     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByCompanyId(
127         long companyId) throws com.liferay.portal.SystemException;
128 
129     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
130     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByCompanyId(
131         long companyId, int start, int end)
132         throws com.liferay.portal.SystemException;
133 
134     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
135     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByCompanyId(
136         long companyId, int start, int end,
137         com.liferay.portal.kernel.util.OrderByComparator obc)
138         throws com.liferay.portal.SystemException;
139 
140     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
141     public com.liferay.portlet.messageboards.model.MBMessage findByCompanyId_First(
142         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
143         throws com.liferay.portal.SystemException,
144             com.liferay.portlet.messageboards.NoSuchMessageException;
145 
146     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
147     public com.liferay.portlet.messageboards.model.MBMessage findByCompanyId_Last(
148         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
149         throws com.liferay.portal.SystemException,
150             com.liferay.portlet.messageboards.NoSuchMessageException;
151 
152     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
153     public com.liferay.portlet.messageboards.model.MBMessage[] findByCompanyId_PrevAndNext(
154         long messageId, long companyId,
155         com.liferay.portal.kernel.util.OrderByComparator obc)
156         throws com.liferay.portal.SystemException,
157             com.liferay.portlet.messageboards.NoSuchMessageException;
158 
159     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
160     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByCategoryId(
161         long categoryId) throws com.liferay.portal.SystemException;
162 
163     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
164     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByCategoryId(
165         long categoryId, int start, int end)
166         throws com.liferay.portal.SystemException;
167 
168     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
169     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByCategoryId(
170         long categoryId, int start, int end,
171         com.liferay.portal.kernel.util.OrderByComparator obc)
172         throws com.liferay.portal.SystemException;
173 
174     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
175     public com.liferay.portlet.messageboards.model.MBMessage findByCategoryId_First(
176         long categoryId, com.liferay.portal.kernel.util.OrderByComparator obc)
177         throws com.liferay.portal.SystemException,
178             com.liferay.portlet.messageboards.NoSuchMessageException;
179 
180     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
181     public com.liferay.portlet.messageboards.model.MBMessage findByCategoryId_Last(
182         long categoryId, com.liferay.portal.kernel.util.OrderByComparator obc)
183         throws com.liferay.portal.SystemException,
184             com.liferay.portlet.messageboards.NoSuchMessageException;
185 
186     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
187     public com.liferay.portlet.messageboards.model.MBMessage[] findByCategoryId_PrevAndNext(
188         long messageId, long categoryId,
189         com.liferay.portal.kernel.util.OrderByComparator obc)
190         throws com.liferay.portal.SystemException,
191             com.liferay.portlet.messageboards.NoSuchMessageException;
192 
193     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
194     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByThreadId(
195         long threadId) throws com.liferay.portal.SystemException;
196 
197     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
198     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByThreadId(
199         long threadId, int start, int end)
200         throws com.liferay.portal.SystemException;
201 
202     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
203     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByThreadId(
204         long threadId, int start, int end,
205         com.liferay.portal.kernel.util.OrderByComparator obc)
206         throws com.liferay.portal.SystemException;
207 
208     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
209     public com.liferay.portlet.messageboards.model.MBMessage findByThreadId_First(
210         long threadId, com.liferay.portal.kernel.util.OrderByComparator obc)
211         throws com.liferay.portal.SystemException,
212             com.liferay.portlet.messageboards.NoSuchMessageException;
213 
214     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
215     public com.liferay.portlet.messageboards.model.MBMessage findByThreadId_Last(
216         long threadId, com.liferay.portal.kernel.util.OrderByComparator obc)
217         throws com.liferay.portal.SystemException,
218             com.liferay.portlet.messageboards.NoSuchMessageException;
219 
220     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
221     public com.liferay.portlet.messageboards.model.MBMessage[] findByThreadId_PrevAndNext(
222         long messageId, long threadId,
223         com.liferay.portal.kernel.util.OrderByComparator obc)
224         throws com.liferay.portal.SystemException,
225             com.liferay.portlet.messageboards.NoSuchMessageException;
226 
227     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
228     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByC_T(
229         long categoryId, long threadId)
230         throws com.liferay.portal.SystemException;
231 
232     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
233     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByC_T(
234         long categoryId, long threadId, int start, int end)
235         throws com.liferay.portal.SystemException;
236 
237     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByC_T(
239         long categoryId, long threadId, int start, int end,
240         com.liferay.portal.kernel.util.OrderByComparator obc)
241         throws com.liferay.portal.SystemException;
242 
243     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
244     public com.liferay.portlet.messageboards.model.MBMessage findByC_T_First(
245         long categoryId, long threadId,
246         com.liferay.portal.kernel.util.OrderByComparator obc)
247         throws com.liferay.portal.SystemException,
248             com.liferay.portlet.messageboards.NoSuchMessageException;
249 
250     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251     public com.liferay.portlet.messageboards.model.MBMessage findByC_T_Last(
252         long categoryId, long threadId,
253         com.liferay.portal.kernel.util.OrderByComparator obc)
254         throws com.liferay.portal.SystemException,
255             com.liferay.portlet.messageboards.NoSuchMessageException;
256 
257     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
258     public com.liferay.portlet.messageboards.model.MBMessage[] findByC_T_PrevAndNext(
259         long messageId, long categoryId, long threadId,
260         com.liferay.portal.kernel.util.OrderByComparator obc)
261         throws com.liferay.portal.SystemException,
262             com.liferay.portlet.messageboards.NoSuchMessageException;
263 
264     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
265     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByT_P(
266         long threadId, long parentMessageId)
267         throws com.liferay.portal.SystemException;
268 
269     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
270     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByT_P(
271         long threadId, long parentMessageId, int start, int end)
272         throws com.liferay.portal.SystemException;
273 
274     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
275     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByT_P(
276         long threadId, long parentMessageId, int start, int end,
277         com.liferay.portal.kernel.util.OrderByComparator obc)
278         throws com.liferay.portal.SystemException;
279 
280     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
281     public com.liferay.portlet.messageboards.model.MBMessage findByT_P_First(
282         long threadId, long parentMessageId,
283         com.liferay.portal.kernel.util.OrderByComparator obc)
284         throws com.liferay.portal.SystemException,
285             com.liferay.portlet.messageboards.NoSuchMessageException;
286 
287     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
288     public com.liferay.portlet.messageboards.model.MBMessage findByT_P_Last(
289         long threadId, long parentMessageId,
290         com.liferay.portal.kernel.util.OrderByComparator obc)
291         throws com.liferay.portal.SystemException,
292             com.liferay.portlet.messageboards.NoSuchMessageException;
293 
294     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
295     public com.liferay.portlet.messageboards.model.MBMessage[] findByT_P_PrevAndNext(
296         long messageId, long threadId, long parentMessageId,
297         com.liferay.portal.kernel.util.OrderByComparator obc)
298         throws com.liferay.portal.SystemException,
299             com.liferay.portlet.messageboards.NoSuchMessageException;
300 
301     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
302     public java.util.List<Object> findWithDynamicQuery(
303         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
304         throws com.liferay.portal.SystemException;
305 
306     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
307     public java.util.List<Object> findWithDynamicQuery(
308         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
309         int end) throws com.liferay.portal.SystemException;
310 
311     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
312     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findAll()
313         throws com.liferay.portal.SystemException;
314 
315     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
316     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findAll(
317         int start, int end) throws com.liferay.portal.SystemException;
318 
319     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
320     public java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findAll(
321         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
322         throws com.liferay.portal.SystemException;
323 
324     public void removeByUuid(java.lang.String uuid)
325         throws com.liferay.portal.SystemException;
326 
327     public void removeByCompanyId(long companyId)
328         throws com.liferay.portal.SystemException;
329 
330     public void removeByCategoryId(long categoryId)
331         throws com.liferay.portal.SystemException;
332 
333     public void removeByThreadId(long threadId)
334         throws com.liferay.portal.SystemException;
335 
336     public void removeByC_T(long categoryId, long threadId)
337         throws com.liferay.portal.SystemException;
338 
339     public void removeByT_P(long threadId, long parentMessageId)
340         throws com.liferay.portal.SystemException;
341 
342     public void removeAll() throws com.liferay.portal.SystemException;
343 
344     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
345     public int countByUuid(java.lang.String uuid)
346         throws com.liferay.portal.SystemException;
347 
348     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
349     public int countByCompanyId(long companyId)
350         throws com.liferay.portal.SystemException;
351 
352     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
353     public int countByCategoryId(long categoryId)
354         throws com.liferay.portal.SystemException;
355 
356     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
357     public int countByThreadId(long threadId)
358         throws com.liferay.portal.SystemException;
359 
360     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
361     public int countByC_T(long categoryId, long threadId)
362         throws com.liferay.portal.SystemException;
363 
364     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
365     public int countByT_P(long threadId, long parentMessageId)
366         throws com.liferay.portal.SystemException;
367 
368     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
369     public int countAll() throws com.liferay.portal.SystemException;
370 }