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="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 void cacheResult(
33          com.liferay.portal.model.OrgGroupRole orgGroupRole) {
34          getPersistence().cacheResult(orgGroupRole);
35      }
36  
37      public static void cacheResult(
38          java.util.List<com.liferay.portal.model.OrgGroupRole> orgGroupRoles) {
39          getPersistence().cacheResult(orgGroupRoles);
40      }
41  
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      public static com.liferay.portal.model.OrgGroupRole create(
47          com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK) {
48          return getPersistence().create(orgGroupRolePK);
49      }
50  
51      public static com.liferay.portal.model.OrgGroupRole remove(
52          com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK)
53          throws com.liferay.portal.NoSuchOrgGroupRoleException,
54              com.liferay.portal.SystemException {
55          return getPersistence().remove(orgGroupRolePK);
56      }
57  
58      public static com.liferay.portal.model.OrgGroupRole remove(
59          com.liferay.portal.model.OrgGroupRole orgGroupRole)
60          throws com.liferay.portal.SystemException {
61          return getPersistence().remove(orgGroupRole);
62      }
63  
64      /**
65       * @deprecated Use <code>update(OrgGroupRole orgGroupRole, boolean merge)</code>.
66       */
67      public static com.liferay.portal.model.OrgGroupRole update(
68          com.liferay.portal.model.OrgGroupRole orgGroupRole)
69          throws com.liferay.portal.SystemException {
70          return getPersistence().update(orgGroupRole);
71      }
72  
73      /**
74       * Add, update, or merge, the entity. This method also calls the model
75       * listeners to trigger the proper events associated with adding, deleting,
76       * or updating an entity.
77       *
78       * @param        orgGroupRole the entity to add, update, or merge
79       * @param        merge boolean value for whether to merge the entity. The
80       *                default value is false. Setting merge to true is more
81       *                expensive and should only be true when orgGroupRole is
82       *                transient. See LEP-5473 for a detailed discussion of this
83       *                method.
84       * @return        true if the portlet can be displayed via Ajax
85       */
86      public static com.liferay.portal.model.OrgGroupRole update(
87          com.liferay.portal.model.OrgGroupRole orgGroupRole, boolean merge)
88          throws com.liferay.portal.SystemException {
89          return getPersistence().update(orgGroupRole, merge);
90      }
91  
92      public static com.liferay.portal.model.OrgGroupRole updateImpl(
93          com.liferay.portal.model.OrgGroupRole orgGroupRole, boolean merge)
94          throws com.liferay.portal.SystemException {
95          return getPersistence().updateImpl(orgGroupRole, merge);
96      }
97  
98      public static com.liferay.portal.model.OrgGroupRole findByPrimaryKey(
99          com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK)
100         throws com.liferay.portal.NoSuchOrgGroupRoleException,
101             com.liferay.portal.SystemException {
102         return getPersistence().findByPrimaryKey(orgGroupRolePK);
103     }
104 
105     public static com.liferay.portal.model.OrgGroupRole fetchByPrimaryKey(
106         com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK)
107         throws com.liferay.portal.SystemException {
108         return getPersistence().fetchByPrimaryKey(orgGroupRolePK);
109     }
110 
111     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByGroupId(
112         long groupId) throws com.liferay.portal.SystemException {
113         return getPersistence().findByGroupId(groupId);
114     }
115 
116     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByGroupId(
117         long groupId, int start, int end)
118         throws com.liferay.portal.SystemException {
119         return getPersistence().findByGroupId(groupId, start, end);
120     }
121 
122     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByGroupId(
123         long groupId, int start, int end,
124         com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.SystemException {
126         return getPersistence().findByGroupId(groupId, start, end, obc);
127     }
128 
129     public static com.liferay.portal.model.OrgGroupRole findByGroupId_First(
130         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.NoSuchOrgGroupRoleException,
132             com.liferay.portal.SystemException {
133         return getPersistence().findByGroupId_First(groupId, obc);
134     }
135 
136     public static com.liferay.portal.model.OrgGroupRole findByGroupId_Last(
137         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
138         throws com.liferay.portal.NoSuchOrgGroupRoleException,
139             com.liferay.portal.SystemException {
140         return getPersistence().findByGroupId_Last(groupId, obc);
141     }
142 
143     public static com.liferay.portal.model.OrgGroupRole[] findByGroupId_PrevAndNext(
144         com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK,
145         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
146         throws com.liferay.portal.NoSuchOrgGroupRoleException,
147             com.liferay.portal.SystemException {
148         return getPersistence()
149                    .findByGroupId_PrevAndNext(orgGroupRolePK, groupId, obc);
150     }
151 
152     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByRoleId(
153         long roleId) throws com.liferay.portal.SystemException {
154         return getPersistence().findByRoleId(roleId);
155     }
156 
157     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByRoleId(
158         long roleId, int start, int end)
159         throws com.liferay.portal.SystemException {
160         return getPersistence().findByRoleId(roleId, start, end);
161     }
162 
163     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByRoleId(
164         long roleId, int start, int end,
165         com.liferay.portal.kernel.util.OrderByComparator obc)
166         throws com.liferay.portal.SystemException {
167         return getPersistence().findByRoleId(roleId, start, end, obc);
168     }
169 
170     public static com.liferay.portal.model.OrgGroupRole findByRoleId_First(
171         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
172         throws com.liferay.portal.NoSuchOrgGroupRoleException,
173             com.liferay.portal.SystemException {
174         return getPersistence().findByRoleId_First(roleId, obc);
175     }
176 
177     public static com.liferay.portal.model.OrgGroupRole findByRoleId_Last(
178         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
179         throws com.liferay.portal.NoSuchOrgGroupRoleException,
180             com.liferay.portal.SystemException {
181         return getPersistence().findByRoleId_Last(roleId, obc);
182     }
183 
184     public static com.liferay.portal.model.OrgGroupRole[] findByRoleId_PrevAndNext(
185         com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK,
186         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
187         throws com.liferay.portal.NoSuchOrgGroupRoleException,
188             com.liferay.portal.SystemException {
189         return getPersistence()
190                    .findByRoleId_PrevAndNext(orgGroupRolePK, roleId, obc);
191     }
192 
193     public static java.util.List<Object> findWithDynamicQuery(
194         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().findWithDynamicQuery(dynamicQuery);
197     }
198 
199     public static java.util.List<Object> findWithDynamicQuery(
200         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
201         int end) throws com.liferay.portal.SystemException {
202         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
203     }
204 
205     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findAll()
206         throws com.liferay.portal.SystemException {
207         return getPersistence().findAll();
208     }
209 
210     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findAll(
211         int start, int end) throws com.liferay.portal.SystemException {
212         return getPersistence().findAll(start, end);
213     }
214 
215     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findAll(
216         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
217         throws com.liferay.portal.SystemException {
218         return getPersistence().findAll(start, end, obc);
219     }
220 
221     public static void removeByGroupId(long groupId)
222         throws com.liferay.portal.SystemException {
223         getPersistence().removeByGroupId(groupId);
224     }
225 
226     public static void removeByRoleId(long roleId)
227         throws com.liferay.portal.SystemException {
228         getPersistence().removeByRoleId(roleId);
229     }
230 
231     public static void removeAll() throws com.liferay.portal.SystemException {
232         getPersistence().removeAll();
233     }
234 
235     public static int countByGroupId(long groupId)
236         throws com.liferay.portal.SystemException {
237         return getPersistence().countByGroupId(groupId);
238     }
239 
240     public static int countByRoleId(long roleId)
241         throws com.liferay.portal.SystemException {
242         return getPersistence().countByRoleId(roleId);
243     }
244 
245     public static int countAll() throws com.liferay.portal.SystemException {
246         return getPersistence().countAll();
247     }
248 
249     public static OrgGroupRolePersistence getPersistence() {
250         return _persistence;
251     }
252 
253     public void setPersistence(OrgGroupRolePersistence persistence) {
254         _persistence = persistence;
255     }
256 
257     private static OrgGroupRolePersistence _persistence;
258 }