1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  
19  /**
20   * <a href="RoleFinderUtil.java.html"><b><i>View Source</i></b></a>
21   *
22   * @author Brian Wing Shun Chan
23   */
24  public class RoleFinderUtil {
25      public static int countByR_U(long roleId, long userId)
26          throws com.liferay.portal.SystemException {
27          return getFinder().countByR_U(roleId, userId);
28      }
29  
30      public static int countByC_N_D_T(long companyId, java.lang.String name,
31          java.lang.String description, java.lang.Integer type,
32          java.util.LinkedHashMap<String, Object> params)
33          throws com.liferay.portal.SystemException {
34          return getFinder()
35                     .countByC_N_D_T(companyId, name, description, type, params);
36      }
37  
38      public static java.util.List<com.liferay.portal.model.Role> findBySystem(
39          long companyId) throws com.liferay.portal.SystemException {
40          return getFinder().findBySystem(companyId);
41      }
42  
43      public static java.util.List<com.liferay.portal.model.Role> findByUserGroupRole(
44          long userId, long groupId) throws com.liferay.portal.SystemException {
45          return getFinder().findByUserGroupRole(userId, groupId);
46      }
47  
48      public static com.liferay.portal.model.Role findByC_N(long companyId,
49          java.lang.String name)
50          throws com.liferay.portal.NoSuchRoleException,
51              com.liferay.portal.SystemException {
52          return getFinder().findByC_N(companyId, name);
53      }
54  
55      public static java.util.List<com.liferay.portal.model.Role> findByU_G(
56          long userId, long groupId) throws com.liferay.portal.SystemException {
57          return getFinder().findByU_G(userId, groupId);
58      }
59  
60      public static java.util.List<com.liferay.portal.model.Role> findByU_G(
61          long userId, long[] groupIds) throws com.liferay.portal.SystemException {
62          return getFinder().findByU_G(userId, groupIds);
63      }
64  
65      public static java.util.List<com.liferay.portal.model.Role> findByU_G(
66          long userId, java.util.List<com.liferay.portal.model.Group> groups)
67          throws com.liferay.portal.SystemException {
68          return getFinder().findByU_G(userId, groups);
69      }
70  
71      public static java.util.List<com.liferay.portal.model.Role> findByC_N_D_T(
72          long companyId, java.lang.String name, java.lang.String description,
73          java.lang.Integer type, java.util.LinkedHashMap<String, Object> params,
74          int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
75          throws com.liferay.portal.SystemException {
76          return getFinder()
77                     .findByC_N_D_T(companyId, name, description, type, params,
78              start, end, obc);
79      }
80  
81      public static java.util.Map<String, java.util.List<String>> findByC_N_S_P(
82          long companyId, java.lang.String name, int scope,
83          java.lang.String primKey) throws com.liferay.portal.SystemException {
84          return getFinder().findByC_N_S_P(companyId, name, scope, primKey);
85      }
86  
87      public static RoleFinder getFinder() {
88          if (_finder == null) {
89              _finder = (RoleFinder)PortalBeanLocatorUtil.locate(RoleFinder.class.getName());
90          }
91  
92          return _finder;
93      }
94  
95      public void setFinder(RoleFinder finder) {
96          _finder = finder;
97      }
98  
99      private static RoleFinder _finder;
100 }