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