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  /**
26   * <a href="MBMessageUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class MBMessageUtil {
32      public static com.liferay.portlet.messageboards.model.MBMessage create(
33          long messageId) {
34          return getPersistence().create(messageId);
35      }
36  
37      public static com.liferay.portlet.messageboards.model.MBMessage remove(
38          long messageId)
39          throws com.liferay.portal.SystemException,
40              com.liferay.portlet.messageboards.NoSuchMessageException {
41          return getPersistence().remove(messageId);
42      }
43  
44      public static com.liferay.portlet.messageboards.model.MBMessage remove(
45          com.liferay.portlet.messageboards.model.MBMessage mbMessage)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(mbMessage);
48      }
49  
50      /**
51       * @deprecated Use <code>update(MBMessage mbMessage, boolean merge)</code>.
52       */
53      public static com.liferay.portlet.messageboards.model.MBMessage update(
54          com.liferay.portlet.messageboards.model.MBMessage mbMessage)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(mbMessage);
57      }
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 static com.liferay.portlet.messageboards.model.MBMessage update(
73          com.liferay.portlet.messageboards.model.MBMessage mbMessage,
74          boolean merge) throws com.liferay.portal.SystemException {
75          return getPersistence().update(mbMessage, merge);
76      }
77  
78      public static com.liferay.portlet.messageboards.model.MBMessage updateImpl(
79          com.liferay.portlet.messageboards.model.MBMessage mbMessage,
80          boolean merge) throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(mbMessage, merge);
82      }
83  
84      public static com.liferay.portlet.messageboards.model.MBMessage findByPrimaryKey(
85          long messageId)
86          throws com.liferay.portal.SystemException,
87              com.liferay.portlet.messageboards.NoSuchMessageException {
88          return getPersistence().findByPrimaryKey(messageId);
89      }
90  
91      public static com.liferay.portlet.messageboards.model.MBMessage fetchByPrimaryKey(
92          long messageId) throws com.liferay.portal.SystemException {
93          return getPersistence().fetchByPrimaryKey(messageId);
94      }
95  
96      public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByUuid(
97          java.lang.String uuid) throws com.liferay.portal.SystemException {
98          return getPersistence().findByUuid(uuid);
99      }
100 
101     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByUuid(
102         java.lang.String uuid, int start, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByUuid(uuid, start, end);
105     }
106 
107     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByUuid(
108         java.lang.String uuid, int start, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByUuid(uuid, start, end, obc);
112     }
113 
114     public static com.liferay.portlet.messageboards.model.MBMessage findByUuid_First(
115         java.lang.String uuid,
116         com.liferay.portal.kernel.util.OrderByComparator obc)
117         throws com.liferay.portal.SystemException,
118             com.liferay.portlet.messageboards.NoSuchMessageException {
119         return getPersistence().findByUuid_First(uuid, obc);
120     }
121 
122     public static com.liferay.portlet.messageboards.model.MBMessage findByUuid_Last(
123         java.lang.String uuid,
124         com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.SystemException,
126             com.liferay.portlet.messageboards.NoSuchMessageException {
127         return getPersistence().findByUuid_Last(uuid, obc);
128     }
129 
130     public static com.liferay.portlet.messageboards.model.MBMessage[] findByUuid_PrevAndNext(
131         long messageId, java.lang.String uuid,
132         com.liferay.portal.kernel.util.OrderByComparator obc)
133         throws com.liferay.portal.SystemException,
134             com.liferay.portlet.messageboards.NoSuchMessageException {
135         return getPersistence().findByUuid_PrevAndNext(messageId, uuid, obc);
136     }
137 
138     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByCompanyId(
139         long companyId) throws com.liferay.portal.SystemException {
140         return getPersistence().findByCompanyId(companyId);
141     }
142 
143     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByCompanyId(
144         long companyId, int start, int end)
145         throws com.liferay.portal.SystemException {
146         return getPersistence().findByCompanyId(companyId, start, end);
147     }
148 
149     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByCompanyId(
150         long companyId, int start, int end,
151         com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.SystemException {
153         return getPersistence().findByCompanyId(companyId, start, end, obc);
154     }
155 
156     public static com.liferay.portlet.messageboards.model.MBMessage findByCompanyId_First(
157         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
158         throws com.liferay.portal.SystemException,
159             com.liferay.portlet.messageboards.NoSuchMessageException {
160         return getPersistence().findByCompanyId_First(companyId, obc);
161     }
162 
163     public static com.liferay.portlet.messageboards.model.MBMessage findByCompanyId_Last(
164         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
165         throws com.liferay.portal.SystemException,
166             com.liferay.portlet.messageboards.NoSuchMessageException {
167         return getPersistence().findByCompanyId_Last(companyId, obc);
168     }
169 
170     public static com.liferay.portlet.messageboards.model.MBMessage[] findByCompanyId_PrevAndNext(
171         long messageId, long companyId,
172         com.liferay.portal.kernel.util.OrderByComparator obc)
173         throws com.liferay.portal.SystemException,
174             com.liferay.portlet.messageboards.NoSuchMessageException {
175         return getPersistence()
176                    .findByCompanyId_PrevAndNext(messageId, companyId, obc);
177     }
178 
179     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByCategoryId(
180         long categoryId) throws com.liferay.portal.SystemException {
181         return getPersistence().findByCategoryId(categoryId);
182     }
183 
184     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByCategoryId(
185         long categoryId, int start, int end)
186         throws com.liferay.portal.SystemException {
187         return getPersistence().findByCategoryId(categoryId, start, end);
188     }
189 
190     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByCategoryId(
191         long categoryId, int start, int end,
192         com.liferay.portal.kernel.util.OrderByComparator obc)
193         throws com.liferay.portal.SystemException {
194         return getPersistence().findByCategoryId(categoryId, start, end, obc);
195     }
196 
197     public static com.liferay.portlet.messageboards.model.MBMessage findByCategoryId_First(
198         long categoryId, com.liferay.portal.kernel.util.OrderByComparator obc)
199         throws com.liferay.portal.SystemException,
200             com.liferay.portlet.messageboards.NoSuchMessageException {
201         return getPersistence().findByCategoryId_First(categoryId, obc);
202     }
203 
204     public static com.liferay.portlet.messageboards.model.MBMessage findByCategoryId_Last(
205         long categoryId, com.liferay.portal.kernel.util.OrderByComparator obc)
206         throws com.liferay.portal.SystemException,
207             com.liferay.portlet.messageboards.NoSuchMessageException {
208         return getPersistence().findByCategoryId_Last(categoryId, obc);
209     }
210 
211     public static com.liferay.portlet.messageboards.model.MBMessage[] findByCategoryId_PrevAndNext(
212         long messageId, long categoryId,
213         com.liferay.portal.kernel.util.OrderByComparator obc)
214         throws com.liferay.portal.SystemException,
215             com.liferay.portlet.messageboards.NoSuchMessageException {
216         return getPersistence()
217                    .findByCategoryId_PrevAndNext(messageId, categoryId, obc);
218     }
219 
220     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByThreadId(
221         long threadId) throws com.liferay.portal.SystemException {
222         return getPersistence().findByThreadId(threadId);
223     }
224 
225     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByThreadId(
226         long threadId, int start, int end)
227         throws com.liferay.portal.SystemException {
228         return getPersistence().findByThreadId(threadId, start, end);
229     }
230 
231     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByThreadId(
232         long threadId, int start, int end,
233         com.liferay.portal.kernel.util.OrderByComparator obc)
234         throws com.liferay.portal.SystemException {
235         return getPersistence().findByThreadId(threadId, start, end, obc);
236     }
237 
238     public static com.liferay.portlet.messageboards.model.MBMessage findByThreadId_First(
239         long threadId, com.liferay.portal.kernel.util.OrderByComparator obc)
240         throws com.liferay.portal.SystemException,
241             com.liferay.portlet.messageboards.NoSuchMessageException {
242         return getPersistence().findByThreadId_First(threadId, obc);
243     }
244 
245     public static com.liferay.portlet.messageboards.model.MBMessage findByThreadId_Last(
246         long threadId, com.liferay.portal.kernel.util.OrderByComparator obc)
247         throws com.liferay.portal.SystemException,
248             com.liferay.portlet.messageboards.NoSuchMessageException {
249         return getPersistence().findByThreadId_Last(threadId, obc);
250     }
251 
252     public static com.liferay.portlet.messageboards.model.MBMessage[] findByThreadId_PrevAndNext(
253         long messageId, long threadId,
254         com.liferay.portal.kernel.util.OrderByComparator obc)
255         throws com.liferay.portal.SystemException,
256             com.liferay.portlet.messageboards.NoSuchMessageException {
257         return getPersistence()
258                    .findByThreadId_PrevAndNext(messageId, threadId, obc);
259     }
260 
261     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByC_T(
262         long categoryId, long threadId)
263         throws com.liferay.portal.SystemException {
264         return getPersistence().findByC_T(categoryId, threadId);
265     }
266 
267     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByC_T(
268         long categoryId, long threadId, int start, int end)
269         throws com.liferay.portal.SystemException {
270         return getPersistence().findByC_T(categoryId, threadId, start, end);
271     }
272 
273     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByC_T(
274         long categoryId, long threadId, int start, int end,
275         com.liferay.portal.kernel.util.OrderByComparator obc)
276         throws com.liferay.portal.SystemException {
277         return getPersistence().findByC_T(categoryId, threadId, start, end, obc);
278     }
279 
280     public static com.liferay.portlet.messageboards.model.MBMessage findByC_T_First(
281         long categoryId, long threadId,
282         com.liferay.portal.kernel.util.OrderByComparator obc)
283         throws com.liferay.portal.SystemException,
284             com.liferay.portlet.messageboards.NoSuchMessageException {
285         return getPersistence().findByC_T_First(categoryId, threadId, obc);
286     }
287 
288     public static com.liferay.portlet.messageboards.model.MBMessage findByC_T_Last(
289         long categoryId, long threadId,
290         com.liferay.portal.kernel.util.OrderByComparator obc)
291         throws com.liferay.portal.SystemException,
292             com.liferay.portlet.messageboards.NoSuchMessageException {
293         return getPersistence().findByC_T_Last(categoryId, threadId, obc);
294     }
295 
296     public static com.liferay.portlet.messageboards.model.MBMessage[] findByC_T_PrevAndNext(
297         long messageId, long categoryId, long threadId,
298         com.liferay.portal.kernel.util.OrderByComparator obc)
299         throws com.liferay.portal.SystemException,
300             com.liferay.portlet.messageboards.NoSuchMessageException {
301         return getPersistence()
302                    .findByC_T_PrevAndNext(messageId, categoryId, threadId, obc);
303     }
304 
305     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByT_P(
306         long threadId, long parentMessageId)
307         throws com.liferay.portal.SystemException {
308         return getPersistence().findByT_P(threadId, parentMessageId);
309     }
310 
311     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByT_P(
312         long threadId, long parentMessageId, int start, int end)
313         throws com.liferay.portal.SystemException {
314         return getPersistence().findByT_P(threadId, parentMessageId, start, end);
315     }
316 
317     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findByT_P(
318         long threadId, long parentMessageId, int start, int end,
319         com.liferay.portal.kernel.util.OrderByComparator obc)
320         throws com.liferay.portal.SystemException {
321         return getPersistence()
322                    .findByT_P(threadId, parentMessageId, start, end, obc);
323     }
324 
325     public static com.liferay.portlet.messageboards.model.MBMessage findByT_P_First(
326         long threadId, long parentMessageId,
327         com.liferay.portal.kernel.util.OrderByComparator obc)
328         throws com.liferay.portal.SystemException,
329             com.liferay.portlet.messageboards.NoSuchMessageException {
330         return getPersistence().findByT_P_First(threadId, parentMessageId, obc);
331     }
332 
333     public static com.liferay.portlet.messageboards.model.MBMessage findByT_P_Last(
334         long threadId, long parentMessageId,
335         com.liferay.portal.kernel.util.OrderByComparator obc)
336         throws com.liferay.portal.SystemException,
337             com.liferay.portlet.messageboards.NoSuchMessageException {
338         return getPersistence().findByT_P_Last(threadId, parentMessageId, obc);
339     }
340 
341     public static com.liferay.portlet.messageboards.model.MBMessage[] findByT_P_PrevAndNext(
342         long messageId, long threadId, long parentMessageId,
343         com.liferay.portal.kernel.util.OrderByComparator obc)
344         throws com.liferay.portal.SystemException,
345             com.liferay.portlet.messageboards.NoSuchMessageException {
346         return getPersistence()
347                    .findByT_P_PrevAndNext(messageId, threadId, parentMessageId,
348             obc);
349     }
350 
351     public static java.util.List<Object> findWithDynamicQuery(
352         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
353         throws com.liferay.portal.SystemException {
354         return getPersistence().findWithDynamicQuery(dynamicQuery);
355     }
356 
357     public static java.util.List<Object> findWithDynamicQuery(
358         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
359         int end) throws com.liferay.portal.SystemException {
360         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
361     }
362 
363     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findAll()
364         throws com.liferay.portal.SystemException {
365         return getPersistence().findAll();
366     }
367 
368     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findAll(
369         int start, int end) throws com.liferay.portal.SystemException {
370         return getPersistence().findAll(start, end);
371     }
372 
373     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> findAll(
374         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
375         throws com.liferay.portal.SystemException {
376         return getPersistence().findAll(start, end, obc);
377     }
378 
379     public static void removeByUuid(java.lang.String uuid)
380         throws com.liferay.portal.SystemException {
381         getPersistence().removeByUuid(uuid);
382     }
383 
384     public static void removeByCompanyId(long companyId)
385         throws com.liferay.portal.SystemException {
386         getPersistence().removeByCompanyId(companyId);
387     }
388 
389     public static void removeByCategoryId(long categoryId)
390         throws com.liferay.portal.SystemException {
391         getPersistence().removeByCategoryId(categoryId);
392     }
393 
394     public static void removeByThreadId(long threadId)
395         throws com.liferay.portal.SystemException {
396         getPersistence().removeByThreadId(threadId);
397     }
398 
399     public static void removeByC_T(long categoryId, long threadId)
400         throws com.liferay.portal.SystemException {
401         getPersistence().removeByC_T(categoryId, threadId);
402     }
403 
404     public static void removeByT_P(long threadId, long parentMessageId)
405         throws com.liferay.portal.SystemException {
406         getPersistence().removeByT_P(threadId, parentMessageId);
407     }
408 
409     public static void removeAll() throws com.liferay.portal.SystemException {
410         getPersistence().removeAll();
411     }
412 
413     public static int countByUuid(java.lang.String uuid)
414         throws com.liferay.portal.SystemException {
415         return getPersistence().countByUuid(uuid);
416     }
417 
418     public static int countByCompanyId(long companyId)
419         throws com.liferay.portal.SystemException {
420         return getPersistence().countByCompanyId(companyId);
421     }
422 
423     public static int countByCategoryId(long categoryId)
424         throws com.liferay.portal.SystemException {
425         return getPersistence().countByCategoryId(categoryId);
426     }
427 
428     public static int countByThreadId(long threadId)
429         throws com.liferay.portal.SystemException {
430         return getPersistence().countByThreadId(threadId);
431     }
432 
433     public static int countByC_T(long categoryId, long threadId)
434         throws com.liferay.portal.SystemException {
435         return getPersistence().countByC_T(categoryId, threadId);
436     }
437 
438     public static int countByT_P(long threadId, long parentMessageId)
439         throws com.liferay.portal.SystemException {
440         return getPersistence().countByT_P(threadId, parentMessageId);
441     }
442 
443     public static int countAll() throws com.liferay.portal.SystemException {
444         return getPersistence().countAll();
445     }
446 
447     public static MBMessagePersistence getPersistence() {
448         return _persistence;
449     }
450 
451     public void setPersistence(MBMessagePersistence persistence) {
452         _persistence = persistence;
453     }
454 
455     private static MBMessagePersistence _persistence;
456 }