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