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 obc)
141         throws com.liferay.portal.SystemException {
142         return getPersistence().findByClassNameId(classNameId, start, end, obc);
143     }
144 
145     public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
146         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
147         throws com.liferay.portal.SystemException,
148             com.liferay.portlet.messageboards.NoSuchDiscussionException {
149         return getPersistence().findByClassNameId_First(classNameId, obc);
150     }
151 
152     public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
153         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
154         throws com.liferay.portal.SystemException,
155             com.liferay.portlet.messageboards.NoSuchDiscussionException {
156         return getPersistence().findByClassNameId_Last(classNameId, obc);
157     }
158 
159     public static com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
160         long discussionId, long classNameId,
161         com.liferay.portal.kernel.util.OrderByComparator obc)
162         throws com.liferay.portal.SystemException,
163             com.liferay.portlet.messageboards.NoSuchDiscussionException {
164         return getPersistence()
165                    .findByClassNameId_PrevAndNext(discussionId, classNameId, obc);
166     }
167 
168     public static com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId(
169         long threadId)
170         throws com.liferay.portal.SystemException,
171             com.liferay.portlet.messageboards.NoSuchDiscussionException {
172         return getPersistence().findByThreadId(threadId);
173     }
174 
175     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
176         long threadId) throws com.liferay.portal.SystemException {
177         return getPersistence().fetchByThreadId(threadId);
178     }
179 
180     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
181         long threadId, boolean retrieveFromCache)
182         throws com.liferay.portal.SystemException {
183         return getPersistence().fetchByThreadId(threadId, retrieveFromCache);
184     }
185 
186     public static com.liferay.portlet.messageboards.model.MBDiscussion findByC_C(
187         long classNameId, long classPK)
188         throws com.liferay.portal.SystemException,
189             com.liferay.portlet.messageboards.NoSuchDiscussionException {
190         return getPersistence().findByC_C(classNameId, classPK);
191     }
192 
193     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
194         long classNameId, long classPK)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().fetchByC_C(classNameId, classPK);
197     }
198 
199     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
200         long classNameId, long classPK, boolean retrieveFromCache)
201         throws com.liferay.portal.SystemException {
202         return getPersistence()
203                    .fetchByC_C(classNameId, classPK, retrieveFromCache);
204     }
205 
206     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
207         throws com.liferay.portal.SystemException {
208         return getPersistence().findAll();
209     }
210 
211     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
212         int start, int end) throws com.liferay.portal.SystemException {
213         return getPersistence().findAll(start, end);
214     }
215 
216     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
217         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
218         throws com.liferay.portal.SystemException {
219         return getPersistence().findAll(start, end, obc);
220     }
221 
222     public static void removeByClassNameId(long classNameId)
223         throws com.liferay.portal.SystemException {
224         getPersistence().removeByClassNameId(classNameId);
225     }
226 
227     public static void removeByThreadId(long threadId)
228         throws com.liferay.portal.SystemException,
229             com.liferay.portlet.messageboards.NoSuchDiscussionException {
230         getPersistence().removeByThreadId(threadId);
231     }
232 
233     public static void removeByC_C(long classNameId, long classPK)
234         throws com.liferay.portal.SystemException,
235             com.liferay.portlet.messageboards.NoSuchDiscussionException {
236         getPersistence().removeByC_C(classNameId, classPK);
237     }
238 
239     public static void removeAll() throws com.liferay.portal.SystemException {
240         getPersistence().removeAll();
241     }
242 
243     public static int countByClassNameId(long classNameId)
244         throws com.liferay.portal.SystemException {
245         return getPersistence().countByClassNameId(classNameId);
246     }
247 
248     public static int countByThreadId(long threadId)
249         throws com.liferay.portal.SystemException {
250         return getPersistence().countByThreadId(threadId);
251     }
252 
253     public static int countByC_C(long classNameId, long classPK)
254         throws com.liferay.portal.SystemException {
255         return getPersistence().countByC_C(classNameId, classPK);
256     }
257 
258     public static int countAll() throws com.liferay.portal.SystemException {
259         return getPersistence().countAll();
260     }
261 
262     public static MBDiscussionPersistence getPersistence() {
263         if (_persistence == null) {
264             _persistence = (MBDiscussionPersistence)PortalBeanLocatorUtil.locate(MBDiscussionPersistence.class.getName());
265         }
266 
267         return _persistence;
268     }
269 
270     public void setPersistence(MBDiscussionPersistence persistence) {
271         _persistence = persistence;
272     }
273 
274     private static MBDiscussionPersistence _persistence;
275 }