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.portal.service.persistence;
24  
25  /**
26   * <a href="UserGroupRoleUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class UserGroupRoleUtil {
32      public static com.liferay.portal.model.UserGroupRole create(
33          com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK) {
34          return getPersistence().create(userGroupRolePK);
35      }
36  
37      public static com.liferay.portal.model.UserGroupRole remove(
38          com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
39          throws com.liferay.portal.NoSuchUserGroupRoleException,
40              com.liferay.portal.SystemException {
41          return getPersistence().remove(userGroupRolePK);
42      }
43  
44      public static com.liferay.portal.model.UserGroupRole remove(
45          com.liferay.portal.model.UserGroupRole userGroupRole)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(userGroupRole);
48      }
49  
50      /**
51       * @deprecated Use <code>update(UserGroupRole userGroupRole, boolean merge)</code>.
52       */
53      public static com.liferay.portal.model.UserGroupRole update(
54          com.liferay.portal.model.UserGroupRole userGroupRole)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(userGroupRole);
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        userGroupRole 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 userGroupRole 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.UserGroupRole update(
73          com.liferay.portal.model.UserGroupRole userGroupRole, boolean merge)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(userGroupRole, merge);
76      }
77  
78      public static com.liferay.portal.model.UserGroupRole updateImpl(
79          com.liferay.portal.model.UserGroupRole userGroupRole, boolean merge)
80          throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(userGroupRole, merge);
82      }
83  
84      public static com.liferay.portal.model.UserGroupRole findByPrimaryKey(
85          com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
86          throws com.liferay.portal.NoSuchUserGroupRoleException,
87              com.liferay.portal.SystemException {
88          return getPersistence().findByPrimaryKey(userGroupRolePK);
89      }
90  
91      public static com.liferay.portal.model.UserGroupRole fetchByPrimaryKey(
92          com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
93          throws com.liferay.portal.SystemException {
94          return getPersistence().fetchByPrimaryKey(userGroupRolePK);
95      }
96  
97      public static java.util.List<com.liferay.portal.model.UserGroupRole> findByUserId(
98          long userId) throws com.liferay.portal.SystemException {
99          return getPersistence().findByUserId(userId);
100     }
101 
102     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByUserId(
103         long userId, int start, int end)
104         throws com.liferay.portal.SystemException {
105         return getPersistence().findByUserId(userId, start, end);
106     }
107 
108     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByUserId(
109         long userId, int start, int end,
110         com.liferay.portal.kernel.util.OrderByComparator obc)
111         throws com.liferay.portal.SystemException {
112         return getPersistence().findByUserId(userId, start, end, obc);
113     }
114 
115     public static com.liferay.portal.model.UserGroupRole findByUserId_First(
116         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
117         throws com.liferay.portal.NoSuchUserGroupRoleException,
118             com.liferay.portal.SystemException {
119         return getPersistence().findByUserId_First(userId, obc);
120     }
121 
122     public static com.liferay.portal.model.UserGroupRole findByUserId_Last(
123         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
124         throws com.liferay.portal.NoSuchUserGroupRoleException,
125             com.liferay.portal.SystemException {
126         return getPersistence().findByUserId_Last(userId, obc);
127     }
128 
129     public static com.liferay.portal.model.UserGroupRole[] findByUserId_PrevAndNext(
130         com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
131         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
132         throws com.liferay.portal.NoSuchUserGroupRoleException,
133             com.liferay.portal.SystemException {
134         return getPersistence()
135                    .findByUserId_PrevAndNext(userGroupRolePK, userId, obc);
136     }
137 
138     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByGroupId(
139         long groupId) throws com.liferay.portal.SystemException {
140         return getPersistence().findByGroupId(groupId);
141     }
142 
143     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByGroupId(
144         long groupId, int start, int end)
145         throws com.liferay.portal.SystemException {
146         return getPersistence().findByGroupId(groupId, start, end);
147     }
148 
149     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByGroupId(
150         long groupId, int start, int end,
151         com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.SystemException {
153         return getPersistence().findByGroupId(groupId, start, end, obc);
154     }
155 
156     public static com.liferay.portal.model.UserGroupRole findByGroupId_First(
157         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
158         throws com.liferay.portal.NoSuchUserGroupRoleException,
159             com.liferay.portal.SystemException {
160         return getPersistence().findByGroupId_First(groupId, obc);
161     }
162 
163     public static com.liferay.portal.model.UserGroupRole findByGroupId_Last(
164         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
165         throws com.liferay.portal.NoSuchUserGroupRoleException,
166             com.liferay.portal.SystemException {
167         return getPersistence().findByGroupId_Last(groupId, obc);
168     }
169 
170     public static com.liferay.portal.model.UserGroupRole[] findByGroupId_PrevAndNext(
171         com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
172         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
173         throws com.liferay.portal.NoSuchUserGroupRoleException,
174             com.liferay.portal.SystemException {
175         return getPersistence()
176                    .findByGroupId_PrevAndNext(userGroupRolePK, groupId, obc);
177     }
178 
179     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByRoleId(
180         long roleId) throws com.liferay.portal.SystemException {
181         return getPersistence().findByRoleId(roleId);
182     }
183 
184     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByRoleId(
185         long roleId, int start, int end)
186         throws com.liferay.portal.SystemException {
187         return getPersistence().findByRoleId(roleId, start, end);
188     }
189 
190     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByRoleId(
191         long roleId, int start, int end,
192         com.liferay.portal.kernel.util.OrderByComparator obc)
193         throws com.liferay.portal.SystemException {
194         return getPersistence().findByRoleId(roleId, start, end, obc);
195     }
196 
197     public static com.liferay.portal.model.UserGroupRole findByRoleId_First(
198         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
199         throws com.liferay.portal.NoSuchUserGroupRoleException,
200             com.liferay.portal.SystemException {
201         return getPersistence().findByRoleId_First(roleId, obc);
202     }
203 
204     public static com.liferay.portal.model.UserGroupRole findByRoleId_Last(
205         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
206         throws com.liferay.portal.NoSuchUserGroupRoleException,
207             com.liferay.portal.SystemException {
208         return getPersistence().findByRoleId_Last(roleId, obc);
209     }
210 
211     public static com.liferay.portal.model.UserGroupRole[] findByRoleId_PrevAndNext(
212         com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
213         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
214         throws com.liferay.portal.NoSuchUserGroupRoleException,
215             com.liferay.portal.SystemException {
216         return getPersistence()
217                    .findByRoleId_PrevAndNext(userGroupRolePK, roleId, obc);
218     }
219 
220     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByU_G(
221         long userId, long groupId) throws com.liferay.portal.SystemException {
222         return getPersistence().findByU_G(userId, groupId);
223     }
224 
225     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByU_G(
226         long userId, long groupId, int start, int end)
227         throws com.liferay.portal.SystemException {
228         return getPersistence().findByU_G(userId, groupId, start, end);
229     }
230 
231     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByU_G(
232         long userId, long groupId, int start, int end,
233         com.liferay.portal.kernel.util.OrderByComparator obc)
234         throws com.liferay.portal.SystemException {
235         return getPersistence().findByU_G(userId, groupId, start, end, obc);
236     }
237 
238     public static com.liferay.portal.model.UserGroupRole findByU_G_First(
239         long userId, long groupId,
240         com.liferay.portal.kernel.util.OrderByComparator obc)
241         throws com.liferay.portal.NoSuchUserGroupRoleException,
242             com.liferay.portal.SystemException {
243         return getPersistence().findByU_G_First(userId, groupId, obc);
244     }
245 
246     public static com.liferay.portal.model.UserGroupRole findByU_G_Last(
247         long userId, long groupId,
248         com.liferay.portal.kernel.util.OrderByComparator obc)
249         throws com.liferay.portal.NoSuchUserGroupRoleException,
250             com.liferay.portal.SystemException {
251         return getPersistence().findByU_G_Last(userId, groupId, obc);
252     }
253 
254     public static com.liferay.portal.model.UserGroupRole[] findByU_G_PrevAndNext(
255         com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
256         long userId, long groupId,
257         com.liferay.portal.kernel.util.OrderByComparator obc)
258         throws com.liferay.portal.NoSuchUserGroupRoleException,
259             com.liferay.portal.SystemException {
260         return getPersistence()
261                    .findByU_G_PrevAndNext(userGroupRolePK, userId, groupId, obc);
262     }
263 
264     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByG_R(
265         long groupId, long roleId) throws com.liferay.portal.SystemException {
266         return getPersistence().findByG_R(groupId, roleId);
267     }
268 
269     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByG_R(
270         long groupId, long roleId, int start, int end)
271         throws com.liferay.portal.SystemException {
272         return getPersistence().findByG_R(groupId, roleId, start, end);
273     }
274 
275     public static java.util.List<com.liferay.portal.model.UserGroupRole> findByG_R(
276         long groupId, long roleId, int start, int end,
277         com.liferay.portal.kernel.util.OrderByComparator obc)
278         throws com.liferay.portal.SystemException {
279         return getPersistence().findByG_R(groupId, roleId, start, end, obc);
280     }
281 
282     public static com.liferay.portal.model.UserGroupRole findByG_R_First(
283         long groupId, long roleId,
284         com.liferay.portal.kernel.util.OrderByComparator obc)
285         throws com.liferay.portal.NoSuchUserGroupRoleException,
286             com.liferay.portal.SystemException {
287         return getPersistence().findByG_R_First(groupId, roleId, obc);
288     }
289 
290     public static com.liferay.portal.model.UserGroupRole findByG_R_Last(
291         long groupId, long roleId,
292         com.liferay.portal.kernel.util.OrderByComparator obc)
293         throws com.liferay.portal.NoSuchUserGroupRoleException,
294             com.liferay.portal.SystemException {
295         return getPersistence().findByG_R_Last(groupId, roleId, obc);
296     }
297 
298     public static com.liferay.portal.model.UserGroupRole[] findByG_R_PrevAndNext(
299         com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
300         long groupId, long roleId,
301         com.liferay.portal.kernel.util.OrderByComparator obc)
302         throws com.liferay.portal.NoSuchUserGroupRoleException,
303             com.liferay.portal.SystemException {
304         return getPersistence()
305                    .findByG_R_PrevAndNext(userGroupRolePK, groupId, roleId, obc);
306     }
307 
308     public static java.util.List<Object> findWithDynamicQuery(
309         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
310         throws com.liferay.portal.SystemException {
311         return getPersistence().findWithDynamicQuery(dynamicQuery);
312     }
313 
314     public static java.util.List<Object> findWithDynamicQuery(
315         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
316         int end) throws com.liferay.portal.SystemException {
317         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
318     }
319 
320     public static java.util.List<com.liferay.portal.model.UserGroupRole> findAll()
321         throws com.liferay.portal.SystemException {
322         return getPersistence().findAll();
323     }
324 
325     public static java.util.List<com.liferay.portal.model.UserGroupRole> findAll(
326         int start, int end) throws com.liferay.portal.SystemException {
327         return getPersistence().findAll(start, end);
328     }
329 
330     public static java.util.List<com.liferay.portal.model.UserGroupRole> findAll(
331         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
332         throws com.liferay.portal.SystemException {
333         return getPersistence().findAll(start, end, obc);
334     }
335 
336     public static void removeByUserId(long userId)
337         throws com.liferay.portal.SystemException {
338         getPersistence().removeByUserId(userId);
339     }
340 
341     public static void removeByGroupId(long groupId)
342         throws com.liferay.portal.SystemException {
343         getPersistence().removeByGroupId(groupId);
344     }
345 
346     public static void removeByRoleId(long roleId)
347         throws com.liferay.portal.SystemException {
348         getPersistence().removeByRoleId(roleId);
349     }
350 
351     public static void removeByU_G(long userId, long groupId)
352         throws com.liferay.portal.SystemException {
353         getPersistence().removeByU_G(userId, groupId);
354     }
355 
356     public static void removeByG_R(long groupId, long roleId)
357         throws com.liferay.portal.SystemException {
358         getPersistence().removeByG_R(groupId, roleId);
359     }
360 
361     public static void removeAll() throws com.liferay.portal.SystemException {
362         getPersistence().removeAll();
363     }
364 
365     public static int countByUserId(long userId)
366         throws com.liferay.portal.SystemException {
367         return getPersistence().countByUserId(userId);
368     }
369 
370     public static int countByGroupId(long groupId)
371         throws com.liferay.portal.SystemException {
372         return getPersistence().countByGroupId(groupId);
373     }
374 
375     public static int countByRoleId(long roleId)
376         throws com.liferay.portal.SystemException {
377         return getPersistence().countByRoleId(roleId);
378     }
379 
380     public static int countByU_G(long userId, long groupId)
381         throws com.liferay.portal.SystemException {
382         return getPersistence().countByU_G(userId, groupId);
383     }
384 
385     public static int countByG_R(long groupId, long roleId)
386         throws com.liferay.portal.SystemException {
387         return getPersistence().countByG_R(groupId, roleId);
388     }
389 
390     public static int countAll() throws com.liferay.portal.SystemException {
391         return getPersistence().countAll();
392     }
393 
394     public static UserGroupRolePersistence getPersistence() {
395         return _persistence;
396     }
397 
398     public void setPersistence(UserGroupRolePersistence persistence) {
399         _persistence = persistence;
400     }
401 
402     private static UserGroupRolePersistence _persistence;
403 }