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