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="MBDiscussionUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class MBDiscussionUtil {
32      public static com.liferay.portlet.messageboards.model.MBDiscussion create(
33          long discussionId) {
34          return getPersistence().create(discussionId);
35      }
36  
37      public static com.liferay.portlet.messageboards.model.MBDiscussion remove(
38          long discussionId)
39          throws com.liferay.portal.SystemException,
40              com.liferay.portlet.messageboards.NoSuchDiscussionException {
41          return getPersistence().remove(discussionId);
42      }
43  
44      public static com.liferay.portlet.messageboards.model.MBDiscussion remove(
45          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(mbDiscussion);
48      }
49  
50      /**
51       * @deprecated Use <code>update(MBDiscussion mbDiscussion, boolean merge)</code>.
52       */
53      public static com.liferay.portlet.messageboards.model.MBDiscussion update(
54          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(mbDiscussion);
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        mbDiscussion 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 mbDiscussion 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.MBDiscussion update(
73          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion,
74          boolean merge) throws com.liferay.portal.SystemException {
75          return getPersistence().update(mbDiscussion, merge);
76      }
77  
78      public static com.liferay.portlet.messageboards.model.MBDiscussion updateImpl(
79          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion,
80          boolean merge) throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(mbDiscussion, merge);
82      }
83  
84      public static com.liferay.portlet.messageboards.model.MBDiscussion findByPrimaryKey(
85          long discussionId)
86          throws com.liferay.portal.SystemException,
87              com.liferay.portlet.messageboards.NoSuchDiscussionException {
88          return getPersistence().findByPrimaryKey(discussionId);
89      }
90  
91      public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByPrimaryKey(
92          long discussionId) throws com.liferay.portal.SystemException {
93          return getPersistence().fetchByPrimaryKey(discussionId);
94      }
95  
96      public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
97          long classNameId) throws com.liferay.portal.SystemException {
98          return getPersistence().findByClassNameId(classNameId);
99      }
100 
101     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
102         long classNameId, int start, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByClassNameId(classNameId, start, end);
105     }
106 
107     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
108         long classNameId, int start, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByClassNameId(classNameId, start, end, obc);
112     }
113 
114     public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
115         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
116         throws com.liferay.portal.SystemException,
117             com.liferay.portlet.messageboards.NoSuchDiscussionException {
118         return getPersistence().findByClassNameId_First(classNameId, obc);
119     }
120 
121     public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
122         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
123         throws com.liferay.portal.SystemException,
124             com.liferay.portlet.messageboards.NoSuchDiscussionException {
125         return getPersistence().findByClassNameId_Last(classNameId, obc);
126     }
127 
128     public static com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
129         long discussionId, long classNameId,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException,
132             com.liferay.portlet.messageboards.NoSuchDiscussionException {
133         return getPersistence()
134                    .findByClassNameId_PrevAndNext(discussionId, classNameId, obc);
135     }
136 
137     public static com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId(
138         long threadId)
139         throws com.liferay.portal.SystemException,
140             com.liferay.portlet.messageboards.NoSuchDiscussionException {
141         return getPersistence().findByThreadId(threadId);
142     }
143 
144     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
145         long threadId) throws com.liferay.portal.SystemException {
146         return getPersistence().fetchByThreadId(threadId);
147     }
148 
149     public static com.liferay.portlet.messageboards.model.MBDiscussion findByC_C(
150         long classNameId, long classPK)
151         throws com.liferay.portal.SystemException,
152             com.liferay.portlet.messageboards.NoSuchDiscussionException {
153         return getPersistence().findByC_C(classNameId, classPK);
154     }
155 
156     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
157         long classNameId, long classPK)
158         throws com.liferay.portal.SystemException {
159         return getPersistence().fetchByC_C(classNameId, classPK);
160     }
161 
162     public static java.util.List<Object> findWithDynamicQuery(
163         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
164         throws com.liferay.portal.SystemException {
165         return getPersistence().findWithDynamicQuery(dynamicQuery);
166     }
167 
168     public static java.util.List<Object> findWithDynamicQuery(
169         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
170         int end) throws com.liferay.portal.SystemException {
171         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
172     }
173 
174     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
175         throws com.liferay.portal.SystemException {
176         return getPersistence().findAll();
177     }
178 
179     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
180         int start, int end) throws com.liferay.portal.SystemException {
181         return getPersistence().findAll(start, end);
182     }
183 
184     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
185         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
186         throws com.liferay.portal.SystemException {
187         return getPersistence().findAll(start, end, obc);
188     }
189 
190     public static void removeByClassNameId(long classNameId)
191         throws com.liferay.portal.SystemException {
192         getPersistence().removeByClassNameId(classNameId);
193     }
194 
195     public static void removeByThreadId(long threadId)
196         throws com.liferay.portal.SystemException,
197             com.liferay.portlet.messageboards.NoSuchDiscussionException {
198         getPersistence().removeByThreadId(threadId);
199     }
200 
201     public static void removeByC_C(long classNameId, long classPK)
202         throws com.liferay.portal.SystemException,
203             com.liferay.portlet.messageboards.NoSuchDiscussionException {
204         getPersistence().removeByC_C(classNameId, classPK);
205     }
206 
207     public static void removeAll() throws com.liferay.portal.SystemException {
208         getPersistence().removeAll();
209     }
210 
211     public static int countByClassNameId(long classNameId)
212         throws com.liferay.portal.SystemException {
213         return getPersistence().countByClassNameId(classNameId);
214     }
215 
216     public static int countByThreadId(long threadId)
217         throws com.liferay.portal.SystemException {
218         return getPersistence().countByThreadId(threadId);
219     }
220 
221     public static int countByC_C(long classNameId, long classPK)
222         throws com.liferay.portal.SystemException {
223         return getPersistence().countByC_C(classNameId, classPK);
224     }
225 
226     public static int countAll() throws com.liferay.portal.SystemException {
227         return getPersistence().countAll();
228     }
229 
230     public static MBDiscussionPersistence getPersistence() {
231         return _persistence;
232     }
233 
234     public void setPersistence(MBDiscussionPersistence persistence) {
235         _persistence = persistence;
236     }
237 
238     private static MBDiscussionPersistence _persistence;
239 }