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