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="OrgGroupRoleUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class OrgGroupRoleUtil {
32      public static com.liferay.portal.model.OrgGroupRole create(
33          com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK) {
34          return getPersistence().create(orgGroupRolePK);
35      }
36  
37      public static com.liferay.portal.model.OrgGroupRole remove(
38          com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK)
39          throws com.liferay.portal.SystemException,
40              com.liferay.portal.NoSuchOrgGroupRoleException {
41          return getPersistence().remove(orgGroupRolePK);
42      }
43  
44      public static com.liferay.portal.model.OrgGroupRole remove(
45          com.liferay.portal.model.OrgGroupRole orgGroupRole)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(orgGroupRole);
48      }
49  
50      /**
51       * @deprecated Use <code>update(OrgGroupRole orgGroupRole, boolean merge)</code>.
52       */
53      public static com.liferay.portal.model.OrgGroupRole update(
54          com.liferay.portal.model.OrgGroupRole orgGroupRole)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(orgGroupRole);
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        orgGroupRole 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 orgGroupRole 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.OrgGroupRole update(
73          com.liferay.portal.model.OrgGroupRole orgGroupRole, boolean merge)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(orgGroupRole, merge);
76      }
77  
78      public static com.liferay.portal.model.OrgGroupRole updateImpl(
79          com.liferay.portal.model.OrgGroupRole orgGroupRole, boolean merge)
80          throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(orgGroupRole, merge);
82      }
83  
84      public static com.liferay.portal.model.OrgGroupRole findByPrimaryKey(
85          com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK)
86          throws com.liferay.portal.SystemException,
87              com.liferay.portal.NoSuchOrgGroupRoleException {
88          return getPersistence().findByPrimaryKey(orgGroupRolePK);
89      }
90  
91      public static com.liferay.portal.model.OrgGroupRole fetchByPrimaryKey(
92          com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK)
93          throws com.liferay.portal.SystemException {
94          return getPersistence().fetchByPrimaryKey(orgGroupRolePK);
95      }
96  
97      public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByGroupId(
98          long groupId) throws com.liferay.portal.SystemException {
99          return getPersistence().findByGroupId(groupId);
100     }
101 
102     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByGroupId(
103         long groupId, int begin, int end)
104         throws com.liferay.portal.SystemException {
105         return getPersistence().findByGroupId(groupId, begin, end);
106     }
107 
108     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByGroupId(
109         long groupId, int begin, int end,
110         com.liferay.portal.kernel.util.OrderByComparator obc)
111         throws com.liferay.portal.SystemException {
112         return getPersistence().findByGroupId(groupId, begin, end, obc);
113     }
114 
115     public static com.liferay.portal.model.OrgGroupRole findByGroupId_First(
116         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
117         throws com.liferay.portal.SystemException,
118             com.liferay.portal.NoSuchOrgGroupRoleException {
119         return getPersistence().findByGroupId_First(groupId, obc);
120     }
121 
122     public static com.liferay.portal.model.OrgGroupRole findByGroupId_Last(
123         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
124         throws com.liferay.portal.SystemException,
125             com.liferay.portal.NoSuchOrgGroupRoleException {
126         return getPersistence().findByGroupId_Last(groupId, obc);
127     }
128 
129     public static com.liferay.portal.model.OrgGroupRole[] findByGroupId_PrevAndNext(
130         com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK,
131         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
132         throws com.liferay.portal.SystemException,
133             com.liferay.portal.NoSuchOrgGroupRoleException {
134         return getPersistence()
135                    .findByGroupId_PrevAndNext(orgGroupRolePK, groupId, obc);
136     }
137 
138     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByRoleId(
139         long roleId) throws com.liferay.portal.SystemException {
140         return getPersistence().findByRoleId(roleId);
141     }
142 
143     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByRoleId(
144         long roleId, int begin, int end)
145         throws com.liferay.portal.SystemException {
146         return getPersistence().findByRoleId(roleId, begin, end);
147     }
148 
149     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByRoleId(
150         long roleId, int begin, int end,
151         com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.SystemException {
153         return getPersistence().findByRoleId(roleId, begin, end, obc);
154     }
155 
156     public static com.liferay.portal.model.OrgGroupRole findByRoleId_First(
157         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
158         throws com.liferay.portal.SystemException,
159             com.liferay.portal.NoSuchOrgGroupRoleException {
160         return getPersistence().findByRoleId_First(roleId, obc);
161     }
162 
163     public static com.liferay.portal.model.OrgGroupRole findByRoleId_Last(
164         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
165         throws com.liferay.portal.SystemException,
166             com.liferay.portal.NoSuchOrgGroupRoleException {
167         return getPersistence().findByRoleId_Last(roleId, obc);
168     }
169 
170     public static com.liferay.portal.model.OrgGroupRole[] findByRoleId_PrevAndNext(
171         com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK,
172         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
173         throws com.liferay.portal.SystemException,
174             com.liferay.portal.NoSuchOrgGroupRoleException {
175         return getPersistence()
176                    .findByRoleId_PrevAndNext(orgGroupRolePK, roleId, obc);
177     }
178 
179     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findWithDynamicQuery(
180         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
181         throws com.liferay.portal.SystemException {
182         return getPersistence().findWithDynamicQuery(queryInitializer);
183     }
184 
185     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findWithDynamicQuery(
186         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
187         int begin, int end) throws com.liferay.portal.SystemException {
188         return getPersistence()
189                    .findWithDynamicQuery(queryInitializer, begin, end);
190     }
191 
192     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findAll()
193         throws com.liferay.portal.SystemException {
194         return getPersistence().findAll();
195     }
196 
197     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findAll(
198         int begin, int end) throws com.liferay.portal.SystemException {
199         return getPersistence().findAll(begin, end);
200     }
201 
202     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findAll(
203         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
204         throws com.liferay.portal.SystemException {
205         return getPersistence().findAll(begin, end, obc);
206     }
207 
208     public static void removeByGroupId(long groupId)
209         throws com.liferay.portal.SystemException {
210         getPersistence().removeByGroupId(groupId);
211     }
212 
213     public static void removeByRoleId(long roleId)
214         throws com.liferay.portal.SystemException {
215         getPersistence().removeByRoleId(roleId);
216     }
217 
218     public static void removeAll() throws com.liferay.portal.SystemException {
219         getPersistence().removeAll();
220     }
221 
222     public static int countByGroupId(long groupId)
223         throws com.liferay.portal.SystemException {
224         return getPersistence().countByGroupId(groupId);
225     }
226 
227     public static int countByRoleId(long roleId)
228         throws com.liferay.portal.SystemException {
229         return getPersistence().countByRoleId(roleId);
230     }
231 
232     public static int countAll() throws com.liferay.portal.SystemException {
233         return getPersistence().countAll();
234     }
235 
236     public static OrgGroupRolePersistence getPersistence() {
237         return _getUtil()._persistence;
238     }
239 
240     public void setPersistence(OrgGroupRolePersistence persistence) {
241         _persistence = persistence;
242     }
243 
244     private static OrgGroupRoleUtil _getUtil() {
245         if (_util == null) {
246             _util = (OrgGroupRoleUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
247         }
248 
249         return _util;
250     }
251 
252     private static final String _UTIL = OrgGroupRoleUtil.class.getName();
253     private static OrgGroupRoleUtil _util;
254     private OrgGroupRolePersistence _persistence;
255 }