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