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