1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.messageboards.service.persistence;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
19  import com.liferay.portal.kernel.exception.SystemException;
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#clearCache(MBDiscussion)
48       */
49      public static void clearCache(MBDiscussion mbDiscussion) {
50          getPersistence().clearCache(mbDiscussion);
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
55       */
56      public long countWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().countWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
63       */
64      public static List<MBDiscussion> findWithDynamicQuery(
65          DynamicQuery dynamicQuery) throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
71       */
72      public static List<MBDiscussion> findWithDynamicQuery(
73          DynamicQuery dynamicQuery, int start, int end)
74          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.kernel.exception.SystemException,
112             com.liferay.portlet.messageboards.NoSuchDiscussionException {
113         return getPersistence().remove(discussionId);
114     }
115 
116     public static com.liferay.portlet.messageboards.model.MBDiscussion updateImpl(
117         com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion,
118         boolean merge)
119         throws com.liferay.portal.kernel.exception.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.kernel.exception.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)
132         throws com.liferay.portal.kernel.exception.SystemException {
133         return getPersistence().fetchByPrimaryKey(discussionId);
134     }
135 
136     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
137         long classNameId)
138         throws com.liferay.portal.kernel.exception.SystemException {
139         return getPersistence().findByClassNameId(classNameId);
140     }
141 
142     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
143         long classNameId, int start, int end)
144         throws com.liferay.portal.kernel.exception.SystemException {
145         return getPersistence().findByClassNameId(classNameId, start, end);
146     }
147 
148     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
149         long classNameId, int start, int end,
150         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
151         throws com.liferay.portal.kernel.exception.SystemException {
152         return getPersistence()
153                    .findByClassNameId(classNameId, start, end, orderByComparator);
154     }
155 
156     public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
157         long classNameId,
158         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
159         throws com.liferay.portal.kernel.exception.SystemException,
160             com.liferay.portlet.messageboards.NoSuchDiscussionException {
161         return getPersistence()
162                    .findByClassNameId_First(classNameId, orderByComparator);
163     }
164 
165     public static com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
166         long classNameId,
167         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
168         throws com.liferay.portal.kernel.exception.SystemException,
169             com.liferay.portlet.messageboards.NoSuchDiscussionException {
170         return getPersistence()
171                    .findByClassNameId_Last(classNameId, orderByComparator);
172     }
173 
174     public static com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
175         long discussionId, long classNameId,
176         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
177         throws com.liferay.portal.kernel.exception.SystemException,
178             com.liferay.portlet.messageboards.NoSuchDiscussionException {
179         return getPersistence()
180                    .findByClassNameId_PrevAndNext(discussionId, classNameId,
181             orderByComparator);
182     }
183 
184     public static com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId(
185         long threadId)
186         throws com.liferay.portal.kernel.exception.SystemException,
187             com.liferay.portlet.messageboards.NoSuchDiscussionException {
188         return getPersistence().findByThreadId(threadId);
189     }
190 
191     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
192         long threadId)
193         throws com.liferay.portal.kernel.exception.SystemException {
194         return getPersistence().fetchByThreadId(threadId);
195     }
196 
197     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
198         long threadId, boolean retrieveFromCache)
199         throws com.liferay.portal.kernel.exception.SystemException {
200         return getPersistence().fetchByThreadId(threadId, retrieveFromCache);
201     }
202 
203     public static com.liferay.portlet.messageboards.model.MBDiscussion findByC_C(
204         long classNameId, long classPK)
205         throws com.liferay.portal.kernel.exception.SystemException,
206             com.liferay.portlet.messageboards.NoSuchDiscussionException {
207         return getPersistence().findByC_C(classNameId, classPK);
208     }
209 
210     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
211         long classNameId, long classPK)
212         throws com.liferay.portal.kernel.exception.SystemException {
213         return getPersistence().fetchByC_C(classNameId, classPK);
214     }
215 
216     public static com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
217         long classNameId, long classPK, boolean retrieveFromCache)
218         throws com.liferay.portal.kernel.exception.SystemException {
219         return getPersistence()
220                    .fetchByC_C(classNameId, classPK, retrieveFromCache);
221     }
222 
223     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
224         throws com.liferay.portal.kernel.exception.SystemException {
225         return getPersistence().findAll();
226     }
227 
228     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
229         int start, int end)
230         throws com.liferay.portal.kernel.exception.SystemException {
231         return getPersistence().findAll(start, end);
232     }
233 
234     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
235         int start, int end,
236         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
237         throws com.liferay.portal.kernel.exception.SystemException {
238         return getPersistence().findAll(start, end, orderByComparator);
239     }
240 
241     public static void removeByClassNameId(long classNameId)
242         throws com.liferay.portal.kernel.exception.SystemException {
243         getPersistence().removeByClassNameId(classNameId);
244     }
245 
246     public static void removeByThreadId(long threadId)
247         throws com.liferay.portal.kernel.exception.SystemException,
248             com.liferay.portlet.messageboards.NoSuchDiscussionException {
249         getPersistence().removeByThreadId(threadId);
250     }
251 
252     public static void removeByC_C(long classNameId, long classPK)
253         throws com.liferay.portal.kernel.exception.SystemException,
254             com.liferay.portlet.messageboards.NoSuchDiscussionException {
255         getPersistence().removeByC_C(classNameId, classPK);
256     }
257 
258     public static void removeAll()
259         throws com.liferay.portal.kernel.exception.SystemException {
260         getPersistence().removeAll();
261     }
262 
263     public static int countByClassNameId(long classNameId)
264         throws com.liferay.portal.kernel.exception.SystemException {
265         return getPersistence().countByClassNameId(classNameId);
266     }
267 
268     public static int countByThreadId(long threadId)
269         throws com.liferay.portal.kernel.exception.SystemException {
270         return getPersistence().countByThreadId(threadId);
271     }
272 
273     public static int countByC_C(long classNameId, long classPK)
274         throws com.liferay.portal.kernel.exception.SystemException {
275         return getPersistence().countByC_C(classNameId, classPK);
276     }
277 
278     public static int countAll()
279         throws com.liferay.portal.kernel.exception.SystemException {
280         return getPersistence().countAll();
281     }
282 
283     public static MBDiscussionPersistence getPersistence() {
284         if (_persistence == null) {
285             _persistence = (MBDiscussionPersistence)PortalBeanLocatorUtil.locate(MBDiscussionPersistence.class.getName());
286         }
287 
288         return _persistence;
289     }
290 
291     public void setPersistence(MBDiscussionPersistence persistence) {
292         _persistence = persistence;
293     }
294 
295     private static MBDiscussionPersistence _persistence;
296 }