1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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  /**
27   * <a href="MBDiscussionUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * @author    Brian Wing Shun Chan
35   * @see       MBDiscussionPersistence
36   * @see       MBDiscussionPersistenceImpl
37   * @generated
38   */
39  public class MBDiscussionUtil {
40      public static void cacheResult(
41          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion) {
42          getPersistence().cacheResult(mbDiscussion);
43      }
44  
45      public static void cacheResult(
46          java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> mbDiscussions) {
47          getPersistence().cacheResult(mbDiscussions);
48      }
49  
50      public static void clearCache() {
51          getPersistence().clearCache();
52      }
53  
54      public static com.liferay.portlet.messageboards.model.MBDiscussion create(
55          long discussionId) {
56          return getPersistence().create(discussionId);
57      }
58  
59      public static com.liferay.portlet.messageboards.model.MBDiscussion remove(
60          long discussionId)
61          throws com.liferay.portal.SystemException,
62              com.liferay.portlet.messageboards.NoSuchDiscussionException {
63          return getPersistence().remove(discussionId);
64      }
65  
66      public static com.liferay.portlet.messageboards.model.MBDiscussion remove(
67          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion)
68          throws com.liferay.portal.SystemException {
69          return getPersistence().remove(mbDiscussion);
70      }
71  
72      /**
73       * @deprecated Use {@link #update(MBDiscussion, boolean merge)}.
74       */
75      public static com.liferay.portlet.messageboards.model.MBDiscussion update(
76          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion)
77          throws com.liferay.portal.SystemException {
78          return getPersistence().update(mbDiscussion);
79      }
80  
81      /**
82       * Add, update, or merge, the entity. This method also calls the model
83       * listeners to trigger the proper events associated with adding, deleting,
84       * or updating an entity.
85       *
86       * @param  mbDiscussion the entity to add, update, or merge
87       * @param  merge boolean value for whether to merge the entity. The default
88       *         value is false. Setting merge to true is more expensive and
89       *         should only be true when mbDiscussion is transient. See
90       *         LEP-5473 for a detailed discussion of this method.
91       * @return the entity that was added, updated, or merged
92       */
93      public static com.liferay.portlet.messageboards.model.MBDiscussion update(
94          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion,
95          boolean merge) throws com.liferay.portal.SystemException {
96          return getPersistence().update(mbDiscussion, merge);
97      }
98  
99      public static com.liferay.portlet.messageboards.model.MBDiscussion updateImpl(
100         com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion,
101         boolean merge) throws com.liferay.portal.SystemException {
102         return getPersistence().updateImpl(mbDiscussion, merge);
103     }
104 
105     public static com.liferay.portlet.messageboards.model.MBDiscussion findByPrimaryKey(
106         long discussionId)
107         throws com.liferay.portal.SystemException,
108             com.liferay.portlet.messageboards.NoSuchDiscussionException {
109         return getPersistence().findByPrimaryKey(discussionId);
110     }
111 
112     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByPrimaryKey(
113         long discussionId) throws com.liferay.portal.SystemException {
114         return getPersistence().fetchByPrimaryKey(discussionId);
115     }
116 
117     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
118         long classNameId) throws com.liferay.portal.SystemException {
119         return getPersistence().findByClassNameId(classNameId);
120     }
121 
122     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
123         long classNameId, int start, int end)
124         throws com.liferay.portal.SystemException {
125         return getPersistence().findByClassNameId(classNameId, start, end);
126     }
127 
128     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
129         long classNameId, int start, int end,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException {
132         return getPersistence().findByClassNameId(classNameId, start, end, obc);
133     }
134 
135     public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
136         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.SystemException,
138             com.liferay.portlet.messageboards.NoSuchDiscussionException {
139         return getPersistence().findByClassNameId_First(classNameId, obc);
140     }
141 
142     public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
143         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
144         throws com.liferay.portal.SystemException,
145             com.liferay.portlet.messageboards.NoSuchDiscussionException {
146         return getPersistence().findByClassNameId_Last(classNameId, obc);
147     }
148 
149     public static com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
150         long discussionId, long classNameId,
151         com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.SystemException,
153             com.liferay.portlet.messageboards.NoSuchDiscussionException {
154         return getPersistence()
155                    .findByClassNameId_PrevAndNext(discussionId, classNameId, obc);
156     }
157 
158     public static com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId(
159         long threadId)
160         throws com.liferay.portal.SystemException,
161             com.liferay.portlet.messageboards.NoSuchDiscussionException {
162         return getPersistence().findByThreadId(threadId);
163     }
164 
165     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
166         long threadId) throws com.liferay.portal.SystemException {
167         return getPersistence().fetchByThreadId(threadId);
168     }
169 
170     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
171         long threadId, boolean retrieveFromCache)
172         throws com.liferay.portal.SystemException {
173         return getPersistence().fetchByThreadId(threadId, retrieveFromCache);
174     }
175 
176     public static com.liferay.portlet.messageboards.model.MBDiscussion findByC_C(
177         long classNameId, long classPK)
178         throws com.liferay.portal.SystemException,
179             com.liferay.portlet.messageboards.NoSuchDiscussionException {
180         return getPersistence().findByC_C(classNameId, classPK);
181     }
182 
183     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
184         long classNameId, long classPK)
185         throws com.liferay.portal.SystemException {
186         return getPersistence().fetchByC_C(classNameId, classPK);
187     }
188 
189     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
190         long classNameId, long classPK, boolean retrieveFromCache)
191         throws com.liferay.portal.SystemException {
192         return getPersistence()
193                    .fetchByC_C(classNameId, classPK, retrieveFromCache);
194     }
195 
196     public static java.util.List<Object> findWithDynamicQuery(
197         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
198         throws com.liferay.portal.SystemException {
199         return getPersistence().findWithDynamicQuery(dynamicQuery);
200     }
201 
202     public static java.util.List<Object> findWithDynamicQuery(
203         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
204         int end) throws com.liferay.portal.SystemException {
205         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
206     }
207 
208     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
209         throws com.liferay.portal.SystemException {
210         return getPersistence().findAll();
211     }
212 
213     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
214         int start, int end) throws com.liferay.portal.SystemException {
215         return getPersistence().findAll(start, end);
216     }
217 
218     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
219         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
220         throws com.liferay.portal.SystemException {
221         return getPersistence().findAll(start, end, obc);
222     }
223 
224     public static void removeByClassNameId(long classNameId)
225         throws com.liferay.portal.SystemException {
226         getPersistence().removeByClassNameId(classNameId);
227     }
228 
229     public static void removeByThreadId(long threadId)
230         throws com.liferay.portal.SystemException,
231             com.liferay.portlet.messageboards.NoSuchDiscussionException {
232         getPersistence().removeByThreadId(threadId);
233     }
234 
235     public static void removeByC_C(long classNameId, long classPK)
236         throws com.liferay.portal.SystemException,
237             com.liferay.portlet.messageboards.NoSuchDiscussionException {
238         getPersistence().removeByC_C(classNameId, classPK);
239     }
240 
241     public static void removeAll() throws com.liferay.portal.SystemException {
242         getPersistence().removeAll();
243     }
244 
245     public static int countByClassNameId(long classNameId)
246         throws com.liferay.portal.SystemException {
247         return getPersistence().countByClassNameId(classNameId);
248     }
249 
250     public static int countByThreadId(long threadId)
251         throws com.liferay.portal.SystemException {
252         return getPersistence().countByThreadId(threadId);
253     }
254 
255     public static int countByC_C(long classNameId, long classPK)
256         throws com.liferay.portal.SystemException {
257         return getPersistence().countByC_C(classNameId, classPK);
258     }
259 
260     public static int countAll() throws com.liferay.portal.SystemException {
261         return getPersistence().countAll();
262     }
263 
264     public static MBDiscussionPersistence getPersistence() {
265         return _persistence;
266     }
267 
268     public void setPersistence(MBDiscussionPersistence persistence) {
269         _persistence = persistence;
270     }
271 
272     private static MBDiscussionPersistence _persistence;
273 }