001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.model.Role;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import java.util.List;
025    
026    /**
027     * The persistence utility for the role service.
028     *
029     * <p>
030     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class.
031     * </p>
032     *
033     * @author Brian Wing Shun Chan
034     * @see RolePersistence
035     * @see RolePersistenceImpl
036     * @generated
037     */
038    public class RoleUtil {
039            /**
040             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
041             */
042            public static void clearCache() {
043                    getPersistence().clearCache();
044            }
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
048             */
049            public static void clearCache(Role role) {
050                    getPersistence().clearCache(role);
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
055             */
056            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
057                    throws SystemException {
058                    return getPersistence().countWithDynamicQuery(dynamicQuery);
059            }
060    
061            /**
062             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
063             */
064            public static List<Role> findWithDynamicQuery(DynamicQuery dynamicQuery)
065                    throws SystemException {
066                    return getPersistence().findWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
071             */
072            public static List<Role> findWithDynamicQuery(DynamicQuery dynamicQuery,
073                    int start, int end) throws SystemException {
074                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
075            }
076    
077            /**
078             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
079             */
080            public static List<Role> findWithDynamicQuery(DynamicQuery dynamicQuery,
081                    int start, int end, OrderByComparator orderByComparator)
082                    throws SystemException {
083                    return getPersistence()
084                                       .findWithDynamicQuery(dynamicQuery, start, end,
085                            orderByComparator);
086            }
087    
088            /**
089             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
090             */
091            public static Role remove(Role role) throws SystemException {
092                    return getPersistence().remove(role);
093            }
094    
095            /**
096             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
097             */
098            public static Role update(Role role, boolean merge)
099                    throws SystemException {
100                    return getPersistence().update(role, merge);
101            }
102    
103            /**
104             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
105             */
106            public static Role update(Role role, boolean merge,
107                    ServiceContext serviceContext) throws SystemException {
108                    return getPersistence().update(role, merge, serviceContext);
109            }
110    
111            /**
112            * Caches the role in the entity cache if it is enabled.
113            *
114            * @param role the role to cache
115            */
116            public static void cacheResult(com.liferay.portal.model.Role role) {
117                    getPersistence().cacheResult(role);
118            }
119    
120            /**
121            * Caches the roles in the entity cache if it is enabled.
122            *
123            * @param roles the roles to cache
124            */
125            public static void cacheResult(
126                    java.util.List<com.liferay.portal.model.Role> roles) {
127                    getPersistence().cacheResult(roles);
128            }
129    
130            /**
131            * Creates a new role with the primary key.
132            *
133            * @param roleId the primary key for the new role
134            * @return the new role
135            */
136            public static com.liferay.portal.model.Role create(long roleId) {
137                    return getPersistence().create(roleId);
138            }
139    
140            /**
141            * Removes the role with the primary key from the database. Also notifies the appropriate model listeners.
142            *
143            * @param roleId the primary key of the role to remove
144            * @return the role that was removed
145            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
146            * @throws SystemException if a system exception occurred
147            */
148            public static com.liferay.portal.model.Role remove(long roleId)
149                    throws com.liferay.portal.NoSuchRoleException,
150                            com.liferay.portal.kernel.exception.SystemException {
151                    return getPersistence().remove(roleId);
152            }
153    
154            public static com.liferay.portal.model.Role updateImpl(
155                    com.liferay.portal.model.Role role, boolean merge)
156                    throws com.liferay.portal.kernel.exception.SystemException {
157                    return getPersistence().updateImpl(role, merge);
158            }
159    
160            /**
161            * Finds the role with the primary key or throws a {@link com.liferay.portal.NoSuchRoleException} if it could not be found.
162            *
163            * @param roleId the primary key of the role to find
164            * @return the role
165            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
166            * @throws SystemException if a system exception occurred
167            */
168            public static com.liferay.portal.model.Role findByPrimaryKey(long roleId)
169                    throws com.liferay.portal.NoSuchRoleException,
170                            com.liferay.portal.kernel.exception.SystemException {
171                    return getPersistence().findByPrimaryKey(roleId);
172            }
173    
174            /**
175            * Finds the role with the primary key or returns <code>null</code> if it could not be found.
176            *
177            * @param roleId the primary key of the role to find
178            * @return the role, or <code>null</code> if a role with the primary key could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public static com.liferay.portal.model.Role fetchByPrimaryKey(long roleId)
182                    throws com.liferay.portal.kernel.exception.SystemException {
183                    return getPersistence().fetchByPrimaryKey(roleId);
184            }
185    
186            /**
187            * Finds all the roles where companyId = &#63;.
188            *
189            * @param companyId the company id to search with
190            * @return the matching roles
191            * @throws SystemException if a system exception occurred
192            */
193            public static java.util.List<com.liferay.portal.model.Role> findByCompanyId(
194                    long companyId)
195                    throws com.liferay.portal.kernel.exception.SystemException {
196                    return getPersistence().findByCompanyId(companyId);
197            }
198    
199            /**
200            * Finds a range of all the roles where companyId = &#63;.
201            *
202            * <p>
203            * 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.
204            * </p>
205            *
206            * @param companyId the company id to search with
207            * @param start the lower bound of the range of roles to return
208            * @param end the upper bound of the range of roles to return (not inclusive)
209            * @return the range of matching roles
210            * @throws SystemException if a system exception occurred
211            */
212            public static java.util.List<com.liferay.portal.model.Role> findByCompanyId(
213                    long companyId, int start, int end)
214                    throws com.liferay.portal.kernel.exception.SystemException {
215                    return getPersistence().findByCompanyId(companyId, start, end);
216            }
217    
218            /**
219            * Finds an ordered range of all the roles where companyId = &#63;.
220            *
221            * <p>
222            * 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.
223            * </p>
224            *
225            * @param companyId the company id to search with
226            * @param start the lower bound of the range of roles to return
227            * @param end the upper bound of the range of roles to return (not inclusive)
228            * @param orderByComparator the comparator to order the results by
229            * @return the ordered range of matching roles
230            * @throws SystemException if a system exception occurred
231            */
232            public static java.util.List<com.liferay.portal.model.Role> findByCompanyId(
233                    long companyId, int start, int end,
234                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
235                    throws com.liferay.portal.kernel.exception.SystemException {
236                    return getPersistence()
237                                       .findByCompanyId(companyId, start, end, orderByComparator);
238            }
239    
240            /**
241            * Finds the first role in the ordered set where companyId = &#63;.
242            *
243            * <p>
244            * 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.
245            * </p>
246            *
247            * @param companyId the company id to search with
248            * @param orderByComparator the comparator to order the set by
249            * @return the first matching role
250            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
251            * @throws SystemException if a system exception occurred
252            */
253            public static com.liferay.portal.model.Role findByCompanyId_First(
254                    long companyId,
255                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
256                    throws com.liferay.portal.NoSuchRoleException,
257                            com.liferay.portal.kernel.exception.SystemException {
258                    return getPersistence()
259                                       .findByCompanyId_First(companyId, orderByComparator);
260            }
261    
262            /**
263            * Finds the last role in the ordered set where companyId = &#63;.
264            *
265            * <p>
266            * 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.
267            * </p>
268            *
269            * @param companyId the company id to search with
270            * @param orderByComparator the comparator to order the set by
271            * @return the last matching role
272            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
273            * @throws SystemException if a system exception occurred
274            */
275            public static com.liferay.portal.model.Role findByCompanyId_Last(
276                    long companyId,
277                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
278                    throws com.liferay.portal.NoSuchRoleException,
279                            com.liferay.portal.kernel.exception.SystemException {
280                    return getPersistence()
281                                       .findByCompanyId_Last(companyId, orderByComparator);
282            }
283    
284            /**
285            * Finds the roles before and after the current role in the ordered set where companyId = &#63;.
286            *
287            * <p>
288            * 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.
289            * </p>
290            *
291            * @param roleId the primary key of the current role
292            * @param companyId the company id to search with
293            * @param orderByComparator the comparator to order the set by
294            * @return the previous, current, and next role
295            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
296            * @throws SystemException if a system exception occurred
297            */
298            public static com.liferay.portal.model.Role[] findByCompanyId_PrevAndNext(
299                    long roleId, long companyId,
300                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
301                    throws com.liferay.portal.NoSuchRoleException,
302                            com.liferay.portal.kernel.exception.SystemException {
303                    return getPersistence()
304                                       .findByCompanyId_PrevAndNext(roleId, companyId,
305                            orderByComparator);
306            }
307    
308            /**
309            * Finds all the roles where subtype = &#63;.
310            *
311            * @param subtype the subtype to search with
312            * @return the matching roles
313            * @throws SystemException if a system exception occurred
314            */
315            public static java.util.List<com.liferay.portal.model.Role> findBySubtype(
316                    java.lang.String subtype)
317                    throws com.liferay.portal.kernel.exception.SystemException {
318                    return getPersistence().findBySubtype(subtype);
319            }
320    
321            /**
322            * Finds a range of all the roles where subtype = &#63;.
323            *
324            * <p>
325            * 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.
326            * </p>
327            *
328            * @param subtype the subtype to search with
329            * @param start the lower bound of the range of roles to return
330            * @param end the upper bound of the range of roles to return (not inclusive)
331            * @return the range of matching roles
332            * @throws SystemException if a system exception occurred
333            */
334            public static java.util.List<com.liferay.portal.model.Role> findBySubtype(
335                    java.lang.String subtype, int start, int end)
336                    throws com.liferay.portal.kernel.exception.SystemException {
337                    return getPersistence().findBySubtype(subtype, start, end);
338            }
339    
340            /**
341            * Finds an ordered range of all the roles where subtype = &#63;.
342            *
343            * <p>
344            * 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.
345            * </p>
346            *
347            * @param subtype the subtype to search with
348            * @param start the lower bound of the range of roles to return
349            * @param end the upper bound of the range of roles to return (not inclusive)
350            * @param orderByComparator the comparator to order the results by
351            * @return the ordered range of matching roles
352            * @throws SystemException if a system exception occurred
353            */
354            public static java.util.List<com.liferay.portal.model.Role> findBySubtype(
355                    java.lang.String subtype, int start, int end,
356                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
357                    throws com.liferay.portal.kernel.exception.SystemException {
358                    return getPersistence()
359                                       .findBySubtype(subtype, start, end, orderByComparator);
360            }
361    
362            /**
363            * Finds the first role in the ordered set where subtype = &#63;.
364            *
365            * <p>
366            * 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.
367            * </p>
368            *
369            * @param subtype the subtype to search with
370            * @param orderByComparator the comparator to order the set by
371            * @return the first matching role
372            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
373            * @throws SystemException if a system exception occurred
374            */
375            public static com.liferay.portal.model.Role findBySubtype_First(
376                    java.lang.String subtype,
377                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
378                    throws com.liferay.portal.NoSuchRoleException,
379                            com.liferay.portal.kernel.exception.SystemException {
380                    return getPersistence().findBySubtype_First(subtype, orderByComparator);
381            }
382    
383            /**
384            * Finds the last role in the ordered set where subtype = &#63;.
385            *
386            * <p>
387            * 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.
388            * </p>
389            *
390            * @param subtype the subtype to search with
391            * @param orderByComparator the comparator to order the set by
392            * @return the last matching role
393            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
394            * @throws SystemException if a system exception occurred
395            */
396            public static com.liferay.portal.model.Role findBySubtype_Last(
397                    java.lang.String subtype,
398                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
399                    throws com.liferay.portal.NoSuchRoleException,
400                            com.liferay.portal.kernel.exception.SystemException {
401                    return getPersistence().findBySubtype_Last(subtype, orderByComparator);
402            }
403    
404            /**
405            * Finds the roles before and after the current role in the ordered set where subtype = &#63;.
406            *
407            * <p>
408            * 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.
409            * </p>
410            *
411            * @param roleId the primary key of the current role
412            * @param subtype the subtype to search with
413            * @param orderByComparator the comparator to order the set by
414            * @return the previous, current, and next role
415            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
416            * @throws SystemException if a system exception occurred
417            */
418            public static com.liferay.portal.model.Role[] findBySubtype_PrevAndNext(
419                    long roleId, java.lang.String subtype,
420                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
421                    throws com.liferay.portal.NoSuchRoleException,
422                            com.liferay.portal.kernel.exception.SystemException {
423                    return getPersistence()
424                                       .findBySubtype_PrevAndNext(roleId, subtype, orderByComparator);
425            }
426    
427            /**
428            * Finds the role where companyId = &#63; and name = &#63; or throws a {@link com.liferay.portal.NoSuchRoleException} if it could not be found.
429            *
430            * @param companyId the company id to search with
431            * @param name the name to search with
432            * @return the matching role
433            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
434            * @throws SystemException if a system exception occurred
435            */
436            public static com.liferay.portal.model.Role findByC_N(long companyId,
437                    java.lang.String name)
438                    throws com.liferay.portal.NoSuchRoleException,
439                            com.liferay.portal.kernel.exception.SystemException {
440                    return getPersistence().findByC_N(companyId, name);
441            }
442    
443            /**
444            * Finds the role where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
445            *
446            * @param companyId the company id to search with
447            * @param name the name to search with
448            * @return the matching role, or <code>null</code> if a matching role could not be found
449            * @throws SystemException if a system exception occurred
450            */
451            public static com.liferay.portal.model.Role fetchByC_N(long companyId,
452                    java.lang.String name)
453                    throws com.liferay.portal.kernel.exception.SystemException {
454                    return getPersistence().fetchByC_N(companyId, name);
455            }
456    
457            /**
458            * Finds the role where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
459            *
460            * @param companyId the company id to search with
461            * @param name the name to search with
462            * @return the matching role, or <code>null</code> if a matching role could not be found
463            * @throws SystemException if a system exception occurred
464            */
465            public static com.liferay.portal.model.Role fetchByC_N(long companyId,
466                    java.lang.String name, boolean retrieveFromCache)
467                    throws com.liferay.portal.kernel.exception.SystemException {
468                    return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
469            }
470    
471            /**
472            * Finds all the roles where type = &#63; and subtype = &#63;.
473            *
474            * @param type the type to search with
475            * @param subtype the subtype to search with
476            * @return the matching roles
477            * @throws SystemException if a system exception occurred
478            */
479            public static java.util.List<com.liferay.portal.model.Role> findByT_S(
480                    int type, java.lang.String subtype)
481                    throws com.liferay.portal.kernel.exception.SystemException {
482                    return getPersistence().findByT_S(type, subtype);
483            }
484    
485            /**
486            * Finds a range of all the roles where type = &#63; and subtype = &#63;.
487            *
488            * <p>
489            * 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.
490            * </p>
491            *
492            * @param type the type to search with
493            * @param subtype the subtype to search with
494            * @param start the lower bound of the range of roles to return
495            * @param end the upper bound of the range of roles to return (not inclusive)
496            * @return the range of matching roles
497            * @throws SystemException if a system exception occurred
498            */
499            public static java.util.List<com.liferay.portal.model.Role> findByT_S(
500                    int type, java.lang.String subtype, int start, int end)
501                    throws com.liferay.portal.kernel.exception.SystemException {
502                    return getPersistence().findByT_S(type, subtype, start, end);
503            }
504    
505            /**
506            * Finds an ordered range of all the roles where type = &#63; and subtype = &#63;.
507            *
508            * <p>
509            * 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.
510            * </p>
511            *
512            * @param type the type to search with
513            * @param subtype the subtype to search with
514            * @param start the lower bound of the range of roles to return
515            * @param end the upper bound of the range of roles to return (not inclusive)
516            * @param orderByComparator the comparator to order the results by
517            * @return the ordered range of matching roles
518            * @throws SystemException if a system exception occurred
519            */
520            public static java.util.List<com.liferay.portal.model.Role> findByT_S(
521                    int type, java.lang.String subtype, int start, int end,
522                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
523                    throws com.liferay.portal.kernel.exception.SystemException {
524                    return getPersistence()
525                                       .findByT_S(type, subtype, start, end, orderByComparator);
526            }
527    
528            /**
529            * Finds the first role in the ordered set where type = &#63; and subtype = &#63;.
530            *
531            * <p>
532            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
533            * </p>
534            *
535            * @param type the type to search with
536            * @param subtype the subtype to search with
537            * @param orderByComparator the comparator to order the set by
538            * @return the first matching role
539            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
540            * @throws SystemException if a system exception occurred
541            */
542            public static com.liferay.portal.model.Role findByT_S_First(int type,
543                    java.lang.String subtype,
544                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
545                    throws com.liferay.portal.NoSuchRoleException,
546                            com.liferay.portal.kernel.exception.SystemException {
547                    return getPersistence().findByT_S_First(type, subtype, orderByComparator);
548            }
549    
550            /**
551            * Finds the last role in the ordered set where type = &#63; and subtype = &#63;.
552            *
553            * <p>
554            * 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.
555            * </p>
556            *
557            * @param type the type to search with
558            * @param subtype the subtype to search with
559            * @param orderByComparator the comparator to order the set by
560            * @return the last matching role
561            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
562            * @throws SystemException if a system exception occurred
563            */
564            public static com.liferay.portal.model.Role findByT_S_Last(int type,
565                    java.lang.String subtype,
566                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
567                    throws com.liferay.portal.NoSuchRoleException,
568                            com.liferay.portal.kernel.exception.SystemException {
569                    return getPersistence().findByT_S_Last(type, subtype, orderByComparator);
570            }
571    
572            /**
573            * Finds the roles before and after the current role in the ordered set where type = &#63; and subtype = &#63;.
574            *
575            * <p>
576            * 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.
577            * </p>
578            *
579            * @param roleId the primary key of the current role
580            * @param type the type to search with
581            * @param subtype the subtype to search with
582            * @param orderByComparator the comparator to order the set by
583            * @return the previous, current, and next role
584            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
585            * @throws SystemException if a system exception occurred
586            */
587            public static com.liferay.portal.model.Role[] findByT_S_PrevAndNext(
588                    long roleId, int type, java.lang.String subtype,
589                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
590                    throws com.liferay.portal.NoSuchRoleException,
591                            com.liferay.portal.kernel.exception.SystemException {
592                    return getPersistence()
593                                       .findByT_S_PrevAndNext(roleId, type, subtype,
594                            orderByComparator);
595            }
596    
597            /**
598            * Finds the role where companyId = &#63; and classNameId = &#63; and classPK = &#63; or throws a {@link com.liferay.portal.NoSuchRoleException} if it could not be found.
599            *
600            * @param companyId the company id to search with
601            * @param classNameId the class name id to search with
602            * @param classPK the class p k to search with
603            * @return the matching role
604            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
605            * @throws SystemException if a system exception occurred
606            */
607            public static com.liferay.portal.model.Role findByC_C_C(long companyId,
608                    long classNameId, long classPK)
609                    throws com.liferay.portal.NoSuchRoleException,
610                            com.liferay.portal.kernel.exception.SystemException {
611                    return getPersistence().findByC_C_C(companyId, classNameId, classPK);
612            }
613    
614            /**
615            * Finds the role where companyId = &#63; and classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
616            *
617            * @param companyId the company id to search with
618            * @param classNameId the class name id to search with
619            * @param classPK the class p k to search with
620            * @return the matching role, or <code>null</code> if a matching role could not be found
621            * @throws SystemException if a system exception occurred
622            */
623            public static com.liferay.portal.model.Role fetchByC_C_C(long companyId,
624                    long classNameId, long classPK)
625                    throws com.liferay.portal.kernel.exception.SystemException {
626                    return getPersistence().fetchByC_C_C(companyId, classNameId, classPK);
627            }
628    
629            /**
630            * Finds the role where companyId = &#63; and classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
631            *
632            * @param companyId the company id to search with
633            * @param classNameId the class name id to search with
634            * @param classPK the class p k to search with
635            * @return the matching role, or <code>null</code> if a matching role could not be found
636            * @throws SystemException if a system exception occurred
637            */
638            public static com.liferay.portal.model.Role fetchByC_C_C(long companyId,
639                    long classNameId, long classPK, boolean retrieveFromCache)
640                    throws com.liferay.portal.kernel.exception.SystemException {
641                    return getPersistence()
642                                       .fetchByC_C_C(companyId, classNameId, classPK,
643                            retrieveFromCache);
644            }
645    
646            /**
647            * Finds all the roles.
648            *
649            * @return the roles
650            * @throws SystemException if a system exception occurred
651            */
652            public static java.util.List<com.liferay.portal.model.Role> findAll()
653                    throws com.liferay.portal.kernel.exception.SystemException {
654                    return getPersistence().findAll();
655            }
656    
657            /**
658            * Finds a range of all the roles.
659            *
660            * <p>
661            * 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.
662            * </p>
663            *
664            * @param start the lower bound of the range of roles to return
665            * @param end the upper bound of the range of roles to return (not inclusive)
666            * @return the range of roles
667            * @throws SystemException if a system exception occurred
668            */
669            public static java.util.List<com.liferay.portal.model.Role> findAll(
670                    int start, int end)
671                    throws com.liferay.portal.kernel.exception.SystemException {
672                    return getPersistence().findAll(start, end);
673            }
674    
675            /**
676            * Finds an ordered range of all the roles.
677            *
678            * <p>
679            * 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.
680            * </p>
681            *
682            * @param start the lower bound of the range of roles to return
683            * @param end the upper bound of the range of roles to return (not inclusive)
684            * @param orderByComparator the comparator to order the results by
685            * @return the ordered range of roles
686            * @throws SystemException if a system exception occurred
687            */
688            public static java.util.List<com.liferay.portal.model.Role> findAll(
689                    int start, int end,
690                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
691                    throws com.liferay.portal.kernel.exception.SystemException {
692                    return getPersistence().findAll(start, end, orderByComparator);
693            }
694    
695            /**
696            * Removes all the roles where companyId = &#63; from the database.
697            *
698            * @param companyId the company id to search with
699            * @throws SystemException if a system exception occurred
700            */
701            public static void removeByCompanyId(long companyId)
702                    throws com.liferay.portal.kernel.exception.SystemException {
703                    getPersistence().removeByCompanyId(companyId);
704            }
705    
706            /**
707            * Removes all the roles where subtype = &#63; from the database.
708            *
709            * @param subtype the subtype to search with
710            * @throws SystemException if a system exception occurred
711            */
712            public static void removeBySubtype(java.lang.String subtype)
713                    throws com.liferay.portal.kernel.exception.SystemException {
714                    getPersistence().removeBySubtype(subtype);
715            }
716    
717            /**
718            * Removes the role where companyId = &#63; and name = &#63; from the database.
719            *
720            * @param companyId the company id to search with
721            * @param name the name to search with
722            * @throws SystemException if a system exception occurred
723            */
724            public static void removeByC_N(long companyId, java.lang.String name)
725                    throws com.liferay.portal.NoSuchRoleException,
726                            com.liferay.portal.kernel.exception.SystemException {
727                    getPersistence().removeByC_N(companyId, name);
728            }
729    
730            /**
731            * Removes all the roles where type = &#63; and subtype = &#63; from the database.
732            *
733            * @param type the type to search with
734            * @param subtype the subtype to search with
735            * @throws SystemException if a system exception occurred
736            */
737            public static void removeByT_S(int type, java.lang.String subtype)
738                    throws com.liferay.portal.kernel.exception.SystemException {
739                    getPersistence().removeByT_S(type, subtype);
740            }
741    
742            /**
743            * Removes the role where companyId = &#63; and classNameId = &#63; and classPK = &#63; from the database.
744            *
745            * @param companyId the company id to search with
746            * @param classNameId the class name id to search with
747            * @param classPK the class p k to search with
748            * @throws SystemException if a system exception occurred
749            */
750            public static void removeByC_C_C(long companyId, long classNameId,
751                    long classPK)
752                    throws com.liferay.portal.NoSuchRoleException,
753                            com.liferay.portal.kernel.exception.SystemException {
754                    getPersistence().removeByC_C_C(companyId, classNameId, classPK);
755            }
756    
757            /**
758            * Removes all the roles from the database.
759            *
760            * @throws SystemException if a system exception occurred
761            */
762            public static void removeAll()
763                    throws com.liferay.portal.kernel.exception.SystemException {
764                    getPersistence().removeAll();
765            }
766    
767            /**
768            * Counts all the roles where companyId = &#63;.
769            *
770            * @param companyId the company id to search with
771            * @return the number of matching roles
772            * @throws SystemException if a system exception occurred
773            */
774            public static int countByCompanyId(long companyId)
775                    throws com.liferay.portal.kernel.exception.SystemException {
776                    return getPersistence().countByCompanyId(companyId);
777            }
778    
779            /**
780            * Counts all the roles where subtype = &#63;.
781            *
782            * @param subtype the subtype to search with
783            * @return the number of matching roles
784            * @throws SystemException if a system exception occurred
785            */
786            public static int countBySubtype(java.lang.String subtype)
787                    throws com.liferay.portal.kernel.exception.SystemException {
788                    return getPersistence().countBySubtype(subtype);
789            }
790    
791            /**
792            * Counts all the roles where companyId = &#63; and name = &#63;.
793            *
794            * @param companyId the company id to search with
795            * @param name the name to search with
796            * @return the number of matching roles
797            * @throws SystemException if a system exception occurred
798            */
799            public static int countByC_N(long companyId, java.lang.String name)
800                    throws com.liferay.portal.kernel.exception.SystemException {
801                    return getPersistence().countByC_N(companyId, name);
802            }
803    
804            /**
805            * Counts all the roles where type = &#63; and subtype = &#63;.
806            *
807            * @param type the type to search with
808            * @param subtype the subtype to search with
809            * @return the number of matching roles
810            * @throws SystemException if a system exception occurred
811            */
812            public static int countByT_S(int type, java.lang.String subtype)
813                    throws com.liferay.portal.kernel.exception.SystemException {
814                    return getPersistence().countByT_S(type, subtype);
815            }
816    
817            /**
818            * Counts all the roles where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
819            *
820            * @param companyId the company id to search with
821            * @param classNameId the class name id to search with
822            * @param classPK the class p k to search with
823            * @return the number of matching roles
824            * @throws SystemException if a system exception occurred
825            */
826            public static int countByC_C_C(long companyId, long classNameId,
827                    long classPK)
828                    throws com.liferay.portal.kernel.exception.SystemException {
829                    return getPersistence().countByC_C_C(companyId, classNameId, classPK);
830            }
831    
832            /**
833            * Counts all the roles.
834            *
835            * @return the number of roles
836            * @throws SystemException if a system exception occurred
837            */
838            public static int countAll()
839                    throws com.liferay.portal.kernel.exception.SystemException {
840                    return getPersistence().countAll();
841            }
842    
843            /**
844            * Gets all the groups associated with the role.
845            *
846            * @param pk the primary key of the role to get the associated groups for
847            * @return the groups associated with the role
848            * @throws SystemException if a system exception occurred
849            */
850            public static java.util.List<com.liferay.portal.model.Group> getGroups(
851                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
852                    return getPersistence().getGroups(pk);
853            }
854    
855            /**
856            * Gets a range of all the groups associated with the role.
857            *
858            * <p>
859            * 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.
860            * </p>
861            *
862            * @param pk the primary key of the role to get the associated groups for
863            * @param start the lower bound of the range of roles to return
864            * @param end the upper bound of the range of roles to return (not inclusive)
865            * @return the range of groups associated with the role
866            * @throws SystemException if a system exception occurred
867            */
868            public static java.util.List<com.liferay.portal.model.Group> getGroups(
869                    long pk, int start, int end)
870                    throws com.liferay.portal.kernel.exception.SystemException {
871                    return getPersistence().getGroups(pk, start, end);
872            }
873    
874            /**
875            * Gets an ordered range of all the groups associated with the role.
876            *
877            * <p>
878            * 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.
879            * </p>
880            *
881            * @param pk the primary key of the role to get the associated groups for
882            * @param start the lower bound of the range of roles to return
883            * @param end the upper bound of the range of roles to return (not inclusive)
884            * @param orderByComparator the comparator to order the results by
885            * @return the ordered range of groups associated with the role
886            * @throws SystemException if a system exception occurred
887            */
888            public static java.util.List<com.liferay.portal.model.Group> getGroups(
889                    long pk, int start, int end,
890                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
891                    throws com.liferay.portal.kernel.exception.SystemException {
892                    return getPersistence().getGroups(pk, start, end, orderByComparator);
893            }
894    
895            /**
896            * Gets the number of groups associated with the role.
897            *
898            * @param pk the primary key of the role to get the number of associated groups for
899            * @return the number of groups associated with the role
900            * @throws SystemException if a system exception occurred
901            */
902            public static int getGroupsSize(long pk)
903                    throws com.liferay.portal.kernel.exception.SystemException {
904                    return getPersistence().getGroupsSize(pk);
905            }
906    
907            /**
908            * Determines whether the group is associated with the role.
909            *
910            * @param pk the primary key of the role
911            * @param groupPK the primary key of the group
912            * @return whether the group is associated with the role
913            * @throws SystemException if a system exception occurred
914            */
915            public static boolean containsGroup(long pk, long groupPK)
916                    throws com.liferay.portal.kernel.exception.SystemException {
917                    return getPersistence().containsGroup(pk, groupPK);
918            }
919    
920            /**
921            * Determines whether the role has any groups associated with it.
922            *
923            * @param pk the primary key of the role to check for associations with groups
924            * @return whether the role has any groups associated with it
925            * @throws SystemException if a system exception occurred
926            */
927            public static boolean containsGroups(long pk)
928                    throws com.liferay.portal.kernel.exception.SystemException {
929                    return getPersistence().containsGroups(pk);
930            }
931    
932            /**
933            * Adds an association between the role and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
934            *
935            * @param pk the primary key of the role
936            * @param groupPK the primary key of the group
937            * @throws SystemException if a system exception occurred
938            */
939            public static void addGroup(long pk, long groupPK)
940                    throws com.liferay.portal.kernel.exception.SystemException {
941                    getPersistence().addGroup(pk, groupPK);
942            }
943    
944            /**
945            * Adds an association between the role and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
946            *
947            * @param pk the primary key of the role
948            * @param group the group
949            * @throws SystemException if a system exception occurred
950            */
951            public static void addGroup(long pk, com.liferay.portal.model.Group group)
952                    throws com.liferay.portal.kernel.exception.SystemException {
953                    getPersistence().addGroup(pk, group);
954            }
955    
956            /**
957            * Adds an association between the role and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
958            *
959            * @param pk the primary key of the role
960            * @param groupPKs the primary keys of the groups
961            * @throws SystemException if a system exception occurred
962            */
963            public static void addGroups(long pk, long[] groupPKs)
964                    throws com.liferay.portal.kernel.exception.SystemException {
965                    getPersistence().addGroups(pk, groupPKs);
966            }
967    
968            /**
969            * Adds an association between the role and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
970            *
971            * @param pk the primary key of the role
972            * @param groups the groups
973            * @throws SystemException if a system exception occurred
974            */
975            public static void addGroups(long pk,
976                    java.util.List<com.liferay.portal.model.Group> groups)
977                    throws com.liferay.portal.kernel.exception.SystemException {
978                    getPersistence().addGroups(pk, groups);
979            }
980    
981            /**
982            * Clears all associations between the role and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
983            *
984            * @param pk the primary key of the role to clear the associated groups from
985            * @throws SystemException if a system exception occurred
986            */
987            public static void clearGroups(long pk)
988                    throws com.liferay.portal.kernel.exception.SystemException {
989                    getPersistence().clearGroups(pk);
990            }
991    
992            /**
993            * Removes the association between the role and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
994            *
995            * @param pk the primary key of the role
996            * @param groupPK the primary key of the group
997            * @throws SystemException if a system exception occurred
998            */
999            public static void removeGroup(long pk, long groupPK)
1000                    throws com.liferay.portal.kernel.exception.SystemException {
1001                    getPersistence().removeGroup(pk, groupPK);
1002            }
1003    
1004            /**
1005            * Removes the association between the role and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1006            *
1007            * @param pk the primary key of the role
1008            * @param group the group
1009            * @throws SystemException if a system exception occurred
1010            */
1011            public static void removeGroup(long pk, com.liferay.portal.model.Group group)
1012                    throws com.liferay.portal.kernel.exception.SystemException {
1013                    getPersistence().removeGroup(pk, group);
1014            }
1015    
1016            /**
1017            * Removes the association between the role and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1018            *
1019            * @param pk the primary key of the role
1020            * @param groupPKs the primary keys of the groups
1021            * @throws SystemException if a system exception occurred
1022            */
1023            public static void removeGroups(long pk, long[] groupPKs)
1024                    throws com.liferay.portal.kernel.exception.SystemException {
1025                    getPersistence().removeGroups(pk, groupPKs);
1026            }
1027    
1028            /**
1029            * Removes the association between the role and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1030            *
1031            * @param pk the primary key of the role
1032            * @param groups the groups
1033            * @throws SystemException if a system exception occurred
1034            */
1035            public static void removeGroups(long pk,
1036                    java.util.List<com.liferay.portal.model.Group> groups)
1037                    throws com.liferay.portal.kernel.exception.SystemException {
1038                    getPersistence().removeGroups(pk, groups);
1039            }
1040    
1041            /**
1042            * Sets the groups associated with the role, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1043            *
1044            * @param pk the primary key of the role to set the associations for
1045            * @param groupPKs the primary keys of the groups to be associated with the role
1046            * @throws SystemException if a system exception occurred
1047            */
1048            public static void setGroups(long pk, long[] groupPKs)
1049                    throws com.liferay.portal.kernel.exception.SystemException {
1050                    getPersistence().setGroups(pk, groupPKs);
1051            }
1052    
1053            /**
1054            * Sets the groups associated with the role, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1055            *
1056            * @param pk the primary key of the role to set the associations for
1057            * @param groups the groups to be associated with the role
1058            * @throws SystemException if a system exception occurred
1059            */
1060            public static void setGroups(long pk,
1061                    java.util.List<com.liferay.portal.model.Group> groups)
1062                    throws com.liferay.portal.kernel.exception.SystemException {
1063                    getPersistence().setGroups(pk, groups);
1064            }
1065    
1066            /**
1067            * Gets all the permissions associated with the role.
1068            *
1069            * @param pk the primary key of the role to get the associated permissions for
1070            * @return the permissions associated with the role
1071            * @throws SystemException if a system exception occurred
1072            */
1073            public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
1074                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
1075                    return getPersistence().getPermissions(pk);
1076            }
1077    
1078            /**
1079            * Gets a range of all the permissions associated with the role.
1080            *
1081            * <p>
1082            * 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.
1083            * </p>
1084            *
1085            * @param pk the primary key of the role to get the associated permissions for
1086            * @param start the lower bound of the range of roles to return
1087            * @param end the upper bound of the range of roles to return (not inclusive)
1088            * @return the range of permissions associated with the role
1089            * @throws SystemException if a system exception occurred
1090            */
1091            public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
1092                    long pk, int start, int end)
1093                    throws com.liferay.portal.kernel.exception.SystemException {
1094                    return getPersistence().getPermissions(pk, start, end);
1095            }
1096    
1097            /**
1098            * Gets an ordered range of all the permissions associated with the role.
1099            *
1100            * <p>
1101            * 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.
1102            * </p>
1103            *
1104            * @param pk the primary key of the role to get the associated permissions for
1105            * @param start the lower bound of the range of roles to return
1106            * @param end the upper bound of the range of roles to return (not inclusive)
1107            * @param orderByComparator the comparator to order the results by
1108            * @return the ordered range of permissions associated with the role
1109            * @throws SystemException if a system exception occurred
1110            */
1111            public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
1112                    long pk, int start, int end,
1113                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1114                    throws com.liferay.portal.kernel.exception.SystemException {
1115                    return getPersistence().getPermissions(pk, start, end, orderByComparator);
1116            }
1117    
1118            /**
1119            * Gets the number of permissions associated with the role.
1120            *
1121            * @param pk the primary key of the role to get the number of associated permissions for
1122            * @return the number of permissions associated with the role
1123            * @throws SystemException if a system exception occurred
1124            */
1125            public static int getPermissionsSize(long pk)
1126                    throws com.liferay.portal.kernel.exception.SystemException {
1127                    return getPersistence().getPermissionsSize(pk);
1128            }
1129    
1130            /**
1131            * Determines whether the permission is associated with the role.
1132            *
1133            * @param pk the primary key of the role
1134            * @param permissionPK the primary key of the permission
1135            * @return whether the permission is associated with the role
1136            * @throws SystemException if a system exception occurred
1137            */
1138            public static boolean containsPermission(long pk, long permissionPK)
1139                    throws com.liferay.portal.kernel.exception.SystemException {
1140                    return getPersistence().containsPermission(pk, permissionPK);
1141            }
1142    
1143            /**
1144            * Determines whether the role has any permissions associated with it.
1145            *
1146            * @param pk the primary key of the role to check for associations with permissions
1147            * @return whether the role has any permissions associated with it
1148            * @throws SystemException if a system exception occurred
1149            */
1150            public static boolean containsPermissions(long pk)
1151                    throws com.liferay.portal.kernel.exception.SystemException {
1152                    return getPersistence().containsPermissions(pk);
1153            }
1154    
1155            /**
1156            * Adds an association between the role and the permission. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1157            *
1158            * @param pk the primary key of the role
1159            * @param permissionPK the primary key of the permission
1160            * @throws SystemException if a system exception occurred
1161            */
1162            public static void addPermission(long pk, long permissionPK)
1163                    throws com.liferay.portal.kernel.exception.SystemException {
1164                    getPersistence().addPermission(pk, permissionPK);
1165            }
1166    
1167            /**
1168            * Adds an association between the role and the permission. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1169            *
1170            * @param pk the primary key of the role
1171            * @param permission the permission
1172            * @throws SystemException if a system exception occurred
1173            */
1174            public static void addPermission(long pk,
1175                    com.liferay.portal.model.Permission permission)
1176                    throws com.liferay.portal.kernel.exception.SystemException {
1177                    getPersistence().addPermission(pk, permission);
1178            }
1179    
1180            /**
1181            * Adds an association between the role and the permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1182            *
1183            * @param pk the primary key of the role
1184            * @param permissionPKs the primary keys of the permissions
1185            * @throws SystemException if a system exception occurred
1186            */
1187            public static void addPermissions(long pk, long[] permissionPKs)
1188                    throws com.liferay.portal.kernel.exception.SystemException {
1189                    getPersistence().addPermissions(pk, permissionPKs);
1190            }
1191    
1192            /**
1193            * Adds an association between the role and the permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1194            *
1195            * @param pk the primary key of the role
1196            * @param permissions the permissions
1197            * @throws SystemException if a system exception occurred
1198            */
1199            public static void addPermissions(long pk,
1200                    java.util.List<com.liferay.portal.model.Permission> permissions)
1201                    throws com.liferay.portal.kernel.exception.SystemException {
1202                    getPersistence().addPermissions(pk, permissions);
1203            }
1204    
1205            /**
1206            * Clears all associations between the role and its permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1207            *
1208            * @param pk the primary key of the role to clear the associated permissions from
1209            * @throws SystemException if a system exception occurred
1210            */
1211            public static void clearPermissions(long pk)
1212                    throws com.liferay.portal.kernel.exception.SystemException {
1213                    getPersistence().clearPermissions(pk);
1214            }
1215    
1216            /**
1217            * Removes the association between the role and the permission. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1218            *
1219            * @param pk the primary key of the role
1220            * @param permissionPK the primary key of the permission
1221            * @throws SystemException if a system exception occurred
1222            */
1223            public static void removePermission(long pk, long permissionPK)
1224                    throws com.liferay.portal.kernel.exception.SystemException {
1225                    getPersistence().removePermission(pk, permissionPK);
1226            }
1227    
1228            /**
1229            * Removes the association between the role and the permission. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1230            *
1231            * @param pk the primary key of the role
1232            * @param permission the permission
1233            * @throws SystemException if a system exception occurred
1234            */
1235            public static void removePermission(long pk,
1236                    com.liferay.portal.model.Permission permission)
1237                    throws com.liferay.portal.kernel.exception.SystemException {
1238                    getPersistence().removePermission(pk, permission);
1239            }
1240    
1241            /**
1242            * Removes the association between the role and the permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1243            *
1244            * @param pk the primary key of the role
1245            * @param permissionPKs the primary keys of the permissions
1246            * @throws SystemException if a system exception occurred
1247            */
1248            public static void removePermissions(long pk, long[] permissionPKs)
1249                    throws com.liferay.portal.kernel.exception.SystemException {
1250                    getPersistence().removePermissions(pk, permissionPKs);
1251            }
1252    
1253            /**
1254            * Removes the association between the role and the permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1255            *
1256            * @param pk the primary key of the role
1257            * @param permissions the permissions
1258            * @throws SystemException if a system exception occurred
1259            */
1260            public static void removePermissions(long pk,
1261                    java.util.List<com.liferay.portal.model.Permission> permissions)
1262                    throws com.liferay.portal.kernel.exception.SystemException {
1263                    getPersistence().removePermissions(pk, permissions);
1264            }
1265    
1266            /**
1267            * Sets the permissions associated with the role, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1268            *
1269            * @param pk the primary key of the role to set the associations for
1270            * @param permissionPKs the primary keys of the permissions to be associated with the role
1271            * @throws SystemException if a system exception occurred
1272            */
1273            public static void setPermissions(long pk, long[] permissionPKs)
1274                    throws com.liferay.portal.kernel.exception.SystemException {
1275                    getPersistence().setPermissions(pk, permissionPKs);
1276            }
1277    
1278            /**
1279            * Sets the permissions associated with the role, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1280            *
1281            * @param pk the primary key of the role to set the associations for
1282            * @param permissions the permissions to be associated with the role
1283            * @throws SystemException if a system exception occurred
1284            */
1285            public static void setPermissions(long pk,
1286                    java.util.List<com.liferay.portal.model.Permission> permissions)
1287                    throws com.liferay.portal.kernel.exception.SystemException {
1288                    getPersistence().setPermissions(pk, permissions);
1289            }
1290    
1291            /**
1292            * Gets all the users associated with the role.
1293            *
1294            * @param pk the primary key of the role to get the associated users for
1295            * @return the users associated with the role
1296            * @throws SystemException if a system exception occurred
1297            */
1298            public static java.util.List<com.liferay.portal.model.User> getUsers(
1299                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
1300                    return getPersistence().getUsers(pk);
1301            }
1302    
1303            /**
1304            * Gets a range of all the users associated with the role.
1305            *
1306            * <p>
1307            * 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.
1308            * </p>
1309            *
1310            * @param pk the primary key of the role to get the associated users for
1311            * @param start the lower bound of the range of roles to return
1312            * @param end the upper bound of the range of roles to return (not inclusive)
1313            * @return the range of users associated with the role
1314            * @throws SystemException if a system exception occurred
1315            */
1316            public static java.util.List<com.liferay.portal.model.User> getUsers(
1317                    long pk, int start, int end)
1318                    throws com.liferay.portal.kernel.exception.SystemException {
1319                    return getPersistence().getUsers(pk, start, end);
1320            }
1321    
1322            /**
1323            * Gets an ordered range of all the users associated with the role.
1324            *
1325            * <p>
1326            * 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.
1327            * </p>
1328            *
1329            * @param pk the primary key of the role to get the associated users for
1330            * @param start the lower bound of the range of roles to return
1331            * @param end the upper bound of the range of roles to return (not inclusive)
1332            * @param orderByComparator the comparator to order the results by
1333            * @return the ordered range of users associated with the role
1334            * @throws SystemException if a system exception occurred
1335            */
1336            public static java.util.List<com.liferay.portal.model.User> getUsers(
1337                    long pk, int start, int end,
1338                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1339                    throws com.liferay.portal.kernel.exception.SystemException {
1340                    return getPersistence().getUsers(pk, start, end, orderByComparator);
1341            }
1342    
1343            /**
1344            * Gets the number of users associated with the role.
1345            *
1346            * @param pk the primary key of the role to get the number of associated users for
1347            * @return the number of users associated with the role
1348            * @throws SystemException if a system exception occurred
1349            */
1350            public static int getUsersSize(long pk)
1351                    throws com.liferay.portal.kernel.exception.SystemException {
1352                    return getPersistence().getUsersSize(pk);
1353            }
1354    
1355            /**
1356            * Determines whether the user is associated with the role.
1357            *
1358            * @param pk the primary key of the role
1359            * @param userPK the primary key of the user
1360            * @return whether the user is associated with the role
1361            * @throws SystemException if a system exception occurred
1362            */
1363            public static boolean containsUser(long pk, long userPK)
1364                    throws com.liferay.portal.kernel.exception.SystemException {
1365                    return getPersistence().containsUser(pk, userPK);
1366            }
1367    
1368            /**
1369            * Determines whether the role has any users associated with it.
1370            *
1371            * @param pk the primary key of the role to check for associations with users
1372            * @return whether the role has any users associated with it
1373            * @throws SystemException if a system exception occurred
1374            */
1375            public static boolean containsUsers(long pk)
1376                    throws com.liferay.portal.kernel.exception.SystemException {
1377                    return getPersistence().containsUsers(pk);
1378            }
1379    
1380            /**
1381            * Adds an association between the role and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1382            *
1383            * @param pk the primary key of the role
1384            * @param userPK the primary key of the user
1385            * @throws SystemException if a system exception occurred
1386            */
1387            public static void addUser(long pk, long userPK)
1388                    throws com.liferay.portal.kernel.exception.SystemException {
1389                    getPersistence().addUser(pk, userPK);
1390            }
1391    
1392            /**
1393            * Adds an association between the role and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1394            *
1395            * @param pk the primary key of the role
1396            * @param user the user
1397            * @throws SystemException if a system exception occurred
1398            */
1399            public static void addUser(long pk, com.liferay.portal.model.User user)
1400                    throws com.liferay.portal.kernel.exception.SystemException {
1401                    getPersistence().addUser(pk, user);
1402            }
1403    
1404            /**
1405            * Adds an association between the role and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1406            *
1407            * @param pk the primary key of the role
1408            * @param userPKs the primary keys of the users
1409            * @throws SystemException if a system exception occurred
1410            */
1411            public static void addUsers(long pk, long[] userPKs)
1412                    throws com.liferay.portal.kernel.exception.SystemException {
1413                    getPersistence().addUsers(pk, userPKs);
1414            }
1415    
1416            /**
1417            * Adds an association between the role and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1418            *
1419            * @param pk the primary key of the role
1420            * @param users the users
1421            * @throws SystemException if a system exception occurred
1422            */
1423            public static void addUsers(long pk,
1424                    java.util.List<com.liferay.portal.model.User> users)
1425                    throws com.liferay.portal.kernel.exception.SystemException {
1426                    getPersistence().addUsers(pk, users);
1427            }
1428    
1429            /**
1430            * Clears all associations between the role and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1431            *
1432            * @param pk the primary key of the role to clear the associated users from
1433            * @throws SystemException if a system exception occurred
1434            */
1435            public static void clearUsers(long pk)
1436                    throws com.liferay.portal.kernel.exception.SystemException {
1437                    getPersistence().clearUsers(pk);
1438            }
1439    
1440            /**
1441            * Removes the association between the role and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1442            *
1443            * @param pk the primary key of the role
1444            * @param userPK the primary key of the user
1445            * @throws SystemException if a system exception occurred
1446            */
1447            public static void removeUser(long pk, long userPK)
1448                    throws com.liferay.portal.kernel.exception.SystemException {
1449                    getPersistence().removeUser(pk, userPK);
1450            }
1451    
1452            /**
1453            * Removes the association between the role and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1454            *
1455            * @param pk the primary key of the role
1456            * @param user the user
1457            * @throws SystemException if a system exception occurred
1458            */
1459            public static void removeUser(long pk, com.liferay.portal.model.User user)
1460                    throws com.liferay.portal.kernel.exception.SystemException {
1461                    getPersistence().removeUser(pk, user);
1462            }
1463    
1464            /**
1465            * Removes the association between the role and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1466            *
1467            * @param pk the primary key of the role
1468            * @param userPKs the primary keys of the users
1469            * @throws SystemException if a system exception occurred
1470            */
1471            public static void removeUsers(long pk, long[] userPKs)
1472                    throws com.liferay.portal.kernel.exception.SystemException {
1473                    getPersistence().removeUsers(pk, userPKs);
1474            }
1475    
1476            /**
1477            * Removes the association between the role and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1478            *
1479            * @param pk the primary key of the role
1480            * @param users the users
1481            * @throws SystemException if a system exception occurred
1482            */
1483            public static void removeUsers(long pk,
1484                    java.util.List<com.liferay.portal.model.User> users)
1485                    throws com.liferay.portal.kernel.exception.SystemException {
1486                    getPersistence().removeUsers(pk, users);
1487            }
1488    
1489            /**
1490            * Sets the users associated with the role, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1491            *
1492            * @param pk the primary key of the role to set the associations for
1493            * @param userPKs the primary keys of the users to be associated with the role
1494            * @throws SystemException if a system exception occurred
1495            */
1496            public static void setUsers(long pk, long[] userPKs)
1497                    throws com.liferay.portal.kernel.exception.SystemException {
1498                    getPersistence().setUsers(pk, userPKs);
1499            }
1500    
1501            /**
1502            * Sets the users associated with the role, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1503            *
1504            * @param pk the primary key of the role to set the associations for
1505            * @param users the users to be associated with the role
1506            * @throws SystemException if a system exception occurred
1507            */
1508            public static void setUsers(long pk,
1509                    java.util.List<com.liferay.portal.model.User> users)
1510                    throws com.liferay.portal.kernel.exception.SystemException {
1511                    getPersistence().setUsers(pk, users);
1512            }
1513    
1514            public static RolePersistence getPersistence() {
1515                    if (_persistence == null) {
1516                            _persistence = (RolePersistence)PortalBeanLocatorUtil.locate(RolePersistence.class.getName());
1517                    }
1518    
1519                    return _persistence;
1520            }
1521    
1522            public void setPersistence(RolePersistence persistence) {
1523                    _persistence = persistence;
1524            }
1525    
1526            private static RolePersistence _persistence;
1527    }