1   /**
2    * Copyright (c) 2000-2009 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="MBBanUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class MBBanUtil {
32      public static void cacheResult(
33          com.liferay.portlet.messageboards.model.MBBan mbBan) {
34          getPersistence().cacheResult(mbBan);
35      }
36  
37      public static void cacheResult(
38          java.util.List<com.liferay.portlet.messageboards.model.MBBan> mbBans) {
39          getPersistence().cacheResult(mbBans);
40      }
41  
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      public static com.liferay.portlet.messageboards.model.MBBan create(
47          long banId) {
48          return getPersistence().create(banId);
49      }
50  
51      public static com.liferay.portlet.messageboards.model.MBBan remove(
52          long banId)
53          throws com.liferay.portal.SystemException,
54              com.liferay.portlet.messageboards.NoSuchBanException {
55          return getPersistence().remove(banId);
56      }
57  
58      public static com.liferay.portlet.messageboards.model.MBBan remove(
59          com.liferay.portlet.messageboards.model.MBBan mbBan)
60          throws com.liferay.portal.SystemException {
61          return getPersistence().remove(mbBan);
62      }
63  
64      /**
65       * @deprecated Use <code>update(MBBan mbBan, boolean merge)</code>.
66       */
67      public static com.liferay.portlet.messageboards.model.MBBan update(
68          com.liferay.portlet.messageboards.model.MBBan mbBan)
69          throws com.liferay.portal.SystemException {
70          return getPersistence().update(mbBan);
71      }
72  
73      /**
74       * Add, update, or merge, the entity. This method also calls the model
75       * listeners to trigger the proper events associated with adding, deleting,
76       * or updating an entity.
77       *
78       * @param        mbBan the entity to add, update, or merge
79       * @param        merge boolean value for whether to merge the entity. The
80       *                default value is false. Setting merge to true is more
81       *                expensive and should only be true when mbBan is
82       *                transient. See LEP-5473 for a detailed discussion of this
83       *                method.
84       * @return        true if the portlet can be displayed via Ajax
85       */
86      public static com.liferay.portlet.messageboards.model.MBBan update(
87          com.liferay.portlet.messageboards.model.MBBan mbBan, boolean merge)
88          throws com.liferay.portal.SystemException {
89          return getPersistence().update(mbBan, merge);
90      }
91  
92      public static com.liferay.portlet.messageboards.model.MBBan updateImpl(
93          com.liferay.portlet.messageboards.model.MBBan mbBan, boolean merge)
94          throws com.liferay.portal.SystemException {
95          return getPersistence().updateImpl(mbBan, merge);
96      }
97  
98      public static com.liferay.portlet.messageboards.model.MBBan findByPrimaryKey(
99          long banId)
100         throws com.liferay.portal.SystemException,
101             com.liferay.portlet.messageboards.NoSuchBanException {
102         return getPersistence().findByPrimaryKey(banId);
103     }
104 
105     public static com.liferay.portlet.messageboards.model.MBBan fetchByPrimaryKey(
106         long banId) throws com.liferay.portal.SystemException {
107         return getPersistence().fetchByPrimaryKey(banId);
108     }
109 
110     public static java.util.List<com.liferay.portlet.messageboards.model.MBBan> findByGroupId(
111         long groupId) throws com.liferay.portal.SystemException {
112         return getPersistence().findByGroupId(groupId);
113     }
114 
115     public static java.util.List<com.liferay.portlet.messageboards.model.MBBan> findByGroupId(
116         long groupId, int start, int end)
117         throws com.liferay.portal.SystemException {
118         return getPersistence().findByGroupId(groupId, start, end);
119     }
120 
121     public static java.util.List<com.liferay.portlet.messageboards.model.MBBan> findByGroupId(
122         long groupId, int start, int end,
123         com.liferay.portal.kernel.util.OrderByComparator obc)
124         throws com.liferay.portal.SystemException {
125         return getPersistence().findByGroupId(groupId, start, end, obc);
126     }
127 
128     public static com.liferay.portlet.messageboards.model.MBBan findByGroupId_First(
129         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
130         throws com.liferay.portal.SystemException,
131             com.liferay.portlet.messageboards.NoSuchBanException {
132         return getPersistence().findByGroupId_First(groupId, obc);
133     }
134 
135     public static com.liferay.portlet.messageboards.model.MBBan findByGroupId_Last(
136         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.SystemException,
138             com.liferay.portlet.messageboards.NoSuchBanException {
139         return getPersistence().findByGroupId_Last(groupId, obc);
140     }
141 
142     public static com.liferay.portlet.messageboards.model.MBBan[] findByGroupId_PrevAndNext(
143         long banId, long groupId,
144         com.liferay.portal.kernel.util.OrderByComparator obc)
145         throws com.liferay.portal.SystemException,
146             com.liferay.portlet.messageboards.NoSuchBanException {
147         return getPersistence().findByGroupId_PrevAndNext(banId, groupId, obc);
148     }
149 
150     public static java.util.List<com.liferay.portlet.messageboards.model.MBBan> findByUserId(
151         long userId) throws com.liferay.portal.SystemException {
152         return getPersistence().findByUserId(userId);
153     }
154 
155     public static java.util.List<com.liferay.portlet.messageboards.model.MBBan> findByUserId(
156         long userId, int start, int end)
157         throws com.liferay.portal.SystemException {
158         return getPersistence().findByUserId(userId, start, end);
159     }
160 
161     public static java.util.List<com.liferay.portlet.messageboards.model.MBBan> findByUserId(
162         long userId, int start, int end,
163         com.liferay.portal.kernel.util.OrderByComparator obc)
164         throws com.liferay.portal.SystemException {
165         return getPersistence().findByUserId(userId, start, end, obc);
166     }
167 
168     public static com.liferay.portlet.messageboards.model.MBBan findByUserId_First(
169         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws com.liferay.portal.SystemException,
171             com.liferay.portlet.messageboards.NoSuchBanException {
172         return getPersistence().findByUserId_First(userId, obc);
173     }
174 
175     public static com.liferay.portlet.messageboards.model.MBBan findByUserId_Last(
176         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
177         throws com.liferay.portal.SystemException,
178             com.liferay.portlet.messageboards.NoSuchBanException {
179         return getPersistence().findByUserId_Last(userId, obc);
180     }
181 
182     public static com.liferay.portlet.messageboards.model.MBBan[] findByUserId_PrevAndNext(
183         long banId, long userId,
184         com.liferay.portal.kernel.util.OrderByComparator obc)
185         throws com.liferay.portal.SystemException,
186             com.liferay.portlet.messageboards.NoSuchBanException {
187         return getPersistence().findByUserId_PrevAndNext(banId, userId, obc);
188     }
189 
190     public static java.util.List<com.liferay.portlet.messageboards.model.MBBan> findByBanUserId(
191         long banUserId) throws com.liferay.portal.SystemException {
192         return getPersistence().findByBanUserId(banUserId);
193     }
194 
195     public static java.util.List<com.liferay.portlet.messageboards.model.MBBan> findByBanUserId(
196         long banUserId, int start, int end)
197         throws com.liferay.portal.SystemException {
198         return getPersistence().findByBanUserId(banUserId, start, end);
199     }
200 
201     public static java.util.List<com.liferay.portlet.messageboards.model.MBBan> findByBanUserId(
202         long banUserId, int start, int end,
203         com.liferay.portal.kernel.util.OrderByComparator obc)
204         throws com.liferay.portal.SystemException {
205         return getPersistence().findByBanUserId(banUserId, start, end, obc);
206     }
207 
208     public static com.liferay.portlet.messageboards.model.MBBan findByBanUserId_First(
209         long banUserId, com.liferay.portal.kernel.util.OrderByComparator obc)
210         throws com.liferay.portal.SystemException,
211             com.liferay.portlet.messageboards.NoSuchBanException {
212         return getPersistence().findByBanUserId_First(banUserId, obc);
213     }
214 
215     public static com.liferay.portlet.messageboards.model.MBBan findByBanUserId_Last(
216         long banUserId, com.liferay.portal.kernel.util.OrderByComparator obc)
217         throws com.liferay.portal.SystemException,
218             com.liferay.portlet.messageboards.NoSuchBanException {
219         return getPersistence().findByBanUserId_Last(banUserId, obc);
220     }
221 
222     public static com.liferay.portlet.messageboards.model.MBBan[] findByBanUserId_PrevAndNext(
223         long banId, long banUserId,
224         com.liferay.portal.kernel.util.OrderByComparator obc)
225         throws com.liferay.portal.SystemException,
226             com.liferay.portlet.messageboards.NoSuchBanException {
227         return getPersistence()
228                    .findByBanUserId_PrevAndNext(banId, banUserId, obc);
229     }
230 
231     public static com.liferay.portlet.messageboards.model.MBBan findByG_B(
232         long groupId, long banUserId)
233         throws com.liferay.portal.SystemException,
234             com.liferay.portlet.messageboards.NoSuchBanException {
235         return getPersistence().findByG_B(groupId, banUserId);
236     }
237 
238     public static com.liferay.portlet.messageboards.model.MBBan fetchByG_B(
239         long groupId, long banUserId) throws com.liferay.portal.SystemException {
240         return getPersistence().fetchByG_B(groupId, banUserId);
241     }
242 
243     public static com.liferay.portlet.messageboards.model.MBBan fetchByG_B(
244         long groupId, long banUserId, boolean retrieveFromCache)
245         throws com.liferay.portal.SystemException {
246         return getPersistence().fetchByG_B(groupId, banUserId, retrieveFromCache);
247     }
248 
249     public static java.util.List<Object> findWithDynamicQuery(
250         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
251         throws com.liferay.portal.SystemException {
252         return getPersistence().findWithDynamicQuery(dynamicQuery);
253     }
254 
255     public static java.util.List<Object> findWithDynamicQuery(
256         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
257         int end) throws com.liferay.portal.SystemException {
258         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
259     }
260 
261     public static java.util.List<com.liferay.portlet.messageboards.model.MBBan> findAll()
262         throws com.liferay.portal.SystemException {
263         return getPersistence().findAll();
264     }
265 
266     public static java.util.List<com.liferay.portlet.messageboards.model.MBBan> findAll(
267         int start, int end) throws com.liferay.portal.SystemException {
268         return getPersistence().findAll(start, end);
269     }
270 
271     public static java.util.List<com.liferay.portlet.messageboards.model.MBBan> findAll(
272         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
273         throws com.liferay.portal.SystemException {
274         return getPersistence().findAll(start, end, obc);
275     }
276 
277     public static void removeByGroupId(long groupId)
278         throws com.liferay.portal.SystemException {
279         getPersistence().removeByGroupId(groupId);
280     }
281 
282     public static void removeByUserId(long userId)
283         throws com.liferay.portal.SystemException {
284         getPersistence().removeByUserId(userId);
285     }
286 
287     public static void removeByBanUserId(long banUserId)
288         throws com.liferay.portal.SystemException {
289         getPersistence().removeByBanUserId(banUserId);
290     }
291 
292     public static void removeByG_B(long groupId, long banUserId)
293         throws com.liferay.portal.SystemException,
294             com.liferay.portlet.messageboards.NoSuchBanException {
295         getPersistence().removeByG_B(groupId, banUserId);
296     }
297 
298     public static void removeAll() throws com.liferay.portal.SystemException {
299         getPersistence().removeAll();
300     }
301 
302     public static int countByGroupId(long groupId)
303         throws com.liferay.portal.SystemException {
304         return getPersistence().countByGroupId(groupId);
305     }
306 
307     public static int countByUserId(long userId)
308         throws com.liferay.portal.SystemException {
309         return getPersistence().countByUserId(userId);
310     }
311 
312     public static int countByBanUserId(long banUserId)
313         throws com.liferay.portal.SystemException {
314         return getPersistence().countByBanUserId(banUserId);
315     }
316 
317     public static int countByG_B(long groupId, long banUserId)
318         throws com.liferay.portal.SystemException {
319         return getPersistence().countByG_B(groupId, banUserId);
320     }
321 
322     public static int countAll() throws com.liferay.portal.SystemException {
323         return getPersistence().countAll();
324     }
325 
326     public static MBBanPersistence getPersistence() {
327         return _persistence;
328     }
329 
330     public void setPersistence(MBBanPersistence persistence) {
331         _persistence = persistence;
332     }
333 
334     private static MBBanPersistence _persistence;
335 }