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