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