1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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  /**
26   * <a href="MBCategoryUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class MBCategoryUtil {
32      public static com.liferay.portlet.messageboards.model.MBCategory create(
33          long categoryId) {
34          return getPersistence().create(categoryId);
35      }
36  
37      public static com.liferay.portlet.messageboards.model.MBCategory remove(
38          long categoryId)
39          throws com.liferay.portal.SystemException,
40              com.liferay.portlet.messageboards.NoSuchCategoryException {
41          return getPersistence().remove(categoryId);
42      }
43  
44      public static com.liferay.portlet.messageboards.model.MBCategory remove(
45          com.liferay.portlet.messageboards.model.MBCategory mbCategory)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(mbCategory);
48      }
49  
50      /**
51       * @deprecated Use <code>update(MBCategory mbCategory, boolean merge)</code>.
52       */
53      public static com.liferay.portlet.messageboards.model.MBCategory update(
54          com.liferay.portlet.messageboards.model.MBCategory mbCategory)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(mbCategory);
57      }
58  
59      /**
60       * Add, update, or merge, the entity. This method also calls the model
61       * listeners to trigger the proper events associated with adding, deleting,
62       * or updating an entity.
63       *
64       * @param        mbCategory the entity to add, update, or merge
65       * @param        merge boolean value for whether to merge the entity. The
66       *                default value is false. Setting merge to true is more
67       *                expensive and should only be true when mbCategory is
68       *                transient. See LEP-5473 for a detailed discussion of this
69       *                method.
70       * @return        true if the portlet can be displayed via Ajax
71       */
72      public static com.liferay.portlet.messageboards.model.MBCategory update(
73          com.liferay.portlet.messageboards.model.MBCategory mbCategory,
74          boolean merge) throws com.liferay.portal.SystemException {
75          return getPersistence().update(mbCategory, merge);
76      }
77  
78      public static com.liferay.portlet.messageboards.model.MBCategory updateImpl(
79          com.liferay.portlet.messageboards.model.MBCategory mbCategory,
80          boolean merge) throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(mbCategory, merge);
82      }
83  
84      public static com.liferay.portlet.messageboards.model.MBCategory findByPrimaryKey(
85          long categoryId)
86          throws com.liferay.portal.SystemException,
87              com.liferay.portlet.messageboards.NoSuchCategoryException {
88          return getPersistence().findByPrimaryKey(categoryId);
89      }
90  
91      public static com.liferay.portlet.messageboards.model.MBCategory fetchByPrimaryKey(
92          long categoryId) throws com.liferay.portal.SystemException {
93          return getPersistence().fetchByPrimaryKey(categoryId);
94      }
95  
96      public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByUuid(
97          java.lang.String uuid) throws com.liferay.portal.SystemException {
98          return getPersistence().findByUuid(uuid);
99      }
100 
101     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByUuid(
102         java.lang.String uuid, int begin, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByUuid(uuid, begin, end);
105     }
106 
107     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByUuid(
108         java.lang.String uuid, int begin, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByUuid(uuid, begin, end, obc);
112     }
113 
114     public static com.liferay.portlet.messageboards.model.MBCategory findByUuid_First(
115         java.lang.String uuid,
116         com.liferay.portal.kernel.util.OrderByComparator obc)
117         throws com.liferay.portal.SystemException,
118             com.liferay.portlet.messageboards.NoSuchCategoryException {
119         return getPersistence().findByUuid_First(uuid, obc);
120     }
121 
122     public static com.liferay.portlet.messageboards.model.MBCategory findByUuid_Last(
123         java.lang.String uuid,
124         com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.SystemException,
126             com.liferay.portlet.messageboards.NoSuchCategoryException {
127         return getPersistence().findByUuid_Last(uuid, obc);
128     }
129 
130     public static com.liferay.portlet.messageboards.model.MBCategory[] findByUuid_PrevAndNext(
131         long categoryId, java.lang.String uuid,
132         com.liferay.portal.kernel.util.OrderByComparator obc)
133         throws com.liferay.portal.SystemException,
134             com.liferay.portlet.messageboards.NoSuchCategoryException {
135         return getPersistence().findByUuid_PrevAndNext(categoryId, uuid, obc);
136     }
137 
138     public static com.liferay.portlet.messageboards.model.MBCategory findByUUID_G(
139         java.lang.String uuid, long groupId)
140         throws com.liferay.portal.SystemException,
141             com.liferay.portlet.messageboards.NoSuchCategoryException {
142         return getPersistence().findByUUID_G(uuid, groupId);
143     }
144 
145     public static com.liferay.portlet.messageboards.model.MBCategory fetchByUUID_G(
146         java.lang.String uuid, long groupId)
147         throws com.liferay.portal.SystemException {
148         return getPersistence().fetchByUUID_G(uuid, groupId);
149     }
150 
151     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByGroupId(
152         long groupId) throws com.liferay.portal.SystemException {
153         return getPersistence().findByGroupId(groupId);
154     }
155 
156     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByGroupId(
157         long groupId, int begin, int end)
158         throws com.liferay.portal.SystemException {
159         return getPersistence().findByGroupId(groupId, begin, end);
160     }
161 
162     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByGroupId(
163         long groupId, int begin, int end,
164         com.liferay.portal.kernel.util.OrderByComparator obc)
165         throws com.liferay.portal.SystemException {
166         return getPersistence().findByGroupId(groupId, begin, end, obc);
167     }
168 
169     public static com.liferay.portlet.messageboards.model.MBCategory findByGroupId_First(
170         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
171         throws com.liferay.portal.SystemException,
172             com.liferay.portlet.messageboards.NoSuchCategoryException {
173         return getPersistence().findByGroupId_First(groupId, obc);
174     }
175 
176     public static com.liferay.portlet.messageboards.model.MBCategory findByGroupId_Last(
177         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
178         throws com.liferay.portal.SystemException,
179             com.liferay.portlet.messageboards.NoSuchCategoryException {
180         return getPersistence().findByGroupId_Last(groupId, obc);
181     }
182 
183     public static com.liferay.portlet.messageboards.model.MBCategory[] findByGroupId_PrevAndNext(
184         long categoryId, long groupId,
185         com.liferay.portal.kernel.util.OrderByComparator obc)
186         throws com.liferay.portal.SystemException,
187             com.liferay.portlet.messageboards.NoSuchCategoryException {
188         return getPersistence()
189                    .findByGroupId_PrevAndNext(categoryId, groupId, obc);
190     }
191 
192     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByCompanyId(
193         long companyId) throws com.liferay.portal.SystemException {
194         return getPersistence().findByCompanyId(companyId);
195     }
196 
197     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByCompanyId(
198         long companyId, int begin, int end)
199         throws com.liferay.portal.SystemException {
200         return getPersistence().findByCompanyId(companyId, begin, end);
201     }
202 
203     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByCompanyId(
204         long companyId, int begin, int end,
205         com.liferay.portal.kernel.util.OrderByComparator obc)
206         throws com.liferay.portal.SystemException {
207         return getPersistence().findByCompanyId(companyId, begin, end, obc);
208     }
209 
210     public static com.liferay.portlet.messageboards.model.MBCategory findByCompanyId_First(
211         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
212         throws com.liferay.portal.SystemException,
213             com.liferay.portlet.messageboards.NoSuchCategoryException {
214         return getPersistence().findByCompanyId_First(companyId, obc);
215     }
216 
217     public static com.liferay.portlet.messageboards.model.MBCategory findByCompanyId_Last(
218         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
219         throws com.liferay.portal.SystemException,
220             com.liferay.portlet.messageboards.NoSuchCategoryException {
221         return getPersistence().findByCompanyId_Last(companyId, obc);
222     }
223 
224     public static com.liferay.portlet.messageboards.model.MBCategory[] findByCompanyId_PrevAndNext(
225         long categoryId, long companyId,
226         com.liferay.portal.kernel.util.OrderByComparator obc)
227         throws com.liferay.portal.SystemException,
228             com.liferay.portlet.messageboards.NoSuchCategoryException {
229         return getPersistence()
230                    .findByCompanyId_PrevAndNext(categoryId, companyId, obc);
231     }
232 
233     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByG_P(
234         long groupId, long parentCategoryId)
235         throws com.liferay.portal.SystemException {
236         return getPersistence().findByG_P(groupId, parentCategoryId);
237     }
238 
239     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByG_P(
240         long groupId, long parentCategoryId, int begin, int end)
241         throws com.liferay.portal.SystemException {
242         return getPersistence().findByG_P(groupId, parentCategoryId, begin, end);
243     }
244 
245     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findByG_P(
246         long groupId, long parentCategoryId, int begin, int end,
247         com.liferay.portal.kernel.util.OrderByComparator obc)
248         throws com.liferay.portal.SystemException {
249         return getPersistence()
250                    .findByG_P(groupId, parentCategoryId, begin, end, obc);
251     }
252 
253     public static com.liferay.portlet.messageboards.model.MBCategory findByG_P_First(
254         long groupId, long parentCategoryId,
255         com.liferay.portal.kernel.util.OrderByComparator obc)
256         throws com.liferay.portal.SystemException,
257             com.liferay.portlet.messageboards.NoSuchCategoryException {
258         return getPersistence().findByG_P_First(groupId, parentCategoryId, obc);
259     }
260 
261     public static com.liferay.portlet.messageboards.model.MBCategory findByG_P_Last(
262         long groupId, long parentCategoryId,
263         com.liferay.portal.kernel.util.OrderByComparator obc)
264         throws com.liferay.portal.SystemException,
265             com.liferay.portlet.messageboards.NoSuchCategoryException {
266         return getPersistence().findByG_P_Last(groupId, parentCategoryId, obc);
267     }
268 
269     public static com.liferay.portlet.messageboards.model.MBCategory[] findByG_P_PrevAndNext(
270         long categoryId, long groupId, long parentCategoryId,
271         com.liferay.portal.kernel.util.OrderByComparator obc)
272         throws com.liferay.portal.SystemException,
273             com.liferay.portlet.messageboards.NoSuchCategoryException {
274         return getPersistence()
275                    .findByG_P_PrevAndNext(categoryId, groupId,
276             parentCategoryId, obc);
277     }
278 
279     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findWithDynamicQuery(
280         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
281         throws com.liferay.portal.SystemException {
282         return getPersistence().findWithDynamicQuery(queryInitializer);
283     }
284 
285     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findWithDynamicQuery(
286         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
287         int begin, int end) throws com.liferay.portal.SystemException {
288         return getPersistence()
289                    .findWithDynamicQuery(queryInitializer, begin, end);
290     }
291 
292     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findAll()
293         throws com.liferay.portal.SystemException {
294         return getPersistence().findAll();
295     }
296 
297     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findAll(
298         int begin, int end) throws com.liferay.portal.SystemException {
299         return getPersistence().findAll(begin, end);
300     }
301 
302     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> findAll(
303         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
304         throws com.liferay.portal.SystemException {
305         return getPersistence().findAll(begin, end, obc);
306     }
307 
308     public static void removeByUuid(java.lang.String uuid)
309         throws com.liferay.portal.SystemException {
310         getPersistence().removeByUuid(uuid);
311     }
312 
313     public static void removeByUUID_G(java.lang.String uuid, long groupId)
314         throws com.liferay.portal.SystemException,
315             com.liferay.portlet.messageboards.NoSuchCategoryException {
316         getPersistence().removeByUUID_G(uuid, groupId);
317     }
318 
319     public static void removeByGroupId(long groupId)
320         throws com.liferay.portal.SystemException {
321         getPersistence().removeByGroupId(groupId);
322     }
323 
324     public static void removeByCompanyId(long companyId)
325         throws com.liferay.portal.SystemException {
326         getPersistence().removeByCompanyId(companyId);
327     }
328 
329     public static void removeByG_P(long groupId, long parentCategoryId)
330         throws com.liferay.portal.SystemException {
331         getPersistence().removeByG_P(groupId, parentCategoryId);
332     }
333 
334     public static void removeAll() throws com.liferay.portal.SystemException {
335         getPersistence().removeAll();
336     }
337 
338     public static int countByUuid(java.lang.String uuid)
339         throws com.liferay.portal.SystemException {
340         return getPersistence().countByUuid(uuid);
341     }
342 
343     public static int countByUUID_G(java.lang.String uuid, long groupId)
344         throws com.liferay.portal.SystemException {
345         return getPersistence().countByUUID_G(uuid, groupId);
346     }
347 
348     public static int countByGroupId(long groupId)
349         throws com.liferay.portal.SystemException {
350         return getPersistence().countByGroupId(groupId);
351     }
352 
353     public static int countByCompanyId(long companyId)
354         throws com.liferay.portal.SystemException {
355         return getPersistence().countByCompanyId(companyId);
356     }
357 
358     public static int countByG_P(long groupId, long parentCategoryId)
359         throws com.liferay.portal.SystemException {
360         return getPersistence().countByG_P(groupId, parentCategoryId);
361     }
362 
363     public static int countAll() throws com.liferay.portal.SystemException {
364         return getPersistence().countAll();
365     }
366 
367     public static MBCategoryPersistence getPersistence() {
368         return _getUtil()._persistence;
369     }
370 
371     public void setPersistence(MBCategoryPersistence persistence) {
372         _persistence = persistence;
373     }
374 
375     private static MBCategoryUtil _getUtil() {
376         if (_util == null) {
377             _util = (MBCategoryUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
378         }
379 
380         return _util;
381     }
382 
383     private static final String _UTIL = MBCategoryUtil.class.getName();
384     private static MBCategoryUtil _util;
385     private MBCategoryPersistence _persistence;
386 }