1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="OrgGroupRoleUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class OrgGroupRoleUtil {
29      public static void cacheResult(
30          com.liferay.portal.model.OrgGroupRole orgGroupRole) {
31          getPersistence().cacheResult(orgGroupRole);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portal.model.OrgGroupRole> orgGroupRoles) {
36          getPersistence().cacheResult(orgGroupRoles);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portal.model.OrgGroupRole create(
44          com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK) {
45          return getPersistence().create(orgGroupRolePK);
46      }
47  
48      public static com.liferay.portal.model.OrgGroupRole remove(
49          com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK)
50          throws com.liferay.portal.NoSuchOrgGroupRoleException,
51              com.liferay.portal.SystemException {
52          return getPersistence().remove(orgGroupRolePK);
53      }
54  
55      public static com.liferay.portal.model.OrgGroupRole remove(
56          com.liferay.portal.model.OrgGroupRole orgGroupRole)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(orgGroupRole);
59      }
60  
61      /**
62       * @deprecated Use <code>update(OrgGroupRole orgGroupRole, boolean merge)</code>.
63       */
64      public static com.liferay.portal.model.OrgGroupRole update(
65          com.liferay.portal.model.OrgGroupRole orgGroupRole)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(orgGroupRole);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        orgGroupRole the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when orgGroupRole is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portal.model.OrgGroupRole update(
84          com.liferay.portal.model.OrgGroupRole orgGroupRole, boolean merge)
85          throws com.liferay.portal.SystemException {
86          return getPersistence().update(orgGroupRole, merge);
87      }
88  
89      public static com.liferay.portal.model.OrgGroupRole updateImpl(
90          com.liferay.portal.model.OrgGroupRole orgGroupRole, boolean merge)
91          throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(orgGroupRole, merge);
93      }
94  
95      public static com.liferay.portal.model.OrgGroupRole findByPrimaryKey(
96          com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK)
97          throws com.liferay.portal.NoSuchOrgGroupRoleException,
98              com.liferay.portal.SystemException {
99          return getPersistence().findByPrimaryKey(orgGroupRolePK);
100     }
101 
102     public static com.liferay.portal.model.OrgGroupRole fetchByPrimaryKey(
103         com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK)
104         throws com.liferay.portal.SystemException {
105         return getPersistence().fetchByPrimaryKey(orgGroupRolePK);
106     }
107 
108     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByGroupId(
109         long groupId) throws com.liferay.portal.SystemException {
110         return getPersistence().findByGroupId(groupId);
111     }
112 
113     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByGroupId(
114         long groupId, int start, int end)
115         throws com.liferay.portal.SystemException {
116         return getPersistence().findByGroupId(groupId, start, end);
117     }
118 
119     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByGroupId(
120         long groupId, int start, int end,
121         com.liferay.portal.kernel.util.OrderByComparator obc)
122         throws com.liferay.portal.SystemException {
123         return getPersistence().findByGroupId(groupId, start, end, obc);
124     }
125 
126     public static com.liferay.portal.model.OrgGroupRole findByGroupId_First(
127         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
128         throws com.liferay.portal.NoSuchOrgGroupRoleException,
129             com.liferay.portal.SystemException {
130         return getPersistence().findByGroupId_First(groupId, obc);
131     }
132 
133     public static com.liferay.portal.model.OrgGroupRole findByGroupId_Last(
134         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
135         throws com.liferay.portal.NoSuchOrgGroupRoleException,
136             com.liferay.portal.SystemException {
137         return getPersistence().findByGroupId_Last(groupId, obc);
138     }
139 
140     public static com.liferay.portal.model.OrgGroupRole[] findByGroupId_PrevAndNext(
141         com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK,
142         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
143         throws com.liferay.portal.NoSuchOrgGroupRoleException,
144             com.liferay.portal.SystemException {
145         return getPersistence()
146                    .findByGroupId_PrevAndNext(orgGroupRolePK, groupId, obc);
147     }
148 
149     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByRoleId(
150         long roleId) throws com.liferay.portal.SystemException {
151         return getPersistence().findByRoleId(roleId);
152     }
153 
154     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByRoleId(
155         long roleId, int start, int end)
156         throws com.liferay.portal.SystemException {
157         return getPersistence().findByRoleId(roleId, start, end);
158     }
159 
160     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findByRoleId(
161         long roleId, int start, int end,
162         com.liferay.portal.kernel.util.OrderByComparator obc)
163         throws com.liferay.portal.SystemException {
164         return getPersistence().findByRoleId(roleId, start, end, obc);
165     }
166 
167     public static com.liferay.portal.model.OrgGroupRole findByRoleId_First(
168         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
169         throws com.liferay.portal.NoSuchOrgGroupRoleException,
170             com.liferay.portal.SystemException {
171         return getPersistence().findByRoleId_First(roleId, obc);
172     }
173 
174     public static com.liferay.portal.model.OrgGroupRole findByRoleId_Last(
175         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
176         throws com.liferay.portal.NoSuchOrgGroupRoleException,
177             com.liferay.portal.SystemException {
178         return getPersistence().findByRoleId_Last(roleId, obc);
179     }
180 
181     public static com.liferay.portal.model.OrgGroupRole[] findByRoleId_PrevAndNext(
182         com.liferay.portal.service.persistence.OrgGroupRolePK orgGroupRolePK,
183         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
184         throws com.liferay.portal.NoSuchOrgGroupRoleException,
185             com.liferay.portal.SystemException {
186         return getPersistence()
187                    .findByRoleId_PrevAndNext(orgGroupRolePK, roleId, obc);
188     }
189 
190     public static java.util.List<Object> findWithDynamicQuery(
191         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
192         throws com.liferay.portal.SystemException {
193         return getPersistence().findWithDynamicQuery(dynamicQuery);
194     }
195 
196     public static java.util.List<Object> findWithDynamicQuery(
197         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
198         int end) throws com.liferay.portal.SystemException {
199         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
200     }
201 
202     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findAll()
203         throws com.liferay.portal.SystemException {
204         return getPersistence().findAll();
205     }
206 
207     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findAll(
208         int start, int end) throws com.liferay.portal.SystemException {
209         return getPersistence().findAll(start, end);
210     }
211 
212     public static java.util.List<com.liferay.portal.model.OrgGroupRole> findAll(
213         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
214         throws com.liferay.portal.SystemException {
215         return getPersistence().findAll(start, end, obc);
216     }
217 
218     public static void removeByGroupId(long groupId)
219         throws com.liferay.portal.SystemException {
220         getPersistence().removeByGroupId(groupId);
221     }
222 
223     public static void removeByRoleId(long roleId)
224         throws com.liferay.portal.SystemException {
225         getPersistence().removeByRoleId(roleId);
226     }
227 
228     public static void removeAll() throws com.liferay.portal.SystemException {
229         getPersistence().removeAll();
230     }
231 
232     public static int countByGroupId(long groupId)
233         throws com.liferay.portal.SystemException {
234         return getPersistence().countByGroupId(groupId);
235     }
236 
237     public static int countByRoleId(long roleId)
238         throws com.liferay.portal.SystemException {
239         return getPersistence().countByRoleId(roleId);
240     }
241 
242     public static int countAll() throws com.liferay.portal.SystemException {
243         return getPersistence().countAll();
244     }
245 
246     public static OrgGroupRolePersistence getPersistence() {
247         return _persistence;
248     }
249 
250     public void setPersistence(OrgGroupRolePersistence persistence) {
251         _persistence = persistence;
252     }
253 
254     private static OrgGroupRolePersistence _persistence;
255 }