001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.UserGroupRole;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the user group role service. This utility wraps {@link UserGroupRolePersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see UserGroupRolePersistence
036     * @see UserGroupRolePersistenceImpl
037     * @generated
038     */
039    public class UserGroupRoleUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(UserGroupRole userGroupRole) {
057                    getPersistence().clearCache(userGroupRole);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<UserGroupRole> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<UserGroupRole> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<UserGroupRole> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
098             */
099            public static UserGroupRole update(UserGroupRole userGroupRole,
100                    boolean merge) throws SystemException {
101                    return getPersistence().update(userGroupRole, merge);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
106             */
107            public static UserGroupRole update(UserGroupRole userGroupRole,
108                    boolean merge, ServiceContext serviceContext) throws SystemException {
109                    return getPersistence().update(userGroupRole, merge, serviceContext);
110            }
111    
112            /**
113            * Caches the user group role in the entity cache if it is enabled.
114            *
115            * @param userGroupRole the user group role
116            */
117            public static void cacheResult(
118                    com.liferay.portal.model.UserGroupRole userGroupRole) {
119                    getPersistence().cacheResult(userGroupRole);
120            }
121    
122            /**
123            * Caches the user group roles in the entity cache if it is enabled.
124            *
125            * @param userGroupRoles the user group roles
126            */
127            public static void cacheResult(
128                    java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles) {
129                    getPersistence().cacheResult(userGroupRoles);
130            }
131    
132            /**
133            * Creates a new user group role with the primary key. Does not add the user group role to the database.
134            *
135            * @param userGroupRolePK the primary key for the new user group role
136            * @return the new user group role
137            */
138            public static com.liferay.portal.model.UserGroupRole create(
139                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK) {
140                    return getPersistence().create(userGroupRolePK);
141            }
142    
143            /**
144            * Removes the user group role with the primary key from the database. Also notifies the appropriate model listeners.
145            *
146            * @param userGroupRolePK the primary key of the user group role
147            * @return the user group role that was removed
148            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a user group role with the primary key could not be found
149            * @throws SystemException if a system exception occurred
150            */
151            public static com.liferay.portal.model.UserGroupRole remove(
152                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
153                    throws com.liferay.portal.NoSuchUserGroupRoleException,
154                            com.liferay.portal.kernel.exception.SystemException {
155                    return getPersistence().remove(userGroupRolePK);
156            }
157    
158            public static com.liferay.portal.model.UserGroupRole updateImpl(
159                    com.liferay.portal.model.UserGroupRole userGroupRole, boolean merge)
160                    throws com.liferay.portal.kernel.exception.SystemException {
161                    return getPersistence().updateImpl(userGroupRole, merge);
162            }
163    
164            /**
165            * Returns the user group role with the primary key or throws a {@link com.liferay.portal.NoSuchUserGroupRoleException} if it could not be found.
166            *
167            * @param userGroupRolePK the primary key of the user group role
168            * @return the user group role
169            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a user group role with the primary key could not be found
170            * @throws SystemException if a system exception occurred
171            */
172            public static com.liferay.portal.model.UserGroupRole findByPrimaryKey(
173                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
174                    throws com.liferay.portal.NoSuchUserGroupRoleException,
175                            com.liferay.portal.kernel.exception.SystemException {
176                    return getPersistence().findByPrimaryKey(userGroupRolePK);
177            }
178    
179            /**
180            * Returns the user group role with the primary key or returns <code>null</code> if it could not be found.
181            *
182            * @param userGroupRolePK the primary key of the user group role
183            * @return the user group role, or <code>null</code> if a user group role with the primary key could not be found
184            * @throws SystemException if a system exception occurred
185            */
186            public static com.liferay.portal.model.UserGroupRole fetchByPrimaryKey(
187                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
188                    throws com.liferay.portal.kernel.exception.SystemException {
189                    return getPersistence().fetchByPrimaryKey(userGroupRolePK);
190            }
191    
192            /**
193            * Returns all the user group roles where userId = &#63;.
194            *
195            * @param userId the user ID
196            * @return the matching user group roles
197            * @throws SystemException if a system exception occurred
198            */
199            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByUserId(
200                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
201                    return getPersistence().findByUserId(userId);
202            }
203    
204            /**
205            * Returns a range of all the user group roles where userId = &#63;.
206            *
207            * <p>
208            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
209            * </p>
210            *
211            * @param userId the user ID
212            * @param start the lower bound of the range of user group roles
213            * @param end the upper bound of the range of user group roles (not inclusive)
214            * @return the range of matching user group roles
215            * @throws SystemException if a system exception occurred
216            */
217            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByUserId(
218                    long userId, int start, int end)
219                    throws com.liferay.portal.kernel.exception.SystemException {
220                    return getPersistence().findByUserId(userId, start, end);
221            }
222    
223            /**
224            * Returns an ordered range of all the user group roles where userId = &#63;.
225            *
226            * <p>
227            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
228            * </p>
229            *
230            * @param userId the user ID
231            * @param start the lower bound of the range of user group roles
232            * @param end the upper bound of the range of user group roles (not inclusive)
233            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
234            * @return the ordered range of matching user group roles
235            * @throws SystemException if a system exception occurred
236            */
237            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByUserId(
238                    long userId, int start, int end,
239                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
240                    throws com.liferay.portal.kernel.exception.SystemException {
241                    return getPersistence()
242                                       .findByUserId(userId, start, end, orderByComparator);
243            }
244    
245            /**
246            * Returns the first user group role in the ordered set where userId = &#63;.
247            *
248            * <p>
249            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
250            * </p>
251            *
252            * @param userId the user ID
253            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
254            * @return the first matching user group role
255            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a matching user group role could not be found
256            * @throws SystemException if a system exception occurred
257            */
258            public static com.liferay.portal.model.UserGroupRole findByUserId_First(
259                    long userId,
260                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
261                    throws com.liferay.portal.NoSuchUserGroupRoleException,
262                            com.liferay.portal.kernel.exception.SystemException {
263                    return getPersistence().findByUserId_First(userId, orderByComparator);
264            }
265    
266            /**
267            * Returns the last user group role in the ordered set where userId = &#63;.
268            *
269            * <p>
270            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
271            * </p>
272            *
273            * @param userId the user ID
274            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
275            * @return the last matching user group role
276            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a matching user group role could not be found
277            * @throws SystemException if a system exception occurred
278            */
279            public static com.liferay.portal.model.UserGroupRole findByUserId_Last(
280                    long userId,
281                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
282                    throws com.liferay.portal.NoSuchUserGroupRoleException,
283                            com.liferay.portal.kernel.exception.SystemException {
284                    return getPersistence().findByUserId_Last(userId, orderByComparator);
285            }
286    
287            /**
288            * Returns the user group roles before and after the current user group role in the ordered set where userId = &#63;.
289            *
290            * <p>
291            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
292            * </p>
293            *
294            * @param userGroupRolePK the primary key of the current user group role
295            * @param userId the user ID
296            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
297            * @return the previous, current, and next user group role
298            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a user group role with the primary key could not be found
299            * @throws SystemException if a system exception occurred
300            */
301            public static com.liferay.portal.model.UserGroupRole[] findByUserId_PrevAndNext(
302                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
303                    long userId,
304                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
305                    throws com.liferay.portal.NoSuchUserGroupRoleException,
306                            com.liferay.portal.kernel.exception.SystemException {
307                    return getPersistence()
308                                       .findByUserId_PrevAndNext(userGroupRolePK, userId,
309                            orderByComparator);
310            }
311    
312            /**
313            * Returns all the user group roles where groupId = &#63;.
314            *
315            * @param groupId the group ID
316            * @return the matching user group roles
317            * @throws SystemException if a system exception occurred
318            */
319            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByGroupId(
320                    long groupId)
321                    throws com.liferay.portal.kernel.exception.SystemException {
322                    return getPersistence().findByGroupId(groupId);
323            }
324    
325            /**
326            * Returns a range of all the user group roles where groupId = &#63;.
327            *
328            * <p>
329            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
330            * </p>
331            *
332            * @param groupId the group ID
333            * @param start the lower bound of the range of user group roles
334            * @param end the upper bound of the range of user group roles (not inclusive)
335            * @return the range of matching user group roles
336            * @throws SystemException if a system exception occurred
337            */
338            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByGroupId(
339                    long groupId, int start, int end)
340                    throws com.liferay.portal.kernel.exception.SystemException {
341                    return getPersistence().findByGroupId(groupId, start, end);
342            }
343    
344            /**
345            * Returns an ordered range of all the user group roles where groupId = &#63;.
346            *
347            * <p>
348            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
349            * </p>
350            *
351            * @param groupId the group ID
352            * @param start the lower bound of the range of user group roles
353            * @param end the upper bound of the range of user group roles (not inclusive)
354            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
355            * @return the ordered range of matching user group roles
356            * @throws SystemException if a system exception occurred
357            */
358            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByGroupId(
359                    long groupId, int start, int end,
360                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
361                    throws com.liferay.portal.kernel.exception.SystemException {
362                    return getPersistence()
363                                       .findByGroupId(groupId, start, end, orderByComparator);
364            }
365    
366            /**
367            * Returns the first user group role in the ordered set where groupId = &#63;.
368            *
369            * <p>
370            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
371            * </p>
372            *
373            * @param groupId the group ID
374            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
375            * @return the first matching user group role
376            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a matching user group role could not be found
377            * @throws SystemException if a system exception occurred
378            */
379            public static com.liferay.portal.model.UserGroupRole findByGroupId_First(
380                    long groupId,
381                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
382                    throws com.liferay.portal.NoSuchUserGroupRoleException,
383                            com.liferay.portal.kernel.exception.SystemException {
384                    return getPersistence().findByGroupId_First(groupId, orderByComparator);
385            }
386    
387            /**
388            * Returns the last user group role in the ordered set where groupId = &#63;.
389            *
390            * <p>
391            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
392            * </p>
393            *
394            * @param groupId the group ID
395            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
396            * @return the last matching user group role
397            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a matching user group role could not be found
398            * @throws SystemException if a system exception occurred
399            */
400            public static com.liferay.portal.model.UserGroupRole findByGroupId_Last(
401                    long groupId,
402                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
403                    throws com.liferay.portal.NoSuchUserGroupRoleException,
404                            com.liferay.portal.kernel.exception.SystemException {
405                    return getPersistence().findByGroupId_Last(groupId, orderByComparator);
406            }
407    
408            /**
409            * Returns the user group roles before and after the current user group role in the ordered set where groupId = &#63;.
410            *
411            * <p>
412            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
413            * </p>
414            *
415            * @param userGroupRolePK the primary key of the current user group role
416            * @param groupId the group ID
417            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
418            * @return the previous, current, and next user group role
419            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a user group role with the primary key could not be found
420            * @throws SystemException if a system exception occurred
421            */
422            public static com.liferay.portal.model.UserGroupRole[] findByGroupId_PrevAndNext(
423                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
424                    long groupId,
425                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
426                    throws com.liferay.portal.NoSuchUserGroupRoleException,
427                            com.liferay.portal.kernel.exception.SystemException {
428                    return getPersistence()
429                                       .findByGroupId_PrevAndNext(userGroupRolePK, groupId,
430                            orderByComparator);
431            }
432    
433            /**
434            * Returns all the user group roles where roleId = &#63;.
435            *
436            * @param roleId the role ID
437            * @return the matching user group roles
438            * @throws SystemException if a system exception occurred
439            */
440            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByRoleId(
441                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
442                    return getPersistence().findByRoleId(roleId);
443            }
444    
445            /**
446            * Returns a range of all the user group roles where roleId = &#63;.
447            *
448            * <p>
449            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
450            * </p>
451            *
452            * @param roleId the role ID
453            * @param start the lower bound of the range of user group roles
454            * @param end the upper bound of the range of user group roles (not inclusive)
455            * @return the range of matching user group roles
456            * @throws SystemException if a system exception occurred
457            */
458            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByRoleId(
459                    long roleId, int start, int end)
460                    throws com.liferay.portal.kernel.exception.SystemException {
461                    return getPersistence().findByRoleId(roleId, start, end);
462            }
463    
464            /**
465            * Returns an ordered range of all the user group roles where roleId = &#63;.
466            *
467            * <p>
468            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
469            * </p>
470            *
471            * @param roleId the role ID
472            * @param start the lower bound of the range of user group roles
473            * @param end the upper bound of the range of user group roles (not inclusive)
474            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
475            * @return the ordered range of matching user group roles
476            * @throws SystemException if a system exception occurred
477            */
478            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByRoleId(
479                    long roleId, int start, int end,
480                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
481                    throws com.liferay.portal.kernel.exception.SystemException {
482                    return getPersistence()
483                                       .findByRoleId(roleId, start, end, orderByComparator);
484            }
485    
486            /**
487            * Returns the first user group role in the ordered set where roleId = &#63;.
488            *
489            * <p>
490            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
491            * </p>
492            *
493            * @param roleId the role ID
494            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
495            * @return the first matching user group role
496            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a matching user group role could not be found
497            * @throws SystemException if a system exception occurred
498            */
499            public static com.liferay.portal.model.UserGroupRole findByRoleId_First(
500                    long roleId,
501                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
502                    throws com.liferay.portal.NoSuchUserGroupRoleException,
503                            com.liferay.portal.kernel.exception.SystemException {
504                    return getPersistence().findByRoleId_First(roleId, orderByComparator);
505            }
506    
507            /**
508            * Returns the last user group role in the ordered set where roleId = &#63;.
509            *
510            * <p>
511            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
512            * </p>
513            *
514            * @param roleId the role ID
515            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
516            * @return the last matching user group role
517            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a matching user group role could not be found
518            * @throws SystemException if a system exception occurred
519            */
520            public static com.liferay.portal.model.UserGroupRole findByRoleId_Last(
521                    long roleId,
522                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
523                    throws com.liferay.portal.NoSuchUserGroupRoleException,
524                            com.liferay.portal.kernel.exception.SystemException {
525                    return getPersistence().findByRoleId_Last(roleId, orderByComparator);
526            }
527    
528            /**
529            * Returns the user group roles before and after the current user group role in the ordered set where roleId = &#63;.
530            *
531            * <p>
532            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
533            * </p>
534            *
535            * @param userGroupRolePK the primary key of the current user group role
536            * @param roleId the role ID
537            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
538            * @return the previous, current, and next user group role
539            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a user group role with the primary key could not be found
540            * @throws SystemException if a system exception occurred
541            */
542            public static com.liferay.portal.model.UserGroupRole[] findByRoleId_PrevAndNext(
543                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
544                    long roleId,
545                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
546                    throws com.liferay.portal.NoSuchUserGroupRoleException,
547                            com.liferay.portal.kernel.exception.SystemException {
548                    return getPersistence()
549                                       .findByRoleId_PrevAndNext(userGroupRolePK, roleId,
550                            orderByComparator);
551            }
552    
553            /**
554            * Returns all the user group roles where userId = &#63; and groupId = &#63;.
555            *
556            * @param userId the user ID
557            * @param groupId the group ID
558            * @return the matching user group roles
559            * @throws SystemException if a system exception occurred
560            */
561            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByU_G(
562                    long userId, long groupId)
563                    throws com.liferay.portal.kernel.exception.SystemException {
564                    return getPersistence().findByU_G(userId, groupId);
565            }
566    
567            /**
568            * Returns a range of all the user group roles where userId = &#63; and groupId = &#63;.
569            *
570            * <p>
571            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
572            * </p>
573            *
574            * @param userId the user ID
575            * @param groupId the group ID
576            * @param start the lower bound of the range of user group roles
577            * @param end the upper bound of the range of user group roles (not inclusive)
578            * @return the range of matching user group roles
579            * @throws SystemException if a system exception occurred
580            */
581            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByU_G(
582                    long userId, long groupId, int start, int end)
583                    throws com.liferay.portal.kernel.exception.SystemException {
584                    return getPersistence().findByU_G(userId, groupId, start, end);
585            }
586    
587            /**
588            * Returns an ordered range of all the user group roles where userId = &#63; and groupId = &#63;.
589            *
590            * <p>
591            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
592            * </p>
593            *
594            * @param userId the user ID
595            * @param groupId the group ID
596            * @param start the lower bound of the range of user group roles
597            * @param end the upper bound of the range of user group roles (not inclusive)
598            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
599            * @return the ordered range of matching user group roles
600            * @throws SystemException if a system exception occurred
601            */
602            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByU_G(
603                    long userId, long groupId, int start, int end,
604                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
605                    throws com.liferay.portal.kernel.exception.SystemException {
606                    return getPersistence()
607                                       .findByU_G(userId, groupId, start, end, orderByComparator);
608            }
609    
610            /**
611            * Returns the first user group role in the ordered set where userId = &#63; and groupId = &#63;.
612            *
613            * <p>
614            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
615            * </p>
616            *
617            * @param userId the user ID
618            * @param groupId the group ID
619            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
620            * @return the first matching user group role
621            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a matching user group role could not be found
622            * @throws SystemException if a system exception occurred
623            */
624            public static com.liferay.portal.model.UserGroupRole findByU_G_First(
625                    long userId, long groupId,
626                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
627                    throws com.liferay.portal.NoSuchUserGroupRoleException,
628                            com.liferay.portal.kernel.exception.SystemException {
629                    return getPersistence()
630                                       .findByU_G_First(userId, groupId, orderByComparator);
631            }
632    
633            /**
634            * Returns the last user group role in the ordered set where userId = &#63; and groupId = &#63;.
635            *
636            * <p>
637            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
638            * </p>
639            *
640            * @param userId the user ID
641            * @param groupId the group ID
642            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
643            * @return the last matching user group role
644            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a matching user group role could not be found
645            * @throws SystemException if a system exception occurred
646            */
647            public static com.liferay.portal.model.UserGroupRole findByU_G_Last(
648                    long userId, long groupId,
649                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
650                    throws com.liferay.portal.NoSuchUserGroupRoleException,
651                            com.liferay.portal.kernel.exception.SystemException {
652                    return getPersistence()
653                                       .findByU_G_Last(userId, groupId, orderByComparator);
654            }
655    
656            /**
657            * Returns the user group roles before and after the current user group role in the ordered set where userId = &#63; and groupId = &#63;.
658            *
659            * <p>
660            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
661            * </p>
662            *
663            * @param userGroupRolePK the primary key of the current user group role
664            * @param userId the user ID
665            * @param groupId the group ID
666            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
667            * @return the previous, current, and next user group role
668            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a user group role with the primary key could not be found
669            * @throws SystemException if a system exception occurred
670            */
671            public static com.liferay.portal.model.UserGroupRole[] findByU_G_PrevAndNext(
672                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
673                    long userId, long groupId,
674                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
675                    throws com.liferay.portal.NoSuchUserGroupRoleException,
676                            com.liferay.portal.kernel.exception.SystemException {
677                    return getPersistence()
678                                       .findByU_G_PrevAndNext(userGroupRolePK, userId, groupId,
679                            orderByComparator);
680            }
681    
682            /**
683            * Returns all the user group roles where groupId = &#63; and roleId = &#63;.
684            *
685            * @param groupId the group ID
686            * @param roleId the role ID
687            * @return the matching user group roles
688            * @throws SystemException if a system exception occurred
689            */
690            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByG_R(
691                    long groupId, long roleId)
692                    throws com.liferay.portal.kernel.exception.SystemException {
693                    return getPersistence().findByG_R(groupId, roleId);
694            }
695    
696            /**
697            * Returns a range of all the user group roles where groupId = &#63; and roleId = &#63;.
698            *
699            * <p>
700            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
701            * </p>
702            *
703            * @param groupId the group ID
704            * @param roleId the role ID
705            * @param start the lower bound of the range of user group roles
706            * @param end the upper bound of the range of user group roles (not inclusive)
707            * @return the range of matching user group roles
708            * @throws SystemException if a system exception occurred
709            */
710            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByG_R(
711                    long groupId, long roleId, int start, int end)
712                    throws com.liferay.portal.kernel.exception.SystemException {
713                    return getPersistence().findByG_R(groupId, roleId, start, end);
714            }
715    
716            /**
717            * Returns an ordered range of all the user group roles where groupId = &#63; and roleId = &#63;.
718            *
719            * <p>
720            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
721            * </p>
722            *
723            * @param groupId the group ID
724            * @param roleId the role ID
725            * @param start the lower bound of the range of user group roles
726            * @param end the upper bound of the range of user group roles (not inclusive)
727            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
728            * @return the ordered range of matching user group roles
729            * @throws SystemException if a system exception occurred
730            */
731            public static java.util.List<com.liferay.portal.model.UserGroupRole> findByG_R(
732                    long groupId, long roleId, int start, int end,
733                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
734                    throws com.liferay.portal.kernel.exception.SystemException {
735                    return getPersistence()
736                                       .findByG_R(groupId, roleId, start, end, orderByComparator);
737            }
738    
739            /**
740            * Returns the first user group role in the ordered set where groupId = &#63; and roleId = &#63;.
741            *
742            * <p>
743            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
744            * </p>
745            *
746            * @param groupId the group ID
747            * @param roleId the role ID
748            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
749            * @return the first matching user group role
750            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a matching user group role could not be found
751            * @throws SystemException if a system exception occurred
752            */
753            public static com.liferay.portal.model.UserGroupRole findByG_R_First(
754                    long groupId, long roleId,
755                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
756                    throws com.liferay.portal.NoSuchUserGroupRoleException,
757                            com.liferay.portal.kernel.exception.SystemException {
758                    return getPersistence()
759                                       .findByG_R_First(groupId, roleId, orderByComparator);
760            }
761    
762            /**
763            * Returns the last user group role in the ordered set where groupId = &#63; and roleId = &#63;.
764            *
765            * <p>
766            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
767            * </p>
768            *
769            * @param groupId the group ID
770            * @param roleId the role ID
771            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
772            * @return the last matching user group role
773            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a matching user group role could not be found
774            * @throws SystemException if a system exception occurred
775            */
776            public static com.liferay.portal.model.UserGroupRole findByG_R_Last(
777                    long groupId, long roleId,
778                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
779                    throws com.liferay.portal.NoSuchUserGroupRoleException,
780                            com.liferay.portal.kernel.exception.SystemException {
781                    return getPersistence()
782                                       .findByG_R_Last(groupId, roleId, orderByComparator);
783            }
784    
785            /**
786            * Returns the user group roles before and after the current user group role in the ordered set where groupId = &#63; and roleId = &#63;.
787            *
788            * <p>
789            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
790            * </p>
791            *
792            * @param userGroupRolePK the primary key of the current user group role
793            * @param groupId the group ID
794            * @param roleId the role ID
795            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
796            * @return the previous, current, and next user group role
797            * @throws com.liferay.portal.NoSuchUserGroupRoleException if a user group role with the primary key could not be found
798            * @throws SystemException if a system exception occurred
799            */
800            public static com.liferay.portal.model.UserGroupRole[] findByG_R_PrevAndNext(
801                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
802                    long groupId, long roleId,
803                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
804                    throws com.liferay.portal.NoSuchUserGroupRoleException,
805                            com.liferay.portal.kernel.exception.SystemException {
806                    return getPersistence()
807                                       .findByG_R_PrevAndNext(userGroupRolePK, groupId, roleId,
808                            orderByComparator);
809            }
810    
811            /**
812            * Returns all the user group roles.
813            *
814            * @return the user group roles
815            * @throws SystemException if a system exception occurred
816            */
817            public static java.util.List<com.liferay.portal.model.UserGroupRole> findAll()
818                    throws com.liferay.portal.kernel.exception.SystemException {
819                    return getPersistence().findAll();
820            }
821    
822            /**
823            * Returns a range of all the user group roles.
824            *
825            * <p>
826            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
827            * </p>
828            *
829            * @param start the lower bound of the range of user group roles
830            * @param end the upper bound of the range of user group roles (not inclusive)
831            * @return the range of user group roles
832            * @throws SystemException if a system exception occurred
833            */
834            public static java.util.List<com.liferay.portal.model.UserGroupRole> findAll(
835                    int start, int end)
836                    throws com.liferay.portal.kernel.exception.SystemException {
837                    return getPersistence().findAll(start, end);
838            }
839    
840            /**
841            * Returns an ordered range of all the user group roles.
842            *
843            * <p>
844            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
845            * </p>
846            *
847            * @param start the lower bound of the range of user group roles
848            * @param end the upper bound of the range of user group roles (not inclusive)
849            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
850            * @return the ordered range of user group roles
851            * @throws SystemException if a system exception occurred
852            */
853            public static java.util.List<com.liferay.portal.model.UserGroupRole> findAll(
854                    int start, int end,
855                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
856                    throws com.liferay.portal.kernel.exception.SystemException {
857                    return getPersistence().findAll(start, end, orderByComparator);
858            }
859    
860            /**
861            * Removes all the user group roles where userId = &#63; from the database.
862            *
863            * @param userId the user ID
864            * @throws SystemException if a system exception occurred
865            */
866            public static void removeByUserId(long userId)
867                    throws com.liferay.portal.kernel.exception.SystemException {
868                    getPersistence().removeByUserId(userId);
869            }
870    
871            /**
872            * Removes all the user group roles where groupId = &#63; from the database.
873            *
874            * @param groupId the group ID
875            * @throws SystemException if a system exception occurred
876            */
877            public static void removeByGroupId(long groupId)
878                    throws com.liferay.portal.kernel.exception.SystemException {
879                    getPersistence().removeByGroupId(groupId);
880            }
881    
882            /**
883            * Removes all the user group roles where roleId = &#63; from the database.
884            *
885            * @param roleId the role ID
886            * @throws SystemException if a system exception occurred
887            */
888            public static void removeByRoleId(long roleId)
889                    throws com.liferay.portal.kernel.exception.SystemException {
890                    getPersistence().removeByRoleId(roleId);
891            }
892    
893            /**
894            * Removes all the user group roles where userId = &#63; and groupId = &#63; from the database.
895            *
896            * @param userId the user ID
897            * @param groupId the group ID
898            * @throws SystemException if a system exception occurred
899            */
900            public static void removeByU_G(long userId, long groupId)
901                    throws com.liferay.portal.kernel.exception.SystemException {
902                    getPersistence().removeByU_G(userId, groupId);
903            }
904    
905            /**
906            * Removes all the user group roles where groupId = &#63; and roleId = &#63; from the database.
907            *
908            * @param groupId the group ID
909            * @param roleId the role ID
910            * @throws SystemException if a system exception occurred
911            */
912            public static void removeByG_R(long groupId, long roleId)
913                    throws com.liferay.portal.kernel.exception.SystemException {
914                    getPersistence().removeByG_R(groupId, roleId);
915            }
916    
917            /**
918            * Removes all the user group roles from the database.
919            *
920            * @throws SystemException if a system exception occurred
921            */
922            public static void removeAll()
923                    throws com.liferay.portal.kernel.exception.SystemException {
924                    getPersistence().removeAll();
925            }
926    
927            /**
928            * Returns the number of user group roles where userId = &#63;.
929            *
930            * @param userId the user ID
931            * @return the number of matching user group roles
932            * @throws SystemException if a system exception occurred
933            */
934            public static int countByUserId(long userId)
935                    throws com.liferay.portal.kernel.exception.SystemException {
936                    return getPersistence().countByUserId(userId);
937            }
938    
939            /**
940            * Returns the number of user group roles where groupId = &#63;.
941            *
942            * @param groupId the group ID
943            * @return the number of matching user group roles
944            * @throws SystemException if a system exception occurred
945            */
946            public static int countByGroupId(long groupId)
947                    throws com.liferay.portal.kernel.exception.SystemException {
948                    return getPersistence().countByGroupId(groupId);
949            }
950    
951            /**
952            * Returns the number of user group roles where roleId = &#63;.
953            *
954            * @param roleId the role ID
955            * @return the number of matching user group roles
956            * @throws SystemException if a system exception occurred
957            */
958            public static int countByRoleId(long roleId)
959                    throws com.liferay.portal.kernel.exception.SystemException {
960                    return getPersistence().countByRoleId(roleId);
961            }
962    
963            /**
964            * Returns the number of user group roles where userId = &#63; and groupId = &#63;.
965            *
966            * @param userId the user ID
967            * @param groupId the group ID
968            * @return the number of matching user group roles
969            * @throws SystemException if a system exception occurred
970            */
971            public static int countByU_G(long userId, long groupId)
972                    throws com.liferay.portal.kernel.exception.SystemException {
973                    return getPersistence().countByU_G(userId, groupId);
974            }
975    
976            /**
977            * Returns the number of user group roles where groupId = &#63; and roleId = &#63;.
978            *
979            * @param groupId the group ID
980            * @param roleId the role ID
981            * @return the number of matching user group roles
982            * @throws SystemException if a system exception occurred
983            */
984            public static int countByG_R(long groupId, long roleId)
985                    throws com.liferay.portal.kernel.exception.SystemException {
986                    return getPersistence().countByG_R(groupId, roleId);
987            }
988    
989            /**
990            * Returns the number of user group roles.
991            *
992            * @return the number of user group roles
993            * @throws SystemException if a system exception occurred
994            */
995            public static int countAll()
996                    throws com.liferay.portal.kernel.exception.SystemException {
997                    return getPersistence().countAll();
998            }
999    
1000            public static UserGroupRolePersistence getPersistence() {
1001                    if (_persistence == null) {
1002                            _persistence = (UserGroupRolePersistence)PortalBeanLocatorUtil.locate(UserGroupRolePersistence.class.getName());
1003    
1004                            ReferenceRegistry.registerReference(UserGroupRoleUtil.class,
1005                                    "_persistence");
1006                    }
1007    
1008                    return _persistence;
1009            }
1010    
1011            public void setPersistence(UserGroupRolePersistence persistence) {
1012                    _persistence = persistence;
1013    
1014                    ReferenceRegistry.registerReference(UserGroupRoleUtil.class,
1015                            "_persistence");
1016            }
1017    
1018            private static UserGroupRolePersistence _persistence;
1019    }