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="MBMessageFlagUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class MBMessageFlagUtil {
32      public static com.liferay.portlet.messageboards.model.MBMessageFlag create(
33          long messageFlagId) {
34          return getPersistence().create(messageFlagId);
35      }
36  
37      public static com.liferay.portlet.messageboards.model.MBMessageFlag remove(
38          long messageFlagId)
39          throws com.liferay.portal.SystemException,
40              com.liferay.portlet.messageboards.NoSuchMessageFlagException {
41          return getPersistence().remove(messageFlagId);
42      }
43  
44      public static com.liferay.portlet.messageboards.model.MBMessageFlag remove(
45          com.liferay.portlet.messageboards.model.MBMessageFlag mbMessageFlag)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(mbMessageFlag);
48      }
49  
50      /**
51       * @deprecated Use <code>update(MBMessageFlag mbMessageFlag, boolean merge)</code>.
52       */
53      public static com.liferay.portlet.messageboards.model.MBMessageFlag update(
54          com.liferay.portlet.messageboards.model.MBMessageFlag mbMessageFlag)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(mbMessageFlag);
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        mbMessageFlag 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 mbMessageFlag 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.MBMessageFlag update(
73          com.liferay.portlet.messageboards.model.MBMessageFlag mbMessageFlag,
74          boolean merge) throws com.liferay.portal.SystemException {
75          return getPersistence().update(mbMessageFlag, merge);
76      }
77  
78      public static com.liferay.portlet.messageboards.model.MBMessageFlag updateImpl(
79          com.liferay.portlet.messageboards.model.MBMessageFlag mbMessageFlag,
80          boolean merge) throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(mbMessageFlag, merge);
82      }
83  
84      public static com.liferay.portlet.messageboards.model.MBMessageFlag findByPrimaryKey(
85          long messageFlagId)
86          throws com.liferay.portal.SystemException,
87              com.liferay.portlet.messageboards.NoSuchMessageFlagException {
88          return getPersistence().findByPrimaryKey(messageFlagId);
89      }
90  
91      public static com.liferay.portlet.messageboards.model.MBMessageFlag fetchByPrimaryKey(
92          long messageFlagId) throws com.liferay.portal.SystemException {
93          return getPersistence().fetchByPrimaryKey(messageFlagId);
94      }
95  
96      public static java.util.List<com.liferay.portlet.messageboards.model.MBMessageFlag> findByUserId(
97          long userId) throws com.liferay.portal.SystemException {
98          return getPersistence().findByUserId(userId);
99      }
100 
101     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessageFlag> findByUserId(
102         long userId, int start, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByUserId(userId, start, end);
105     }
106 
107     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessageFlag> findByUserId(
108         long userId, int start, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByUserId(userId, start, end, obc);
112     }
113 
114     public static com.liferay.portlet.messageboards.model.MBMessageFlag findByUserId_First(
115         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
116         throws com.liferay.portal.SystemException,
117             com.liferay.portlet.messageboards.NoSuchMessageFlagException {
118         return getPersistence().findByUserId_First(userId, obc);
119     }
120 
121     public static com.liferay.portlet.messageboards.model.MBMessageFlag findByUserId_Last(
122         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
123         throws com.liferay.portal.SystemException,
124             com.liferay.portlet.messageboards.NoSuchMessageFlagException {
125         return getPersistence().findByUserId_Last(userId, obc);
126     }
127 
128     public static com.liferay.portlet.messageboards.model.MBMessageFlag[] findByUserId_PrevAndNext(
129         long messageFlagId, long userId,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException,
132             com.liferay.portlet.messageboards.NoSuchMessageFlagException {
133         return getPersistence()
134                    .findByUserId_PrevAndNext(messageFlagId, userId, obc);
135     }
136 
137     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessageFlag> findByMessageId(
138         long messageId) throws com.liferay.portal.SystemException {
139         return getPersistence().findByMessageId(messageId);
140     }
141 
142     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessageFlag> findByMessageId(
143         long messageId, int start, int end)
144         throws com.liferay.portal.SystemException {
145         return getPersistence().findByMessageId(messageId, start, end);
146     }
147 
148     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessageFlag> findByMessageId(
149         long messageId, int start, int end,
150         com.liferay.portal.kernel.util.OrderByComparator obc)
151         throws com.liferay.portal.SystemException {
152         return getPersistence().findByMessageId(messageId, start, end, obc);
153     }
154 
155     public static com.liferay.portlet.messageboards.model.MBMessageFlag findByMessageId_First(
156         long messageId, com.liferay.portal.kernel.util.OrderByComparator obc)
157         throws com.liferay.portal.SystemException,
158             com.liferay.portlet.messageboards.NoSuchMessageFlagException {
159         return getPersistence().findByMessageId_First(messageId, obc);
160     }
161 
162     public static com.liferay.portlet.messageboards.model.MBMessageFlag findByMessageId_Last(
163         long messageId, com.liferay.portal.kernel.util.OrderByComparator obc)
164         throws com.liferay.portal.SystemException,
165             com.liferay.portlet.messageboards.NoSuchMessageFlagException {
166         return getPersistence().findByMessageId_Last(messageId, obc);
167     }
168 
169     public static com.liferay.portlet.messageboards.model.MBMessageFlag[] findByMessageId_PrevAndNext(
170         long messageFlagId, long messageId,
171         com.liferay.portal.kernel.util.OrderByComparator obc)
172         throws com.liferay.portal.SystemException,
173             com.liferay.portlet.messageboards.NoSuchMessageFlagException {
174         return getPersistence()
175                    .findByMessageId_PrevAndNext(messageFlagId, messageId, obc);
176     }
177 
178     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessageFlag> findByM_F(
179         long messageId, int flag) throws com.liferay.portal.SystemException {
180         return getPersistence().findByM_F(messageId, flag);
181     }
182 
183     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessageFlag> findByM_F(
184         long messageId, int flag, int start, int end)
185         throws com.liferay.portal.SystemException {
186         return getPersistence().findByM_F(messageId, flag, start, end);
187     }
188 
189     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessageFlag> findByM_F(
190         long messageId, int flag, int start, int end,
191         com.liferay.portal.kernel.util.OrderByComparator obc)
192         throws com.liferay.portal.SystemException {
193         return getPersistence().findByM_F(messageId, flag, start, end, obc);
194     }
195 
196     public static com.liferay.portlet.messageboards.model.MBMessageFlag findByM_F_First(
197         long messageId, int flag,
198         com.liferay.portal.kernel.util.OrderByComparator obc)
199         throws com.liferay.portal.SystemException,
200             com.liferay.portlet.messageboards.NoSuchMessageFlagException {
201         return getPersistence().findByM_F_First(messageId, flag, obc);
202     }
203 
204     public static com.liferay.portlet.messageboards.model.MBMessageFlag findByM_F_Last(
205         long messageId, int flag,
206         com.liferay.portal.kernel.util.OrderByComparator obc)
207         throws com.liferay.portal.SystemException,
208             com.liferay.portlet.messageboards.NoSuchMessageFlagException {
209         return getPersistence().findByM_F_Last(messageId, flag, obc);
210     }
211 
212     public static com.liferay.portlet.messageboards.model.MBMessageFlag[] findByM_F_PrevAndNext(
213         long messageFlagId, long messageId, int flag,
214         com.liferay.portal.kernel.util.OrderByComparator obc)
215         throws com.liferay.portal.SystemException,
216             com.liferay.portlet.messageboards.NoSuchMessageFlagException {
217         return getPersistence()
218                    .findByM_F_PrevAndNext(messageFlagId, messageId, flag, obc);
219     }
220 
221     public static com.liferay.portlet.messageboards.model.MBMessageFlag findByU_M_F(
222         long userId, long messageId, int flag)
223         throws com.liferay.portal.SystemException,
224             com.liferay.portlet.messageboards.NoSuchMessageFlagException {
225         return getPersistence().findByU_M_F(userId, messageId, flag);
226     }
227 
228     public static com.liferay.portlet.messageboards.model.MBMessageFlag fetchByU_M_F(
229         long userId, long messageId, int flag)
230         throws com.liferay.portal.SystemException {
231         return getPersistence().fetchByU_M_F(userId, messageId, flag);
232     }
233 
234     public static java.util.List<Object> findWithDynamicQuery(
235         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
236         throws com.liferay.portal.SystemException {
237         return getPersistence().findWithDynamicQuery(dynamicQuery);
238     }
239 
240     public static java.util.List<Object> findWithDynamicQuery(
241         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
242         int end) throws com.liferay.portal.SystemException {
243         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
244     }
245 
246     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessageFlag> findAll()
247         throws com.liferay.portal.SystemException {
248         return getPersistence().findAll();
249     }
250 
251     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessageFlag> findAll(
252         int start, int end) throws com.liferay.portal.SystemException {
253         return getPersistence().findAll(start, end);
254     }
255 
256     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessageFlag> findAll(
257         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
258         throws com.liferay.portal.SystemException {
259         return getPersistence().findAll(start, end, obc);
260     }
261 
262     public static void removeByUserId(long userId)
263         throws com.liferay.portal.SystemException {
264         getPersistence().removeByUserId(userId);
265     }
266 
267     public static void removeByMessageId(long messageId)
268         throws com.liferay.portal.SystemException {
269         getPersistence().removeByMessageId(messageId);
270     }
271 
272     public static void removeByM_F(long messageId, int flag)
273         throws com.liferay.portal.SystemException {
274         getPersistence().removeByM_F(messageId, flag);
275     }
276 
277     public static void removeByU_M_F(long userId, long messageId, int flag)
278         throws com.liferay.portal.SystemException,
279             com.liferay.portlet.messageboards.NoSuchMessageFlagException {
280         getPersistence().removeByU_M_F(userId, messageId, flag);
281     }
282 
283     public static void removeAll() throws com.liferay.portal.SystemException {
284         getPersistence().removeAll();
285     }
286 
287     public static int countByUserId(long userId)
288         throws com.liferay.portal.SystemException {
289         return getPersistence().countByUserId(userId);
290     }
291 
292     public static int countByMessageId(long messageId)
293         throws com.liferay.portal.SystemException {
294         return getPersistence().countByMessageId(messageId);
295     }
296 
297     public static int countByM_F(long messageId, int flag)
298         throws com.liferay.portal.SystemException {
299         return getPersistence().countByM_F(messageId, flag);
300     }
301 
302     public static int countByU_M_F(long userId, long messageId, int flag)
303         throws com.liferay.portal.SystemException {
304         return getPersistence().countByU_M_F(userId, messageId, flag);
305     }
306 
307     public static int countAll() throws com.liferay.portal.SystemException {
308         return getPersistence().countAll();
309     }
310 
311     public static MBMessageFlagPersistence getPersistence() {
312         return _persistence;
313     }
314 
315     public void setPersistence(MBMessageFlagPersistence persistence) {
316         _persistence = persistence;
317     }
318 
319     private static MBMessageFlagPersistence _persistence;
320 }