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