1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.messageboards.service.persistence;
21  
22  /**
23   * <a href="MBCategoryUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class MBCategoryUtil {
29      public static void cacheResult(
30          com.liferay.portlet.messageboards.model.MBCategory mbCategory) {
31          getPersistence().cacheResult(mbCategory);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portlet.messageboards.model.MBCategory> mbCategories) {
36          getPersistence().cacheResult(mbCategories);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portlet.messageboards.model.MBCategory create(
44          long categoryId) {
45          return getPersistence().create(categoryId);
46      }
47  
48      public static com.liferay.portlet.messageboards.model.MBCategory remove(
49          long categoryId)
50          throws com.liferay.portal.SystemException,
51              com.liferay.portlet.messageboards.NoSuchCategoryException {
52          return getPersistence().remove(categoryId);
53      }
54  
55      public static com.liferay.portlet.messageboards.model.MBCategory remove(
56          com.liferay.portlet.messageboards.model.MBCategory mbCategory)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(mbCategory);
59      }
60  
61      /**
62       * @deprecated Use <code>update(MBCategory mbCategory, boolean merge)</code>.
63       */
64      public static com.liferay.portlet.messageboards.model.MBCategory update(
65          com.liferay.portlet.messageboards.model.MBCategory mbCategory)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(mbCategory);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        mbCategory the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when mbCategory is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portlet.messageboards.model.MBCategory update(
84          com.liferay.portlet.messageboards.model.MBCategory mbCategory,
85          boolean merge) throws com.liferay.portal.SystemException {
86          return getPersistence().update(mbCategory, merge);
87      }
88  
89      public static com.liferay.portlet.messageboards.model.MBCategory updateImpl(
90          com.liferay.portlet.messageboards.model.MBCategory mbCategory,
91          boolean merge) throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(mbCategory, merge);
93      }
94  
95      public static com.liferay.portlet.messageboards.model.MBCategory findByPrimaryKey(
96          long categoryId)
97          throws com.liferay.portal.SystemException,
98              com.liferay.portlet.messageboards.NoSuchCategoryException {
99          return getPersistence().findByPrimaryKey(categoryId);
100     }
101 
102     public static com.liferay.portlet.messageboards.model.MBCategory fetchByPrimaryKey(
103         long categoryId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(categoryId);
105     }
106 
107     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByUuid(
108         java.lang.String uuid) throws com.liferay.portal.SystemException {
109         return getPersistence().findByUuid(uuid);
110     }
111 
112     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByUuid(
113         java.lang.String uuid, int start, int end)
114         throws com.liferay.portal.SystemException {
115         return getPersistence().findByUuid(uuid, start, end);
116     }
117 
118     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByUuid(
119         java.lang.String uuid, int start, int end,
120         com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().findByUuid(uuid, start, end, obc);
123     }
124 
125     public static com.liferay.portlet.messageboards.model.MBCategory findByUuid_First(
126         java.lang.String uuid,
127         com.liferay.portal.kernel.util.OrderByComparator obc)
128         throws com.liferay.portal.SystemException,
129             com.liferay.portlet.messageboards.NoSuchCategoryException {
130         return getPersistence().findByUuid_First(uuid, obc);
131     }
132 
133     public static com.liferay.portlet.messageboards.model.MBCategory findByUuid_Last(
134         java.lang.String uuid,
135         com.liferay.portal.kernel.util.OrderByComparator obc)
136         throws com.liferay.portal.SystemException,
137             com.liferay.portlet.messageboards.NoSuchCategoryException {
138         return getPersistence().findByUuid_Last(uuid, obc);
139     }
140 
141     public static com.liferay.portlet.messageboards.model.MBCategory[] findByUuid_PrevAndNext(
142         long categoryId, java.lang.String uuid,
143         com.liferay.portal.kernel.util.OrderByComparator obc)
144         throws com.liferay.portal.SystemException,
145             com.liferay.portlet.messageboards.NoSuchCategoryException {
146         return getPersistence().findByUuid_PrevAndNext(categoryId, uuid, obc);
147     }
148 
149     public static com.liferay.portlet.messageboards.model.MBCategory findByUUID_G(
150         java.lang.String uuid, long groupId)
151         throws com.liferay.portal.SystemException,
152             com.liferay.portlet.messageboards.NoSuchCategoryException {
153         return getPersistence().findByUUID_G(uuid, groupId);
154     }
155 
156     public static com.liferay.portlet.messageboards.model.MBCategory fetchByUUID_G(
157         java.lang.String uuid, long groupId)
158         throws com.liferay.portal.SystemException {
159         return getPersistence().fetchByUUID_G(uuid, groupId);
160     }
161 
162     public static com.liferay.portlet.messageboards.model.MBCategory fetchByUUID_G(
163         java.lang.String uuid, long groupId, boolean retrieveFromCache)
164         throws com.liferay.portal.SystemException {
165         return getPersistence().fetchByUUID_G(uuid, groupId, retrieveFromCache);
166     }
167 
168     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByGroupId(
169         long groupId) throws com.liferay.portal.SystemException {
170         return getPersistence().findByGroupId(groupId);
171     }
172 
173     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByGroupId(
174         long groupId, int start, int end)
175         throws com.liferay.portal.SystemException {
176         return getPersistence().findByGroupId(groupId, start, end);
177     }
178 
179     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByGroupId(
180         long groupId, int start, int end,
181         com.liferay.portal.kernel.util.OrderByComparator obc)
182         throws com.liferay.portal.SystemException {
183         return getPersistence().findByGroupId(groupId, start, end, obc);
184     }
185 
186     public static com.liferay.portlet.messageboards.model.MBCategory findByGroupId_First(
187         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
188         throws com.liferay.portal.SystemException,
189             com.liferay.portlet.messageboards.NoSuchCategoryException {
190         return getPersistence().findByGroupId_First(groupId, obc);
191     }
192 
193     public static com.liferay.portlet.messageboards.model.MBCategory findByGroupId_Last(
194         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
195         throws com.liferay.portal.SystemException,
196             com.liferay.portlet.messageboards.NoSuchCategoryException {
197         return getPersistence().findByGroupId_Last(groupId, obc);
198     }
199 
200     public static com.liferay.portlet.messageboards.model.MBCategory[] findByGroupId_PrevAndNext(
201         long categoryId, long groupId,
202         com.liferay.portal.kernel.util.OrderByComparator obc)
203         throws com.liferay.portal.SystemException,
204             com.liferay.portlet.messageboards.NoSuchCategoryException {
205         return getPersistence()
206                    .findByGroupId_PrevAndNext(categoryId, groupId, obc);
207     }
208 
209     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByCompanyId(
210         long companyId) throws com.liferay.portal.SystemException {
211         return getPersistence().findByCompanyId(companyId);
212     }
213 
214     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByCompanyId(
215         long companyId, int start, int end)
216         throws com.liferay.portal.SystemException {
217         return getPersistence().findByCompanyId(companyId, start, end);
218     }
219 
220     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByCompanyId(
221         long companyId, int start, int end,
222         com.liferay.portal.kernel.util.OrderByComparator obc)
223         throws com.liferay.portal.SystemException {
224         return getPersistence().findByCompanyId(companyId, start, end, obc);
225     }
226 
227     public static com.liferay.portlet.messageboards.model.MBCategory findByCompanyId_First(
228         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
229         throws com.liferay.portal.SystemException,
230             com.liferay.portlet.messageboards.NoSuchCategoryException {
231         return getPersistence().findByCompanyId_First(companyId, obc);
232     }
233 
234     public static com.liferay.portlet.messageboards.model.MBCategory findByCompanyId_Last(
235         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
236         throws com.liferay.portal.SystemException,
237             com.liferay.portlet.messageboards.NoSuchCategoryException {
238         return getPersistence().findByCompanyId_Last(companyId, obc);
239     }
240 
241     public static com.liferay.portlet.messageboards.model.MBCategory[] findByCompanyId_PrevAndNext(
242         long categoryId, long companyId,
243         com.liferay.portal.kernel.util.OrderByComparator obc)
244         throws com.liferay.portal.SystemException,
245             com.liferay.portlet.messageboards.NoSuchCategoryException {
246         return getPersistence()
247                    .findByCompanyId_PrevAndNext(categoryId, companyId, obc);
248     }
249 
250     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByG_P(
251         long groupId, long parentCategoryId)
252         throws com.liferay.portal.SystemException {
253         return getPersistence().findByG_P(groupId, parentCategoryId);
254     }
255 
256     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByG_P(
257         long groupId, long parentCategoryId, int start, int end)
258         throws com.liferay.portal.SystemException {
259         return getPersistence().findByG_P(groupId, parentCategoryId, start, end);
260     }
261 
262     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByG_P(
263         long groupId, long parentCategoryId, int start, int end,
264         com.liferay.portal.kernel.util.OrderByComparator obc)
265         throws com.liferay.portal.SystemException {
266         return getPersistence()
267                    .findByG_P(groupId, parentCategoryId, start, end, obc);
268     }
269 
270     public static com.liferay.portlet.messageboards.model.MBCategory findByG_P_First(
271         long groupId, long parentCategoryId,
272         com.liferay.portal.kernel.util.OrderByComparator obc)
273         throws com.liferay.portal.SystemException,
274             com.liferay.portlet.messageboards.NoSuchCategoryException {
275         return getPersistence().findByG_P_First(groupId, parentCategoryId, obc);
276     }
277 
278     public static com.liferay.portlet.messageboards.model.MBCategory findByG_P_Last(
279         long groupId, long parentCategoryId,
280         com.liferay.portal.kernel.util.OrderByComparator obc)
281         throws com.liferay.portal.SystemException,
282             com.liferay.portlet.messageboards.NoSuchCategoryException {
283         return getPersistence().findByG_P_Last(groupId, parentCategoryId, obc);
284     }
285 
286     public static com.liferay.portlet.messageboards.model.MBCategory[] findByG_P_PrevAndNext(
287         long categoryId, long groupId, long parentCategoryId,
288         com.liferay.portal.kernel.util.OrderByComparator obc)
289         throws com.liferay.portal.SystemException,
290             com.liferay.portlet.messageboards.NoSuchCategoryException {
291         return getPersistence()
292                    .findByG_P_PrevAndNext(categoryId, groupId,
293             parentCategoryId, obc);
294     }
295 
296     public static java.util.List<Object> findWithDynamicQuery(
297         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
298         throws com.liferay.portal.SystemException {
299         return getPersistence().findWithDynamicQuery(dynamicQuery);
300     }
301 
302     public static java.util.List<Object> findWithDynamicQuery(
303         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
304         int end) throws com.liferay.portal.SystemException {
305         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
306     }
307 
308     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findAll()
309         throws com.liferay.portal.SystemException {
310         return getPersistence().findAll();
311     }
312 
313     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findAll(
314         int start, int end) throws com.liferay.portal.SystemException {
315         return getPersistence().findAll(start, end);
316     }
317 
318     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findAll(
319         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
320         throws com.liferay.portal.SystemException {
321         return getPersistence().findAll(start, end, obc);
322     }
323 
324     public static void removeByUuid(java.lang.String uuid)
325         throws com.liferay.portal.SystemException {
326         getPersistence().removeByUuid(uuid);
327     }
328 
329     public static void removeByUUID_G(java.lang.String uuid, long groupId)
330         throws com.liferay.portal.SystemException,
331             com.liferay.portlet.messageboards.NoSuchCategoryException {
332         getPersistence().removeByUUID_G(uuid, groupId);
333     }
334 
335     public static void removeByGroupId(long groupId)
336         throws com.liferay.portal.SystemException {
337         getPersistence().removeByGroupId(groupId);
338     }
339 
340     public static void removeByCompanyId(long companyId)
341         throws com.liferay.portal.SystemException {
342         getPersistence().removeByCompanyId(companyId);
343     }
344 
345     public static void removeByG_P(long groupId, long parentCategoryId)
346         throws com.liferay.portal.SystemException {
347         getPersistence().removeByG_P(groupId, parentCategoryId);
348     }
349 
350     public static void removeAll() throws com.liferay.portal.SystemException {
351         getPersistence().removeAll();
352     }
353 
354     public static int countByUuid(java.lang.String uuid)
355         throws com.liferay.portal.SystemException {
356         return getPersistence().countByUuid(uuid);
357     }
358 
359     public static int countByUUID_G(java.lang.String uuid, long groupId)
360         throws com.liferay.portal.SystemException {
361         return getPersistence().countByUUID_G(uuid, groupId);
362     }
363 
364     public static int countByGroupId(long groupId)
365         throws com.liferay.portal.SystemException {
366         return getPersistence().countByGroupId(groupId);
367     }
368 
369     public static int countByCompanyId(long companyId)
370         throws com.liferay.portal.SystemException {
371         return getPersistence().countByCompanyId(companyId);
372     }
373 
374     public static int countByG_P(long groupId, long parentCategoryId)
375         throws com.liferay.portal.SystemException {
376         return getPersistence().countByG_P(groupId, parentCategoryId);
377     }
378 
379     public static int countAll() throws com.liferay.portal.SystemException {
380         return getPersistence().countAll();
381     }
382 
383     public static MBCategoryPersistence getPersistence() {
384         return _persistence;
385     }
386 
387     public void setPersistence(MBCategoryPersistence persistence) {
388         _persistence = persistence;
389     }
390 
391     private static MBCategoryPersistence _persistence;
392 }