1   /**
2    * Copyright (c) 2000-2010 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   *
12   *
13   */
14  
15  package com.liferay.portlet.messageboards.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  import com.liferay.portal.kernel.util.ReferenceRegistry;
21  
22  import com.liferay.portlet.messageboards.model.MBDiscussion;
23  
24  import java.util.List;
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      /**
41       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
42       */
43      public static void clearCache() {
44          getPersistence().clearCache();
45      }
46  
47      /**
48       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(MBDiscussion)
49       */
50      public static void clearCache(MBDiscussion mbDiscussion) {
51          getPersistence().clearCache(mbDiscussion);
52      }
53  
54      /**
55       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
56       */
57      public int countWithDynamicQuery(DynamicQuery dynamicQuery)
58          throws SystemException {
59          return getPersistence().countWithDynamicQuery(dynamicQuery);
60      }
61  
62      /**
63       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
64       */
65      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
66          throws SystemException {
67          return getPersistence().findWithDynamicQuery(dynamicQuery);
68      }
69  
70      /**
71       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
72       */
73      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
74          int start, int end) throws SystemException {
75          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
76      }
77  
78      /**
79       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
80       */
81      public static MBDiscussion remove(MBDiscussion mbDiscussion)
82          throws SystemException {
83          return getPersistence().remove(mbDiscussion);
84      }
85  
86      /**
87       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
88       */
89      public static MBDiscussion update(MBDiscussion mbDiscussion, boolean merge)
90          throws SystemException {
91          return getPersistence().update(mbDiscussion, merge);
92      }
93  
94      public static void cacheResult(
95          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion) {
96          getPersistence().cacheResult(mbDiscussion);
97      }
98  
99      public static void cacheResult(
100         java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> mbDiscussions) {
101         getPersistence().cacheResult(mbDiscussions);
102     }
103 
104     public static com.liferay.portlet.messageboards.model.MBDiscussion create(
105         long discussionId) {
106         return getPersistence().create(discussionId);
107     }
108 
109     public static com.liferay.portlet.messageboards.model.MBDiscussion remove(
110         long discussionId)
111         throws com.liferay.portal.SystemException,
112             com.liferay.portlet.messageboards.NoSuchDiscussionException {
113         return getPersistence().remove(discussionId);
114     }
115 
116     /**
117      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
118      */
119     public static com.liferay.portlet.messageboards.model.MBDiscussion update(
120         com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().update(mbDiscussion);
123     }
124 
125     public static com.liferay.portlet.messageboards.model.MBDiscussion updateImpl(
126         com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion,
127         boolean merge) throws com.liferay.portal.SystemException {
128         return getPersistence().updateImpl(mbDiscussion, merge);
129     }
130 
131     public static com.liferay.portlet.messageboards.model.MBDiscussion findByPrimaryKey(
132         long discussionId)
133         throws com.liferay.portal.SystemException,
134             com.liferay.portlet.messageboards.NoSuchDiscussionException {
135         return getPersistence().findByPrimaryKey(discussionId);
136     }
137 
138     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByPrimaryKey(
139         long discussionId) throws com.liferay.portal.SystemException {
140         return getPersistence().fetchByPrimaryKey(discussionId);
141     }
142 
143     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
144         long classNameId) throws com.liferay.portal.SystemException {
145         return getPersistence().findByClassNameId(classNameId);
146     }
147 
148     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
149         long classNameId, int start, int end)
150         throws com.liferay.portal.SystemException {
151         return getPersistence().findByClassNameId(classNameId, start, end);
152     }
153 
154     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
155         long classNameId, int start, int end,
156         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
157         throws com.liferay.portal.SystemException {
158         return getPersistence()
159                    .findByClassNameId(classNameId, start, end, orderByComparator);
160     }
161 
162     public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
163         long classNameId,
164         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
165         throws com.liferay.portal.SystemException,
166             com.liferay.portlet.messageboards.NoSuchDiscussionException {
167         return getPersistence()
168                    .findByClassNameId_First(classNameId, orderByComparator);
169     }
170 
171     public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
172         long classNameId,
173         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
174         throws com.liferay.portal.SystemException,
175             com.liferay.portlet.messageboards.NoSuchDiscussionException {
176         return getPersistence()
177                    .findByClassNameId_Last(classNameId, orderByComparator);
178     }
179 
180     public static com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
181         long discussionId, long classNameId,
182         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
183         throws com.liferay.portal.SystemException,
184             com.liferay.portlet.messageboards.NoSuchDiscussionException {
185         return getPersistence()
186                    .findByClassNameId_PrevAndNext(discussionId, classNameId,
187             orderByComparator);
188     }
189 
190     public static com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId(
191         long threadId)
192         throws com.liferay.portal.SystemException,
193             com.liferay.portlet.messageboards.NoSuchDiscussionException {
194         return getPersistence().findByThreadId(threadId);
195     }
196 
197     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
198         long threadId) throws com.liferay.portal.SystemException {
199         return getPersistence().fetchByThreadId(threadId);
200     }
201 
202     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
203         long threadId, boolean retrieveFromCache)
204         throws com.liferay.portal.SystemException {
205         return getPersistence().fetchByThreadId(threadId, retrieveFromCache);
206     }
207 
208     public static com.liferay.portlet.messageboards.model.MBDiscussion findByC_C(
209         long classNameId, long classPK)
210         throws com.liferay.portal.SystemException,
211             com.liferay.portlet.messageboards.NoSuchDiscussionException {
212         return getPersistence().findByC_C(classNameId, classPK);
213     }
214 
215     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
216         long classNameId, long classPK)
217         throws com.liferay.portal.SystemException {
218         return getPersistence().fetchByC_C(classNameId, classPK);
219     }
220 
221     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
222         long classNameId, long classPK, boolean retrieveFromCache)
223         throws com.liferay.portal.SystemException {
224         return getPersistence()
225                    .fetchByC_C(classNameId, classPK, retrieveFromCache);
226     }
227 
228     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
229         throws com.liferay.portal.SystemException {
230         return getPersistence().findAll();
231     }
232 
233     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
234         int start, int end) throws com.liferay.portal.SystemException {
235         return getPersistence().findAll(start, end);
236     }
237 
238     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
239         int start, int end,
240         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
241         throws com.liferay.portal.SystemException {
242         return getPersistence().findAll(start, end, orderByComparator);
243     }
244 
245     public static void removeByClassNameId(long classNameId)
246         throws com.liferay.portal.SystemException {
247         getPersistence().removeByClassNameId(classNameId);
248     }
249 
250     public static void removeByThreadId(long threadId)
251         throws com.liferay.portal.SystemException,
252             com.liferay.portlet.messageboards.NoSuchDiscussionException {
253         getPersistence().removeByThreadId(threadId);
254     }
255 
256     public static void removeByC_C(long classNameId, long classPK)
257         throws com.liferay.portal.SystemException,
258             com.liferay.portlet.messageboards.NoSuchDiscussionException {
259         getPersistence().removeByC_C(classNameId, classPK);
260     }
261 
262     public static void removeAll() throws com.liferay.portal.SystemException {
263         getPersistence().removeAll();
264     }
265 
266     public static int countByClassNameId(long classNameId)
267         throws com.liferay.portal.SystemException {
268         return getPersistence().countByClassNameId(classNameId);
269     }
270 
271     public static int countByThreadId(long threadId)
272         throws com.liferay.portal.SystemException {
273         return getPersistence().countByThreadId(threadId);
274     }
275 
276     public static int countByC_C(long classNameId, long classPK)
277         throws com.liferay.portal.SystemException {
278         return getPersistence().countByC_C(classNameId, classPK);
279     }
280 
281     public static int countAll() throws com.liferay.portal.SystemException {
282         return getPersistence().countAll();
283     }
284 
285     public static MBDiscussionPersistence getPersistence() {
286         if (_persistence == null) {
287             _persistence = (MBDiscussionPersistence)PortalBeanLocatorUtil.locate(MBDiscussionPersistence.class.getName());
288 
289             ReferenceRegistry.registerReference(MBDiscussionUtil.class,
290                 "_persistence");
291         }
292 
293         return _persistence;
294     }
295 
296     public void setPersistence(MBDiscussionPersistence persistence) {
297         _persistence = persistence;
298 
299         ReferenceRegistry.registerReference(MBDiscussionUtil.class,
300             "_persistence");
301     }
302 
303     private static MBDiscussionPersistence _persistence;
304 }