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 void cacheResult(
30          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion) {
31          getPersistence().cacheResult(mbDiscussion);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> mbDiscussions) {
36          getPersistence().cacheResult(mbDiscussions);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portlet.messageboards.model.MBDiscussion create(
44          long discussionId) {
45          return getPersistence().create(discussionId);
46      }
47  
48      public static com.liferay.portlet.messageboards.model.MBDiscussion remove(
49          long discussionId)
50          throws com.liferay.portal.SystemException,
51              com.liferay.portlet.messageboards.NoSuchDiscussionException {
52          return getPersistence().remove(discussionId);
53      }
54  
55      public static com.liferay.portlet.messageboards.model.MBDiscussion remove(
56          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(mbDiscussion);
59      }
60  
61      /**
62       * @deprecated Use <code>update(MBDiscussion mbDiscussion, boolean merge)</code>.
63       */
64      public static com.liferay.portlet.messageboards.model.MBDiscussion update(
65          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(mbDiscussion);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        mbDiscussion the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when mbDiscussion is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portlet.messageboards.model.MBDiscussion update(
84          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion,
85          boolean merge) throws com.liferay.portal.SystemException {
86          return getPersistence().update(mbDiscussion, merge);
87      }
88  
89      public static com.liferay.portlet.messageboards.model.MBDiscussion updateImpl(
90          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion,
91          boolean merge) throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(mbDiscussion, merge);
93      }
94  
95      public static com.liferay.portlet.messageboards.model.MBDiscussion findByPrimaryKey(
96          long discussionId)
97          throws com.liferay.portal.SystemException,
98              com.liferay.portlet.messageboards.NoSuchDiscussionException {
99          return getPersistence().findByPrimaryKey(discussionId);
100     }
101 
102     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByPrimaryKey(
103         long discussionId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(discussionId);
105     }
106 
107     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
108         long classNameId) throws com.liferay.portal.SystemException {
109         return getPersistence().findByClassNameId(classNameId);
110     }
111 
112     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
113         long classNameId, int start, int end)
114         throws com.liferay.portal.SystemException {
115         return getPersistence().findByClassNameId(classNameId, start, end);
116     }
117 
118     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
119         long classNameId, int start, int end,
120         com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().findByClassNameId(classNameId, start, end, obc);
123     }
124 
125     public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
126         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
127         throws com.liferay.portal.SystemException,
128             com.liferay.portlet.messageboards.NoSuchDiscussionException {
129         return getPersistence().findByClassNameId_First(classNameId, obc);
130     }
131 
132     public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
133         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.SystemException,
135             com.liferay.portlet.messageboards.NoSuchDiscussionException {
136         return getPersistence().findByClassNameId_Last(classNameId, obc);
137     }
138 
139     public static com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
140         long discussionId, long classNameId,
141         com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.SystemException,
143             com.liferay.portlet.messageboards.NoSuchDiscussionException {
144         return getPersistence()
145                    .findByClassNameId_PrevAndNext(discussionId, classNameId, obc);
146     }
147 
148     public static com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId(
149         long threadId)
150         throws com.liferay.portal.SystemException,
151             com.liferay.portlet.messageboards.NoSuchDiscussionException {
152         return getPersistence().findByThreadId(threadId);
153     }
154 
155     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
156         long threadId) throws com.liferay.portal.SystemException {
157         return getPersistence().fetchByThreadId(threadId);
158     }
159 
160     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
161         long threadId, boolean retrieveFromCache)
162         throws com.liferay.portal.SystemException {
163         return getPersistence().fetchByThreadId(threadId, retrieveFromCache);
164     }
165 
166     public static com.liferay.portlet.messageboards.model.MBDiscussion findByC_C(
167         long classNameId, long classPK)
168         throws com.liferay.portal.SystemException,
169             com.liferay.portlet.messageboards.NoSuchDiscussionException {
170         return getPersistence().findByC_C(classNameId, classPK);
171     }
172 
173     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
174         long classNameId, long classPK)
175         throws com.liferay.portal.SystemException {
176         return getPersistence().fetchByC_C(classNameId, classPK);
177     }
178 
179     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
180         long classNameId, long classPK, boolean retrieveFromCache)
181         throws com.liferay.portal.SystemException {
182         return getPersistence()
183                    .fetchByC_C(classNameId, classPK, retrieveFromCache);
184     }
185 
186     public static java.util.List<Object> findWithDynamicQuery(
187         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
188         throws com.liferay.portal.SystemException {
189         return getPersistence().findWithDynamicQuery(dynamicQuery);
190     }
191 
192     public static java.util.List<Object> findWithDynamicQuery(
193         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
194         int end) throws com.liferay.portal.SystemException {
195         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
196     }
197 
198     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
199         throws com.liferay.portal.SystemException {
200         return getPersistence().findAll();
201     }
202 
203     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
204         int start, int end) throws com.liferay.portal.SystemException {
205         return getPersistence().findAll(start, end);
206     }
207 
208     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
209         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
210         throws com.liferay.portal.SystemException {
211         return getPersistence().findAll(start, end, obc);
212     }
213 
214     public static void removeByClassNameId(long classNameId)
215         throws com.liferay.portal.SystemException {
216         getPersistence().removeByClassNameId(classNameId);
217     }
218 
219     public static void removeByThreadId(long threadId)
220         throws com.liferay.portal.SystemException,
221             com.liferay.portlet.messageboards.NoSuchDiscussionException {
222         getPersistence().removeByThreadId(threadId);
223     }
224 
225     public static void removeByC_C(long classNameId, long classPK)
226         throws com.liferay.portal.SystemException,
227             com.liferay.portlet.messageboards.NoSuchDiscussionException {
228         getPersistence().removeByC_C(classNameId, classPK);
229     }
230 
231     public static void removeAll() throws com.liferay.portal.SystemException {
232         getPersistence().removeAll();
233     }
234 
235     public static int countByClassNameId(long classNameId)
236         throws com.liferay.portal.SystemException {
237         return getPersistence().countByClassNameId(classNameId);
238     }
239 
240     public static int countByThreadId(long threadId)
241         throws com.liferay.portal.SystemException {
242         return getPersistence().countByThreadId(threadId);
243     }
244 
245     public static int countByC_C(long classNameId, long classPK)
246         throws com.liferay.portal.SystemException {
247         return getPersistence().countByC_C(classNameId, classPK);
248     }
249 
250     public static int countAll() throws com.liferay.portal.SystemException {
251         return getPersistence().countAll();
252     }
253 
254     public static MBDiscussionPersistence getPersistence() {
255         return _persistence;
256     }
257 
258     public void setPersistence(MBDiscussionPersistence persistence) {
259         _persistence = persistence;
260     }
261 
262     private static MBDiscussionPersistence _persistence;
263 }