001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.Role;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the role service. This utility wraps {@link RolePersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see RolePersistence
036     * @see RolePersistenceImpl
037     * @generated
038     */
039    public class RoleUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(Role role) {
057                    getPersistence().clearCache(role);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<Role> findWithDynamicQuery(DynamicQuery dynamicQuery)
072                    throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<Role> findWithDynamicQuery(DynamicQuery dynamicQuery,
080                    int start, int end) throws SystemException {
081                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
082            }
083    
084            /**
085             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
086             */
087            public static List<Role> findWithDynamicQuery(DynamicQuery dynamicQuery,
088                    int start, int end, OrderByComparator orderByComparator)
089                    throws SystemException {
090                    return getPersistence()
091                                       .findWithDynamicQuery(dynamicQuery, start, end,
092                            orderByComparator);
093            }
094    
095            /**
096             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
097             */
098            public static Role remove(Role role) throws SystemException {
099                    return getPersistence().remove(role);
100            }
101    
102            /**
103             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
104             */
105            public static Role update(Role role, boolean merge)
106                    throws SystemException {
107                    return getPersistence().update(role, merge);
108            }
109    
110            /**
111             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
112             */
113            public static Role update(Role role, boolean merge,
114                    ServiceContext serviceContext) throws SystemException {
115                    return getPersistence().update(role, merge, serviceContext);
116            }
117    
118            /**
119            * Caches the role in the entity cache if it is enabled.
120            *
121            * @param role the role to cache
122            */
123            public static void cacheResult(com.liferay.portal.model.Role role) {
124                    getPersistence().cacheResult(role);
125            }
126    
127            /**
128            * Caches the roles in the entity cache if it is enabled.
129            *
130            * @param roles the roles to cache
131            */
132            public static void cacheResult(
133                    java.util.List<com.liferay.portal.model.Role> roles) {
134                    getPersistence().cacheResult(roles);
135            }
136    
137            /**
138            * Creates a new role with the primary key. Does not add the role to the database.
139            *
140            * @param roleId the primary key for the new role
141            * @return the new role
142            */
143            public static com.liferay.portal.model.Role create(long roleId) {
144                    return getPersistence().create(roleId);
145            }
146    
147            /**
148            * Removes the role with the primary key from the database. Also notifies the appropriate model listeners.
149            *
150            * @param roleId the primary key of the role to remove
151            * @return the role that was removed
152            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
153            * @throws SystemException if a system exception occurred
154            */
155            public static com.liferay.portal.model.Role remove(long roleId)
156                    throws com.liferay.portal.NoSuchRoleException,
157                            com.liferay.portal.kernel.exception.SystemException {
158                    return getPersistence().remove(roleId);
159            }
160    
161            public static com.liferay.portal.model.Role updateImpl(
162                    com.liferay.portal.model.Role role, boolean merge)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getPersistence().updateImpl(role, merge);
165            }
166    
167            /**
168            * Finds the role with the primary key or throws a {@link com.liferay.portal.NoSuchRoleException} if it could not be found.
169            *
170            * @param roleId the primary key of the role to find
171            * @return the role
172            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portal.model.Role findByPrimaryKey(long roleId)
176                    throws com.liferay.portal.NoSuchRoleException,
177                            com.liferay.portal.kernel.exception.SystemException {
178                    return getPersistence().findByPrimaryKey(roleId);
179            }
180    
181            /**
182            * Finds the role with the primary key or returns <code>null</code> if it could not be found.
183            *
184            * @param roleId the primary key of the role to find
185            * @return the role, or <code>null</code> if a role with the primary key could not be found
186            * @throws SystemException if a system exception occurred
187            */
188            public static com.liferay.portal.model.Role fetchByPrimaryKey(long roleId)
189                    throws com.liferay.portal.kernel.exception.SystemException {
190                    return getPersistence().fetchByPrimaryKey(roleId);
191            }
192    
193            /**
194            * Finds all the roles where companyId = &#63;.
195            *
196            * @param companyId the company ID to search with
197            * @return the matching roles
198            * @throws SystemException if a system exception occurred
199            */
200            public static java.util.List<com.liferay.portal.model.Role> findByCompanyId(
201                    long companyId)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return getPersistence().findByCompanyId(companyId);
204            }
205    
206            /**
207            * Finds a range of all the roles where companyId = &#63;.
208            *
209            * <p>
210            * 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.
211            * </p>
212            *
213            * @param companyId the company ID to search with
214            * @param start the lower bound of the range of roles to return
215            * @param end the upper bound of the range of roles to return (not inclusive)
216            * @return the range of matching roles
217            * @throws SystemException if a system exception occurred
218            */
219            public static java.util.List<com.liferay.portal.model.Role> findByCompanyId(
220                    long companyId, int start, int end)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getPersistence().findByCompanyId(companyId, start, end);
223            }
224    
225            /**
226            * Finds an ordered range of all the roles where companyId = &#63;.
227            *
228            * <p>
229            * 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.
230            * </p>
231            *
232            * @param companyId the company ID to search with
233            * @param start the lower bound of the range of roles to return
234            * @param end the upper bound of the range of roles to return (not inclusive)
235            * @param orderByComparator the comparator to order the results by
236            * @return the ordered range of matching roles
237            * @throws SystemException if a system exception occurred
238            */
239            public static java.util.List<com.liferay.portal.model.Role> findByCompanyId(
240                    long companyId, int start, int end,
241                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getPersistence()
244                                       .findByCompanyId(companyId, start, end, orderByComparator);
245            }
246    
247            /**
248            * Finds the first role in the ordered set where companyId = &#63;.
249            *
250            * <p>
251            * 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.
252            * </p>
253            *
254            * @param companyId the company ID to search with
255            * @param orderByComparator the comparator to order the set by
256            * @return the first matching role
257            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
258            * @throws SystemException if a system exception occurred
259            */
260            public static com.liferay.portal.model.Role findByCompanyId_First(
261                    long companyId,
262                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
263                    throws com.liferay.portal.NoSuchRoleException,
264                            com.liferay.portal.kernel.exception.SystemException {
265                    return getPersistence()
266                                       .findByCompanyId_First(companyId, orderByComparator);
267            }
268    
269            /**
270            * Finds the last role in the ordered set where companyId = &#63;.
271            *
272            * <p>
273            * 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.
274            * </p>
275            *
276            * @param companyId the company ID to search with
277            * @param orderByComparator the comparator to order the set by
278            * @return the last matching role
279            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
280            * @throws SystemException if a system exception occurred
281            */
282            public static com.liferay.portal.model.Role findByCompanyId_Last(
283                    long companyId,
284                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
285                    throws com.liferay.portal.NoSuchRoleException,
286                            com.liferay.portal.kernel.exception.SystemException {
287                    return getPersistence()
288                                       .findByCompanyId_Last(companyId, orderByComparator);
289            }
290    
291            /**
292            * Finds the roles before and after the current role in the ordered set where companyId = &#63;.
293            *
294            * <p>
295            * 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.
296            * </p>
297            *
298            * @param roleId the primary key of the current role
299            * @param companyId the company ID to search with
300            * @param orderByComparator the comparator to order the set by
301            * @return the previous, current, and next role
302            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
303            * @throws SystemException if a system exception occurred
304            */
305            public static com.liferay.portal.model.Role[] findByCompanyId_PrevAndNext(
306                    long roleId, long companyId,
307                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
308                    throws com.liferay.portal.NoSuchRoleException,
309                            com.liferay.portal.kernel.exception.SystemException {
310                    return getPersistence()
311                                       .findByCompanyId_PrevAndNext(roleId, companyId,
312                            orderByComparator);
313            }
314    
315            /**
316            * Filters by the user's permissions and finds all the roles where companyId = &#63;.
317            *
318            * @param companyId the company ID to search with
319            * @return the matching roles that the user has permission to view
320            * @throws SystemException if a system exception occurred
321            */
322            public static java.util.List<com.liferay.portal.model.Role> filterFindByCompanyId(
323                    long companyId)
324                    throws com.liferay.portal.kernel.exception.SystemException {
325                    return getPersistence().filterFindByCompanyId(companyId);
326            }
327    
328            /**
329            * Filters by the user's permissions and finds a range of all the roles where companyId = &#63;.
330            *
331            * <p>
332            * 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.
333            * </p>
334            *
335            * @param companyId the company ID to search with
336            * @param start the lower bound of the range of roles to return
337            * @param end the upper bound of the range of roles to return (not inclusive)
338            * @return the range of matching roles that the user has permission to view
339            * @throws SystemException if a system exception occurred
340            */
341            public static java.util.List<com.liferay.portal.model.Role> filterFindByCompanyId(
342                    long companyId, int start, int end)
343                    throws com.liferay.portal.kernel.exception.SystemException {
344                    return getPersistence().filterFindByCompanyId(companyId, start, end);
345            }
346    
347            /**
348            * Filters by the user's permissions and finds an ordered range of all the roles where companyId = &#63;.
349            *
350            * <p>
351            * 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.
352            * </p>
353            *
354            * @param companyId the company ID to search with
355            * @param start the lower bound of the range of roles to return
356            * @param end the upper bound of the range of roles to return (not inclusive)
357            * @param orderByComparator the comparator to order the results by
358            * @return the ordered range of matching roles that the user has permission to view
359            * @throws SystemException if a system exception occurred
360            */
361            public static java.util.List<com.liferay.portal.model.Role> filterFindByCompanyId(
362                    long companyId, int start, int end,
363                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
364                    throws com.liferay.portal.kernel.exception.SystemException {
365                    return getPersistence()
366                                       .filterFindByCompanyId(companyId, start, end,
367                            orderByComparator);
368            }
369    
370            /**
371            * Filters the roles before and after the current role in the ordered set where companyId = &#63;.
372            *
373            * <p>
374            * 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.
375            * </p>
376            *
377            * @param roleId the primary key of the current role
378            * @param companyId the company ID to search with
379            * @param orderByComparator the comparator to order the set by
380            * @return the previous, current, and next role
381            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
382            * @throws SystemException if a system exception occurred
383            */
384            public static com.liferay.portal.model.Role[] filterFindByCompanyId_PrevAndNext(
385                    long roleId, long companyId,
386                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
387                    throws com.liferay.portal.NoSuchRoleException,
388                            com.liferay.portal.kernel.exception.SystemException {
389                    return getPersistence()
390                                       .filterFindByCompanyId_PrevAndNext(roleId, companyId,
391                            orderByComparator);
392            }
393    
394            /**
395            * Finds all the roles where name = &#63;.
396            *
397            * @param name the name to search with
398            * @return the matching roles
399            * @throws SystemException if a system exception occurred
400            */
401            public static java.util.List<com.liferay.portal.model.Role> findByName(
402                    java.lang.String name)
403                    throws com.liferay.portal.kernel.exception.SystemException {
404                    return getPersistence().findByName(name);
405            }
406    
407            /**
408            * Finds a range of all the roles where name = &#63;.
409            *
410            * <p>
411            * 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.
412            * </p>
413            *
414            * @param name the name to search with
415            * @param start the lower bound of the range of roles to return
416            * @param end the upper bound of the range of roles to return (not inclusive)
417            * @return the range of matching roles
418            * @throws SystemException if a system exception occurred
419            */
420            public static java.util.List<com.liferay.portal.model.Role> findByName(
421                    java.lang.String name, int start, int end)
422                    throws com.liferay.portal.kernel.exception.SystemException {
423                    return getPersistence().findByName(name, start, end);
424            }
425    
426            /**
427            * Finds an ordered range of all the roles where name = &#63;.
428            *
429            * <p>
430            * 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.
431            * </p>
432            *
433            * @param name the name to search with
434            * @param start the lower bound of the range of roles to return
435            * @param end the upper bound of the range of roles to return (not inclusive)
436            * @param orderByComparator the comparator to order the results by
437            * @return the ordered range of matching roles
438            * @throws SystemException if a system exception occurred
439            */
440            public static java.util.List<com.liferay.portal.model.Role> findByName(
441                    java.lang.String name, int start, int end,
442                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
443                    throws com.liferay.portal.kernel.exception.SystemException {
444                    return getPersistence().findByName(name, start, end, orderByComparator);
445            }
446    
447            /**
448            * Finds the first role in the ordered set where name = &#63;.
449            *
450            * <p>
451            * 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.
452            * </p>
453            *
454            * @param name the name to search with
455            * @param orderByComparator the comparator to order the set by
456            * @return the first matching role
457            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
458            * @throws SystemException if a system exception occurred
459            */
460            public static com.liferay.portal.model.Role findByName_First(
461                    java.lang.String name,
462                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
463                    throws com.liferay.portal.NoSuchRoleException,
464                            com.liferay.portal.kernel.exception.SystemException {
465                    return getPersistence().findByName_First(name, orderByComparator);
466            }
467    
468            /**
469            * Finds the last role in the ordered set where name = &#63;.
470            *
471            * <p>
472            * 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.
473            * </p>
474            *
475            * @param name the name to search with
476            * @param orderByComparator the comparator to order the set by
477            * @return the last matching role
478            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
479            * @throws SystemException if a system exception occurred
480            */
481            public static com.liferay.portal.model.Role findByName_Last(
482                    java.lang.String name,
483                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
484                    throws com.liferay.portal.NoSuchRoleException,
485                            com.liferay.portal.kernel.exception.SystemException {
486                    return getPersistence().findByName_Last(name, orderByComparator);
487            }
488    
489            /**
490            * Finds the roles before and after the current role in the ordered set where name = &#63;.
491            *
492            * <p>
493            * 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.
494            * </p>
495            *
496            * @param roleId the primary key of the current role
497            * @param name the name to search with
498            * @param orderByComparator the comparator to order the set by
499            * @return the previous, current, and next role
500            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
501            * @throws SystemException if a system exception occurred
502            */
503            public static com.liferay.portal.model.Role[] findByName_PrevAndNext(
504                    long roleId, java.lang.String name,
505                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
506                    throws com.liferay.portal.NoSuchRoleException,
507                            com.liferay.portal.kernel.exception.SystemException {
508                    return getPersistence()
509                                       .findByName_PrevAndNext(roleId, name, orderByComparator);
510            }
511    
512            /**
513            * Filters by the user's permissions and finds all the roles where name = &#63;.
514            *
515            * @param name the name to search with
516            * @return the matching roles that the user has permission to view
517            * @throws SystemException if a system exception occurred
518            */
519            public static java.util.List<com.liferay.portal.model.Role> filterFindByName(
520                    java.lang.String name)
521                    throws com.liferay.portal.kernel.exception.SystemException {
522                    return getPersistence().filterFindByName(name);
523            }
524    
525            /**
526            * Filters by the user's permissions and finds a range of all the roles where name = &#63;.
527            *
528            * <p>
529            * 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.
530            * </p>
531            *
532            * @param name the name to search with
533            * @param start the lower bound of the range of roles to return
534            * @param end the upper bound of the range of roles to return (not inclusive)
535            * @return the range of matching roles that the user has permission to view
536            * @throws SystemException if a system exception occurred
537            */
538            public static java.util.List<com.liferay.portal.model.Role> filterFindByName(
539                    java.lang.String name, int start, int end)
540                    throws com.liferay.portal.kernel.exception.SystemException {
541                    return getPersistence().filterFindByName(name, start, end);
542            }
543    
544            /**
545            * Filters by the user's permissions and finds an ordered range of all the roles where name = &#63;.
546            *
547            * <p>
548            * 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.
549            * </p>
550            *
551            * @param name the name to search with
552            * @param start the lower bound of the range of roles to return
553            * @param end the upper bound of the range of roles to return (not inclusive)
554            * @param orderByComparator the comparator to order the results by
555            * @return the ordered range of matching roles that the user has permission to view
556            * @throws SystemException if a system exception occurred
557            */
558            public static java.util.List<com.liferay.portal.model.Role> filterFindByName(
559                    java.lang.String name, int start, int end,
560                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
561                    throws com.liferay.portal.kernel.exception.SystemException {
562                    return getPersistence()
563                                       .filterFindByName(name, start, end, orderByComparator);
564            }
565    
566            /**
567            * Filters the roles before and after the current role in the ordered set where name = &#63;.
568            *
569            * <p>
570            * 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.
571            * </p>
572            *
573            * @param roleId the primary key of the current role
574            * @param name the name to search with
575            * @param orderByComparator the comparator to order the set by
576            * @return the previous, current, and next role
577            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
578            * @throws SystemException if a system exception occurred
579            */
580            public static com.liferay.portal.model.Role[] filterFindByName_PrevAndNext(
581                    long roleId, java.lang.String name,
582                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
583                    throws com.liferay.portal.NoSuchRoleException,
584                            com.liferay.portal.kernel.exception.SystemException {
585                    return getPersistence()
586                                       .filterFindByName_PrevAndNext(roleId, name, orderByComparator);
587            }
588    
589            /**
590            * Finds all the roles where subtype = &#63;.
591            *
592            * @param subtype the subtype to search with
593            * @return the matching roles
594            * @throws SystemException if a system exception occurred
595            */
596            public static java.util.List<com.liferay.portal.model.Role> findBySubtype(
597                    java.lang.String subtype)
598                    throws com.liferay.portal.kernel.exception.SystemException {
599                    return getPersistence().findBySubtype(subtype);
600            }
601    
602            /**
603            * Finds a range of all the roles where subtype = &#63;.
604            *
605            * <p>
606            * 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.
607            * </p>
608            *
609            * @param subtype the subtype to search with
610            * @param start the lower bound of the range of roles to return
611            * @param end the upper bound of the range of roles to return (not inclusive)
612            * @return the range of matching roles
613            * @throws SystemException if a system exception occurred
614            */
615            public static java.util.List<com.liferay.portal.model.Role> findBySubtype(
616                    java.lang.String subtype, int start, int end)
617                    throws com.liferay.portal.kernel.exception.SystemException {
618                    return getPersistence().findBySubtype(subtype, start, end);
619            }
620    
621            /**
622            * Finds an ordered range of all the roles where subtype = &#63;.
623            *
624            * <p>
625            * 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.
626            * </p>
627            *
628            * @param subtype the subtype to search with
629            * @param start the lower bound of the range of roles to return
630            * @param end the upper bound of the range of roles to return (not inclusive)
631            * @param orderByComparator the comparator to order the results by
632            * @return the ordered range of matching roles
633            * @throws SystemException if a system exception occurred
634            */
635            public static java.util.List<com.liferay.portal.model.Role> findBySubtype(
636                    java.lang.String subtype, int start, int end,
637                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
638                    throws com.liferay.portal.kernel.exception.SystemException {
639                    return getPersistence()
640                                       .findBySubtype(subtype, start, end, orderByComparator);
641            }
642    
643            /**
644            * Finds the first role in the ordered set where subtype = &#63;.
645            *
646            * <p>
647            * 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.
648            * </p>
649            *
650            * @param subtype the subtype to search with
651            * @param orderByComparator the comparator to order the set by
652            * @return the first matching role
653            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
654            * @throws SystemException if a system exception occurred
655            */
656            public static com.liferay.portal.model.Role findBySubtype_First(
657                    java.lang.String subtype,
658                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
659                    throws com.liferay.portal.NoSuchRoleException,
660                            com.liferay.portal.kernel.exception.SystemException {
661                    return getPersistence().findBySubtype_First(subtype, orderByComparator);
662            }
663    
664            /**
665            * Finds the last role in the ordered set where subtype = &#63;.
666            *
667            * <p>
668            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
669            * </p>
670            *
671            * @param subtype the subtype to search with
672            * @param orderByComparator the comparator to order the set by
673            * @return the last matching role
674            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
675            * @throws SystemException if a system exception occurred
676            */
677            public static com.liferay.portal.model.Role findBySubtype_Last(
678                    java.lang.String subtype,
679                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
680                    throws com.liferay.portal.NoSuchRoleException,
681                            com.liferay.portal.kernel.exception.SystemException {
682                    return getPersistence().findBySubtype_Last(subtype, orderByComparator);
683            }
684    
685            /**
686            * Finds the roles before and after the current role in the ordered set where subtype = &#63;.
687            *
688            * <p>
689            * 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.
690            * </p>
691            *
692            * @param roleId the primary key of the current role
693            * @param subtype the subtype to search with
694            * @param orderByComparator the comparator to order the set by
695            * @return the previous, current, and next role
696            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
697            * @throws SystemException if a system exception occurred
698            */
699            public static com.liferay.portal.model.Role[] findBySubtype_PrevAndNext(
700                    long roleId, java.lang.String subtype,
701                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
702                    throws com.liferay.portal.NoSuchRoleException,
703                            com.liferay.portal.kernel.exception.SystemException {
704                    return getPersistence()
705                                       .findBySubtype_PrevAndNext(roleId, subtype, orderByComparator);
706            }
707    
708            /**
709            * Filters by the user's permissions and finds all the roles where subtype = &#63;.
710            *
711            * @param subtype the subtype to search with
712            * @return the matching roles that the user has permission to view
713            * @throws SystemException if a system exception occurred
714            */
715            public static java.util.List<com.liferay.portal.model.Role> filterFindBySubtype(
716                    java.lang.String subtype)
717                    throws com.liferay.portal.kernel.exception.SystemException {
718                    return getPersistence().filterFindBySubtype(subtype);
719            }
720    
721            /**
722            * Filters by the user's permissions and finds a range of all the roles where subtype = &#63;.
723            *
724            * <p>
725            * 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.
726            * </p>
727            *
728            * @param subtype the subtype to search with
729            * @param start the lower bound of the range of roles to return
730            * @param end the upper bound of the range of roles to return (not inclusive)
731            * @return the range of matching roles that the user has permission to view
732            * @throws SystemException if a system exception occurred
733            */
734            public static java.util.List<com.liferay.portal.model.Role> filterFindBySubtype(
735                    java.lang.String subtype, int start, int end)
736                    throws com.liferay.portal.kernel.exception.SystemException {
737                    return getPersistence().filterFindBySubtype(subtype, start, end);
738            }
739    
740            /**
741            * Filters by the user's permissions and finds an ordered range of all the roles where subtype = &#63;.
742            *
743            * <p>
744            * 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.
745            * </p>
746            *
747            * @param subtype the subtype to search with
748            * @param start the lower bound of the range of roles to return
749            * @param end the upper bound of the range of roles to return (not inclusive)
750            * @param orderByComparator the comparator to order the results by
751            * @return the ordered range of matching roles that the user has permission to view
752            * @throws SystemException if a system exception occurred
753            */
754            public static java.util.List<com.liferay.portal.model.Role> filterFindBySubtype(
755                    java.lang.String subtype, int start, int end,
756                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
757                    throws com.liferay.portal.kernel.exception.SystemException {
758                    return getPersistence()
759                                       .filterFindBySubtype(subtype, start, end, orderByComparator);
760            }
761    
762            /**
763            * Filters the roles before and after the current role in the ordered set where subtype = &#63;.
764            *
765            * <p>
766            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
767            * </p>
768            *
769            * @param roleId the primary key of the current role
770            * @param subtype the subtype to search with
771            * @param orderByComparator the comparator to order the set by
772            * @return the previous, current, and next role
773            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
774            * @throws SystemException if a system exception occurred
775            */
776            public static com.liferay.portal.model.Role[] filterFindBySubtype_PrevAndNext(
777                    long roleId, java.lang.String subtype,
778                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
779                    throws com.liferay.portal.NoSuchRoleException,
780                            com.liferay.portal.kernel.exception.SystemException {
781                    return getPersistence()
782                                       .filterFindBySubtype_PrevAndNext(roleId, subtype,
783                            orderByComparator);
784            }
785    
786            /**
787            * Finds the role where companyId = &#63; and name = &#63; or throws a {@link com.liferay.portal.NoSuchRoleException} if it could not be found.
788            *
789            * @param companyId the company ID to search with
790            * @param name the name to search with
791            * @return the matching role
792            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
793            * @throws SystemException if a system exception occurred
794            */
795            public static com.liferay.portal.model.Role findByC_N(long companyId,
796                    java.lang.String name)
797                    throws com.liferay.portal.NoSuchRoleException,
798                            com.liferay.portal.kernel.exception.SystemException {
799                    return getPersistence().findByC_N(companyId, name);
800            }
801    
802            /**
803            * Finds the role where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
804            *
805            * @param companyId the company ID to search with
806            * @param name the name to search with
807            * @return the matching role, or <code>null</code> if a matching role could not be found
808            * @throws SystemException if a system exception occurred
809            */
810            public static com.liferay.portal.model.Role fetchByC_N(long companyId,
811                    java.lang.String name)
812                    throws com.liferay.portal.kernel.exception.SystemException {
813                    return getPersistence().fetchByC_N(companyId, name);
814            }
815    
816            /**
817            * 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.
818            *
819            * @param companyId the company ID to search with
820            * @param name the name to search with
821            * @return the matching role, or <code>null</code> if a matching role could not be found
822            * @throws SystemException if a system exception occurred
823            */
824            public static com.liferay.portal.model.Role fetchByC_N(long companyId,
825                    java.lang.String name, boolean retrieveFromCache)
826                    throws com.liferay.portal.kernel.exception.SystemException {
827                    return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
828            }
829    
830            /**
831            * Finds all the roles where type = &#63; and subtype = &#63;.
832            *
833            * @param type the type to search with
834            * @param subtype the subtype to search with
835            * @return the matching roles
836            * @throws SystemException if a system exception occurred
837            */
838            public static java.util.List<com.liferay.portal.model.Role> findByT_S(
839                    int type, java.lang.String subtype)
840                    throws com.liferay.portal.kernel.exception.SystemException {
841                    return getPersistence().findByT_S(type, subtype);
842            }
843    
844            /**
845            * Finds a range of all the roles where type = &#63; and subtype = &#63;.
846            *
847            * <p>
848            * 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.
849            * </p>
850            *
851            * @param type the type to search with
852            * @param subtype the subtype to search with
853            * @param start the lower bound of the range of roles to return
854            * @param end the upper bound of the range of roles to return (not inclusive)
855            * @return the range of matching roles
856            * @throws SystemException if a system exception occurred
857            */
858            public static java.util.List<com.liferay.portal.model.Role> findByT_S(
859                    int type, java.lang.String subtype, int start, int end)
860                    throws com.liferay.portal.kernel.exception.SystemException {
861                    return getPersistence().findByT_S(type, subtype, start, end);
862            }
863    
864            /**
865            * Finds an ordered range of all the roles where type = &#63; and subtype = &#63;.
866            *
867            * <p>
868            * 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.
869            * </p>
870            *
871            * @param type the type to search with
872            * @param subtype the subtype to search with
873            * @param start the lower bound of the range of roles to return
874            * @param end the upper bound of the range of roles to return (not inclusive)
875            * @param orderByComparator the comparator to order the results by
876            * @return the ordered range of matching roles
877            * @throws SystemException if a system exception occurred
878            */
879            public static java.util.List<com.liferay.portal.model.Role> findByT_S(
880                    int type, java.lang.String subtype, int start, int end,
881                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
882                    throws com.liferay.portal.kernel.exception.SystemException {
883                    return getPersistence()
884                                       .findByT_S(type, subtype, start, end, orderByComparator);
885            }
886    
887            /**
888            * Finds the first role in the ordered set where type = &#63; and subtype = &#63;.
889            *
890            * <p>
891            * 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.
892            * </p>
893            *
894            * @param type the type to search with
895            * @param subtype the subtype to search with
896            * @param orderByComparator the comparator to order the set by
897            * @return the first matching role
898            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
899            * @throws SystemException if a system exception occurred
900            */
901            public static com.liferay.portal.model.Role findByT_S_First(int type,
902                    java.lang.String subtype,
903                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
904                    throws com.liferay.portal.NoSuchRoleException,
905                            com.liferay.portal.kernel.exception.SystemException {
906                    return getPersistence().findByT_S_First(type, subtype, orderByComparator);
907            }
908    
909            /**
910            * Finds the last role in the ordered set where type = &#63; and subtype = &#63;.
911            *
912            * <p>
913            * 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.
914            * </p>
915            *
916            * @param type the type to search with
917            * @param subtype the subtype to search with
918            * @param orderByComparator the comparator to order the set by
919            * @return the last matching role
920            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
921            * @throws SystemException if a system exception occurred
922            */
923            public static com.liferay.portal.model.Role findByT_S_Last(int type,
924                    java.lang.String subtype,
925                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
926                    throws com.liferay.portal.NoSuchRoleException,
927                            com.liferay.portal.kernel.exception.SystemException {
928                    return getPersistence().findByT_S_Last(type, subtype, orderByComparator);
929            }
930    
931            /**
932            * Finds the roles before and after the current role in the ordered set where type = &#63; and subtype = &#63;.
933            *
934            * <p>
935            * 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.
936            * </p>
937            *
938            * @param roleId the primary key of the current role
939            * @param type the type to search with
940            * @param subtype the subtype to search with
941            * @param orderByComparator the comparator to order the set by
942            * @return the previous, current, and next role
943            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
944            * @throws SystemException if a system exception occurred
945            */
946            public static com.liferay.portal.model.Role[] findByT_S_PrevAndNext(
947                    long roleId, int type, java.lang.String subtype,
948                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
949                    throws com.liferay.portal.NoSuchRoleException,
950                            com.liferay.portal.kernel.exception.SystemException {
951                    return getPersistence()
952                                       .findByT_S_PrevAndNext(roleId, type, subtype,
953                            orderByComparator);
954            }
955    
956            /**
957            * Filters by the user's permissions and finds all the roles where type = &#63; and subtype = &#63;.
958            *
959            * @param type the type to search with
960            * @param subtype the subtype to search with
961            * @return the matching roles that the user has permission to view
962            * @throws SystemException if a system exception occurred
963            */
964            public static java.util.List<com.liferay.portal.model.Role> filterFindByT_S(
965                    int type, java.lang.String subtype)
966                    throws com.liferay.portal.kernel.exception.SystemException {
967                    return getPersistence().filterFindByT_S(type, subtype);
968            }
969    
970            /**
971            * Filters by the user's permissions and finds a range of all the roles where type = &#63; and subtype = &#63;.
972            *
973            * <p>
974            * 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.
975            * </p>
976            *
977            * @param type the type to search with
978            * @param subtype the subtype to search with
979            * @param start the lower bound of the range of roles to return
980            * @param end the upper bound of the range of roles to return (not inclusive)
981            * @return the range of matching roles that the user has permission to view
982            * @throws SystemException if a system exception occurred
983            */
984            public static java.util.List<com.liferay.portal.model.Role> filterFindByT_S(
985                    int type, java.lang.String subtype, int start, int end)
986                    throws com.liferay.portal.kernel.exception.SystemException {
987                    return getPersistence().filterFindByT_S(type, subtype, start, end);
988            }
989    
990            /**
991            * Filters by the user's permissions and finds an ordered range of all the roles where type = &#63; and subtype = &#63;.
992            *
993            * <p>
994            * 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.
995            * </p>
996            *
997            * @param type the type to search with
998            * @param subtype the subtype to search with
999            * @param start the lower bound of the range of roles to return
1000            * @param end the upper bound of the range of roles to return (not inclusive)
1001            * @param orderByComparator the comparator to order the results by
1002            * @return the ordered range of matching roles that the user has permission to view
1003            * @throws SystemException if a system exception occurred
1004            */
1005            public static java.util.List<com.liferay.portal.model.Role> filterFindByT_S(
1006                    int type, java.lang.String subtype, int start, int end,
1007                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1008                    throws com.liferay.portal.kernel.exception.SystemException {
1009                    return getPersistence()
1010                                       .filterFindByT_S(type, subtype, start, end, orderByComparator);
1011            }
1012    
1013            /**
1014            * Filters the roles before and after the current role in the ordered set where type = &#63; and subtype = &#63;.
1015            *
1016            * <p>
1017            * 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.
1018            * </p>
1019            *
1020            * @param roleId the primary key of the current role
1021            * @param type the type to search with
1022            * @param subtype the subtype to search with
1023            * @param orderByComparator the comparator to order the set by
1024            * @return the previous, current, and next role
1025            * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found
1026            * @throws SystemException if a system exception occurred
1027            */
1028            public static com.liferay.portal.model.Role[] filterFindByT_S_PrevAndNext(
1029                    long roleId, int type, java.lang.String subtype,
1030                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1031                    throws com.liferay.portal.NoSuchRoleException,
1032                            com.liferay.portal.kernel.exception.SystemException {
1033                    return getPersistence()
1034                                       .filterFindByT_S_PrevAndNext(roleId, type, subtype,
1035                            orderByComparator);
1036            }
1037    
1038            /**
1039            * 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.
1040            *
1041            * @param companyId the company ID to search with
1042            * @param classNameId the class name ID to search with
1043            * @param classPK the class p k to search with
1044            * @return the matching role
1045            * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found
1046            * @throws SystemException if a system exception occurred
1047            */
1048            public static com.liferay.portal.model.Role findByC_C_C(long companyId,
1049                    long classNameId, long classPK)
1050                    throws com.liferay.portal.NoSuchRoleException,
1051                            com.liferay.portal.kernel.exception.SystemException {
1052                    return getPersistence().findByC_C_C(companyId, classNameId, classPK);
1053            }
1054    
1055            /**
1056            * 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.
1057            *
1058            * @param companyId the company ID to search with
1059            * @param classNameId the class name ID to search with
1060            * @param classPK the class p k to search with
1061            * @return the matching role, or <code>null</code> if a matching role could not be found
1062            * @throws SystemException if a system exception occurred
1063            */
1064            public static com.liferay.portal.model.Role fetchByC_C_C(long companyId,
1065                    long classNameId, long classPK)
1066                    throws com.liferay.portal.kernel.exception.SystemException {
1067                    return getPersistence().fetchByC_C_C(companyId, classNameId, classPK);
1068            }
1069    
1070            /**
1071            * 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.
1072            *
1073            * @param companyId the company ID to search with
1074            * @param classNameId the class name ID to search with
1075            * @param classPK the class p k to search with
1076            * @return the matching role, or <code>null</code> if a matching role could not be found
1077            * @throws SystemException if a system exception occurred
1078            */
1079            public static com.liferay.portal.model.Role fetchByC_C_C(long companyId,
1080                    long classNameId, long classPK, boolean retrieveFromCache)
1081                    throws com.liferay.portal.kernel.exception.SystemException {
1082                    return getPersistence()
1083                                       .fetchByC_C_C(companyId, classNameId, classPK,
1084                            retrieveFromCache);
1085            }
1086    
1087            /**
1088            * Finds all the roles.
1089            *
1090            * @return the roles
1091            * @throws SystemException if a system exception occurred
1092            */
1093            public static java.util.List<com.liferay.portal.model.Role> findAll()
1094                    throws com.liferay.portal.kernel.exception.SystemException {
1095                    return getPersistence().findAll();
1096            }
1097    
1098            /**
1099            * Finds a range of all the roles.
1100            *
1101            * <p>
1102            * 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.
1103            * </p>
1104            *
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            * @return the range of roles
1108            * @throws SystemException if a system exception occurred
1109            */
1110            public static java.util.List<com.liferay.portal.model.Role> findAll(
1111                    int start, int end)
1112                    throws com.liferay.portal.kernel.exception.SystemException {
1113                    return getPersistence().findAll(start, end);
1114            }
1115    
1116            /**
1117            * Finds an ordered range of all the roles.
1118            *
1119            * <p>
1120            * 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.
1121            * </p>
1122            *
1123            * @param start the lower bound of the range of roles to return
1124            * @param end the upper bound of the range of roles to return (not inclusive)
1125            * @param orderByComparator the comparator to order the results by
1126            * @return the ordered range of roles
1127            * @throws SystemException if a system exception occurred
1128            */
1129            public static java.util.List<com.liferay.portal.model.Role> findAll(
1130                    int start, int end,
1131                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1132                    throws com.liferay.portal.kernel.exception.SystemException {
1133                    return getPersistence().findAll(start, end, orderByComparator);
1134            }
1135    
1136            /**
1137            * Removes all the roles where companyId = &#63; from the database.
1138            *
1139            * @param companyId the company ID to search with
1140            * @throws SystemException if a system exception occurred
1141            */
1142            public static void removeByCompanyId(long companyId)
1143                    throws com.liferay.portal.kernel.exception.SystemException {
1144                    getPersistence().removeByCompanyId(companyId);
1145            }
1146    
1147            /**
1148            * Removes all the roles where name = &#63; from the database.
1149            *
1150            * @param name the name to search with
1151            * @throws SystemException if a system exception occurred
1152            */
1153            public static void removeByName(java.lang.String name)
1154                    throws com.liferay.portal.kernel.exception.SystemException {
1155                    getPersistence().removeByName(name);
1156            }
1157    
1158            /**
1159            * Removes all the roles where subtype = &#63; from the database.
1160            *
1161            * @param subtype the subtype to search with
1162            * @throws SystemException if a system exception occurred
1163            */
1164            public static void removeBySubtype(java.lang.String subtype)
1165                    throws com.liferay.portal.kernel.exception.SystemException {
1166                    getPersistence().removeBySubtype(subtype);
1167            }
1168    
1169            /**
1170            * Removes the role where companyId = &#63; and name = &#63; from the database.
1171            *
1172            * @param companyId the company ID to search with
1173            * @param name the name to search with
1174            * @throws SystemException if a system exception occurred
1175            */
1176            public static void removeByC_N(long companyId, java.lang.String name)
1177                    throws com.liferay.portal.NoSuchRoleException,
1178                            com.liferay.portal.kernel.exception.SystemException {
1179                    getPersistence().removeByC_N(companyId, name);
1180            }
1181    
1182            /**
1183            * Removes all the roles where type = &#63; and subtype = &#63; from the database.
1184            *
1185            * @param type the type to search with
1186            * @param subtype the subtype to search with
1187            * @throws SystemException if a system exception occurred
1188            */
1189            public static void removeByT_S(int type, java.lang.String subtype)
1190                    throws com.liferay.portal.kernel.exception.SystemException {
1191                    getPersistence().removeByT_S(type, subtype);
1192            }
1193    
1194            /**
1195            * Removes the role where companyId = &#63; and classNameId = &#63; and classPK = &#63; from the database.
1196            *
1197            * @param companyId the company ID to search with
1198            * @param classNameId the class name ID to search with
1199            * @param classPK the class p k to search with
1200            * @throws SystemException if a system exception occurred
1201            */
1202            public static void removeByC_C_C(long companyId, long classNameId,
1203                    long classPK)
1204                    throws com.liferay.portal.NoSuchRoleException,
1205                            com.liferay.portal.kernel.exception.SystemException {
1206                    getPersistence().removeByC_C_C(companyId, classNameId, classPK);
1207            }
1208    
1209            /**
1210            * Removes all the roles from the database.
1211            *
1212            * @throws SystemException if a system exception occurred
1213            */
1214            public static void removeAll()
1215                    throws com.liferay.portal.kernel.exception.SystemException {
1216                    getPersistence().removeAll();
1217            }
1218    
1219            /**
1220            * Counts all the roles where companyId = &#63;.
1221            *
1222            * @param companyId the company ID to search with
1223            * @return the number of matching roles
1224            * @throws SystemException if a system exception occurred
1225            */
1226            public static int countByCompanyId(long companyId)
1227                    throws com.liferay.portal.kernel.exception.SystemException {
1228                    return getPersistence().countByCompanyId(companyId);
1229            }
1230    
1231            /**
1232            * Filters by the user's permissions and counts all the roles where companyId = &#63;.
1233            *
1234            * @param companyId the company ID to search with
1235            * @return the number of matching roles that the user has permission to view
1236            * @throws SystemException if a system exception occurred
1237            */
1238            public static int filterCountByCompanyId(long companyId)
1239                    throws com.liferay.portal.kernel.exception.SystemException {
1240                    return getPersistence().filterCountByCompanyId(companyId);
1241            }
1242    
1243            /**
1244            * Counts all the roles where name = &#63;.
1245            *
1246            * @param name the name to search with
1247            * @return the number of matching roles
1248            * @throws SystemException if a system exception occurred
1249            */
1250            public static int countByName(java.lang.String name)
1251                    throws com.liferay.portal.kernel.exception.SystemException {
1252                    return getPersistence().countByName(name);
1253            }
1254    
1255            /**
1256            * Filters by the user's permissions and counts all the roles where name = &#63;.
1257            *
1258            * @param name the name to search with
1259            * @return the number of matching roles that the user has permission to view
1260            * @throws SystemException if a system exception occurred
1261            */
1262            public static int filterCountByName(java.lang.String name)
1263                    throws com.liferay.portal.kernel.exception.SystemException {
1264                    return getPersistence().filterCountByName(name);
1265            }
1266    
1267            /**
1268            * Counts all the roles where subtype = &#63;.
1269            *
1270            * @param subtype the subtype to search with
1271            * @return the number of matching roles
1272            * @throws SystemException if a system exception occurred
1273            */
1274            public static int countBySubtype(java.lang.String subtype)
1275                    throws com.liferay.portal.kernel.exception.SystemException {
1276                    return getPersistence().countBySubtype(subtype);
1277            }
1278    
1279            /**
1280            * Filters by the user's permissions and counts all the roles where subtype = &#63;.
1281            *
1282            * @param subtype the subtype to search with
1283            * @return the number of matching roles that the user has permission to view
1284            * @throws SystemException if a system exception occurred
1285            */
1286            public static int filterCountBySubtype(java.lang.String subtype)
1287                    throws com.liferay.portal.kernel.exception.SystemException {
1288                    return getPersistence().filterCountBySubtype(subtype);
1289            }
1290    
1291            /**
1292            * Counts all the roles where companyId = &#63; and name = &#63;.
1293            *
1294            * @param companyId the company ID to search with
1295            * @param name the name to search with
1296            * @return the number of matching roles
1297            * @throws SystemException if a system exception occurred
1298            */
1299            public static int countByC_N(long companyId, java.lang.String name)
1300                    throws com.liferay.portal.kernel.exception.SystemException {
1301                    return getPersistence().countByC_N(companyId, name);
1302            }
1303    
1304            /**
1305            * Counts all the roles where type = &#63; and subtype = &#63;.
1306            *
1307            * @param type the type to search with
1308            * @param subtype the subtype to search with
1309            * @return the number of matching roles
1310            * @throws SystemException if a system exception occurred
1311            */
1312            public static int countByT_S(int type, java.lang.String subtype)
1313                    throws com.liferay.portal.kernel.exception.SystemException {
1314                    return getPersistence().countByT_S(type, subtype);
1315            }
1316    
1317            /**
1318            * Filters by the user's permissions and counts all the roles where type = &#63; and subtype = &#63;.
1319            *
1320            * @param type the type to search with
1321            * @param subtype the subtype to search with
1322            * @return the number of matching roles that the user has permission to view
1323            * @throws SystemException if a system exception occurred
1324            */
1325            public static int filterCountByT_S(int type, java.lang.String subtype)
1326                    throws com.liferay.portal.kernel.exception.SystemException {
1327                    return getPersistence().filterCountByT_S(type, subtype);
1328            }
1329    
1330            /**
1331            * Counts all the roles where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
1332            *
1333            * @param companyId the company ID to search with
1334            * @param classNameId the class name ID to search with
1335            * @param classPK the class p k to search with
1336            * @return the number of matching roles
1337            * @throws SystemException if a system exception occurred
1338            */
1339            public static int countByC_C_C(long companyId, long classNameId,
1340                    long classPK)
1341                    throws com.liferay.portal.kernel.exception.SystemException {
1342                    return getPersistence().countByC_C_C(companyId, classNameId, classPK);
1343            }
1344    
1345            /**
1346            * Counts all the roles.
1347            *
1348            * @return the number of roles
1349            * @throws SystemException if a system exception occurred
1350            */
1351            public static int countAll()
1352                    throws com.liferay.portal.kernel.exception.SystemException {
1353                    return getPersistence().countAll();
1354            }
1355    
1356            /**
1357            * Gets all the groups associated with the role.
1358            *
1359            * @param pk the primary key of the role to get the associated groups for
1360            * @return the groups associated with the role
1361            * @throws SystemException if a system exception occurred
1362            */
1363            public static java.util.List<com.liferay.portal.model.Group> getGroups(
1364                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
1365                    return getPersistence().getGroups(pk);
1366            }
1367    
1368            /**
1369            * Gets a range of all the groups associated with the role.
1370            *
1371            * <p>
1372            * 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.
1373            * </p>
1374            *
1375            * @param pk the primary key of the role to get the associated groups for
1376            * @param start the lower bound of the range of roles to return
1377            * @param end the upper bound of the range of roles to return (not inclusive)
1378            * @return the range of groups associated with the role
1379            * @throws SystemException if a system exception occurred
1380            */
1381            public static java.util.List<com.liferay.portal.model.Group> getGroups(
1382                    long pk, int start, int end)
1383                    throws com.liferay.portal.kernel.exception.SystemException {
1384                    return getPersistence().getGroups(pk, start, end);
1385            }
1386    
1387            /**
1388            * Gets an ordered range of all the groups associated with the role.
1389            *
1390            * <p>
1391            * 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.
1392            * </p>
1393            *
1394            * @param pk the primary key of the role to get the associated groups for
1395            * @param start the lower bound of the range of roles to return
1396            * @param end the upper bound of the range of roles to return (not inclusive)
1397            * @param orderByComparator the comparator to order the results by
1398            * @return the ordered range of groups associated with the role
1399            * @throws SystemException if a system exception occurred
1400            */
1401            public static java.util.List<com.liferay.portal.model.Group> getGroups(
1402                    long pk, int start, int end,
1403                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1404                    throws com.liferay.portal.kernel.exception.SystemException {
1405                    return getPersistence().getGroups(pk, start, end, orderByComparator);
1406            }
1407    
1408            /**
1409            * Gets the number of groups associated with the role.
1410            *
1411            * @param pk the primary key of the role to get the number of associated groups for
1412            * @return the number of groups associated with the role
1413            * @throws SystemException if a system exception occurred
1414            */
1415            public static int getGroupsSize(long pk)
1416                    throws com.liferay.portal.kernel.exception.SystemException {
1417                    return getPersistence().getGroupsSize(pk);
1418            }
1419    
1420            /**
1421            * Determines if the group is associated with the role.
1422            *
1423            * @param pk the primary key of the role
1424            * @param groupPK the primary key of the group
1425            * @return <code>true</code> if the group is associated with the role; <code>false</code> otherwise
1426            * @throws SystemException if a system exception occurred
1427            */
1428            public static boolean containsGroup(long pk, long groupPK)
1429                    throws com.liferay.portal.kernel.exception.SystemException {
1430                    return getPersistence().containsGroup(pk, groupPK);
1431            }
1432    
1433            /**
1434            * Determines if the role has any groups associated with it.
1435            *
1436            * @param pk the primary key of the role to check for associations with groups
1437            * @return <code>true</code> if the role has any groups associated with it; <code>false</code> otherwise
1438            * @throws SystemException if a system exception occurred
1439            */
1440            public static boolean containsGroups(long pk)
1441                    throws com.liferay.portal.kernel.exception.SystemException {
1442                    return getPersistence().containsGroups(pk);
1443            }
1444    
1445            /**
1446            * Adds an association between the role and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1447            *
1448            * @param pk the primary key of the role
1449            * @param groupPK the primary key of the group
1450            * @throws SystemException if a system exception occurred
1451            */
1452            public static void addGroup(long pk, long groupPK)
1453                    throws com.liferay.portal.kernel.exception.SystemException {
1454                    getPersistence().addGroup(pk, groupPK);
1455            }
1456    
1457            /**
1458            * Adds an association between the role and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1459            *
1460            * @param pk the primary key of the role
1461            * @param group the group
1462            * @throws SystemException if a system exception occurred
1463            */
1464            public static void addGroup(long pk, com.liferay.portal.model.Group group)
1465                    throws com.liferay.portal.kernel.exception.SystemException {
1466                    getPersistence().addGroup(pk, group);
1467            }
1468    
1469            /**
1470            * Adds an association between the role and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1471            *
1472            * @param pk the primary key of the role
1473            * @param groupPKs the primary keys of the groups
1474            * @throws SystemException if a system exception occurred
1475            */
1476            public static void addGroups(long pk, long[] groupPKs)
1477                    throws com.liferay.portal.kernel.exception.SystemException {
1478                    getPersistence().addGroups(pk, groupPKs);
1479            }
1480    
1481            /**
1482            * Adds an association between the role and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1483            *
1484            * @param pk the primary key of the role
1485            * @param groups the groups
1486            * @throws SystemException if a system exception occurred
1487            */
1488            public static void addGroups(long pk,
1489                    java.util.List<com.liferay.portal.model.Group> groups)
1490                    throws com.liferay.portal.kernel.exception.SystemException {
1491                    getPersistence().addGroups(pk, groups);
1492            }
1493    
1494            /**
1495            * Clears all associations between the role and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1496            *
1497            * @param pk the primary key of the role to clear the associated groups from
1498            * @throws SystemException if a system exception occurred
1499            */
1500            public static void clearGroups(long pk)
1501                    throws com.liferay.portal.kernel.exception.SystemException {
1502                    getPersistence().clearGroups(pk);
1503            }
1504    
1505            /**
1506            * Removes the association between the role and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1507            *
1508            * @param pk the primary key of the role
1509            * @param groupPK the primary key of the group
1510            * @throws SystemException if a system exception occurred
1511            */
1512            public static void removeGroup(long pk, long groupPK)
1513                    throws com.liferay.portal.kernel.exception.SystemException {
1514                    getPersistence().removeGroup(pk, groupPK);
1515            }
1516    
1517            /**
1518            * Removes the association between the role and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1519            *
1520            * @param pk the primary key of the role
1521            * @param group the group
1522            * @throws SystemException if a system exception occurred
1523            */
1524            public static void removeGroup(long pk, com.liferay.portal.model.Group group)
1525                    throws com.liferay.portal.kernel.exception.SystemException {
1526                    getPersistence().removeGroup(pk, group);
1527            }
1528    
1529            /**
1530            * Removes the association between the role and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1531            *
1532            * @param pk the primary key of the role
1533            * @param groupPKs the primary keys of the groups
1534            * @throws SystemException if a system exception occurred
1535            */
1536            public static void removeGroups(long pk, long[] groupPKs)
1537                    throws com.liferay.portal.kernel.exception.SystemException {
1538                    getPersistence().removeGroups(pk, groupPKs);
1539            }
1540    
1541            /**
1542            * Removes the association between the role and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1543            *
1544            * @param pk the primary key of the role
1545            * @param groups the groups
1546            * @throws SystemException if a system exception occurred
1547            */
1548            public static void removeGroups(long pk,
1549                    java.util.List<com.liferay.portal.model.Group> groups)
1550                    throws com.liferay.portal.kernel.exception.SystemException {
1551                    getPersistence().removeGroups(pk, groups);
1552            }
1553    
1554            /**
1555            * 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.
1556            *
1557            * @param pk the primary key of the role to set the associations for
1558            * @param groupPKs the primary keys of the groups to be associated with the role
1559            * @throws SystemException if a system exception occurred
1560            */
1561            public static void setGroups(long pk, long[] groupPKs)
1562                    throws com.liferay.portal.kernel.exception.SystemException {
1563                    getPersistence().setGroups(pk, groupPKs);
1564            }
1565    
1566            /**
1567            * 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.
1568            *
1569            * @param pk the primary key of the role to set the associations for
1570            * @param groups the groups to be associated with the role
1571            * @throws SystemException if a system exception occurred
1572            */
1573            public static void setGroups(long pk,
1574                    java.util.List<com.liferay.portal.model.Group> groups)
1575                    throws com.liferay.portal.kernel.exception.SystemException {
1576                    getPersistence().setGroups(pk, groups);
1577            }
1578    
1579            /**
1580            * Gets all the permissions associated with the role.
1581            *
1582            * @param pk the primary key of the role to get the associated permissions for
1583            * @return the permissions associated with the role
1584            * @throws SystemException if a system exception occurred
1585            */
1586            public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
1587                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
1588                    return getPersistence().getPermissions(pk);
1589            }
1590    
1591            /**
1592            * Gets a range of all the permissions associated with the role.
1593            *
1594            * <p>
1595            * 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.
1596            * </p>
1597            *
1598            * @param pk the primary key of the role to get the associated permissions for
1599            * @param start the lower bound of the range of roles to return
1600            * @param end the upper bound of the range of roles to return (not inclusive)
1601            * @return the range of permissions associated with the role
1602            * @throws SystemException if a system exception occurred
1603            */
1604            public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
1605                    long pk, int start, int end)
1606                    throws com.liferay.portal.kernel.exception.SystemException {
1607                    return getPersistence().getPermissions(pk, start, end);
1608            }
1609    
1610            /**
1611            * Gets an ordered range of all the permissions associated with the role.
1612            *
1613            * <p>
1614            * 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.
1615            * </p>
1616            *
1617            * @param pk the primary key of the role to get the associated permissions for
1618            * @param start the lower bound of the range of roles to return
1619            * @param end the upper bound of the range of roles to return (not inclusive)
1620            * @param orderByComparator the comparator to order the results by
1621            * @return the ordered range of permissions associated with the role
1622            * @throws SystemException if a system exception occurred
1623            */
1624            public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
1625                    long pk, int start, int end,
1626                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1627                    throws com.liferay.portal.kernel.exception.SystemException {
1628                    return getPersistence().getPermissions(pk, start, end, orderByComparator);
1629            }
1630    
1631            /**
1632            * Gets the number of permissions associated with the role.
1633            *
1634            * @param pk the primary key of the role to get the number of associated permissions for
1635            * @return the number of permissions associated with the role
1636            * @throws SystemException if a system exception occurred
1637            */
1638            public static int getPermissionsSize(long pk)
1639                    throws com.liferay.portal.kernel.exception.SystemException {
1640                    return getPersistence().getPermissionsSize(pk);
1641            }
1642    
1643            /**
1644            * Determines if the permission is associated with the role.
1645            *
1646            * @param pk the primary key of the role
1647            * @param permissionPK the primary key of the permission
1648            * @return <code>true</code> if the permission is associated with the role; <code>false</code> otherwise
1649            * @throws SystemException if a system exception occurred
1650            */
1651            public static boolean containsPermission(long pk, long permissionPK)
1652                    throws com.liferay.portal.kernel.exception.SystemException {
1653                    return getPersistence().containsPermission(pk, permissionPK);
1654            }
1655    
1656            /**
1657            * Determines if the role has any permissions associated with it.
1658            *
1659            * @param pk the primary key of the role to check for associations with permissions
1660            * @return <code>true</code> if the role has any permissions associated with it; <code>false</code> otherwise
1661            * @throws SystemException if a system exception occurred
1662            */
1663            public static boolean containsPermissions(long pk)
1664                    throws com.liferay.portal.kernel.exception.SystemException {
1665                    return getPersistence().containsPermissions(pk);
1666            }
1667    
1668            /**
1669            * Adds an association between the role and the permission. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1670            *
1671            * @param pk the primary key of the role
1672            * @param permissionPK the primary key of the permission
1673            * @throws SystemException if a system exception occurred
1674            */
1675            public static void addPermission(long pk, long permissionPK)
1676                    throws com.liferay.portal.kernel.exception.SystemException {
1677                    getPersistence().addPermission(pk, permissionPK);
1678            }
1679    
1680            /**
1681            * Adds an association between the role and the permission. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1682            *
1683            * @param pk the primary key of the role
1684            * @param permission the permission
1685            * @throws SystemException if a system exception occurred
1686            */
1687            public static void addPermission(long pk,
1688                    com.liferay.portal.model.Permission permission)
1689                    throws com.liferay.portal.kernel.exception.SystemException {
1690                    getPersistence().addPermission(pk, permission);
1691            }
1692    
1693            /**
1694            * Adds an association between the role and the permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1695            *
1696            * @param pk the primary key of the role
1697            * @param permissionPKs the primary keys of the permissions
1698            * @throws SystemException if a system exception occurred
1699            */
1700            public static void addPermissions(long pk, long[] permissionPKs)
1701                    throws com.liferay.portal.kernel.exception.SystemException {
1702                    getPersistence().addPermissions(pk, permissionPKs);
1703            }
1704    
1705            /**
1706            * Adds an association between the role and the permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1707            *
1708            * @param pk the primary key of the role
1709            * @param permissions the permissions
1710            * @throws SystemException if a system exception occurred
1711            */
1712            public static void addPermissions(long pk,
1713                    java.util.List<com.liferay.portal.model.Permission> permissions)
1714                    throws com.liferay.portal.kernel.exception.SystemException {
1715                    getPersistence().addPermissions(pk, permissions);
1716            }
1717    
1718            /**
1719            * Clears all associations between the role and its permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1720            *
1721            * @param pk the primary key of the role to clear the associated permissions from
1722            * @throws SystemException if a system exception occurred
1723            */
1724            public static void clearPermissions(long pk)
1725                    throws com.liferay.portal.kernel.exception.SystemException {
1726                    getPersistence().clearPermissions(pk);
1727            }
1728    
1729            /**
1730            * Removes the association between the role and the permission. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1731            *
1732            * @param pk the primary key of the role
1733            * @param permissionPK the primary key of the permission
1734            * @throws SystemException if a system exception occurred
1735            */
1736            public static void removePermission(long pk, long permissionPK)
1737                    throws com.liferay.portal.kernel.exception.SystemException {
1738                    getPersistence().removePermission(pk, permissionPK);
1739            }
1740    
1741            /**
1742            * Removes the association between the role and the permission. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1743            *
1744            * @param pk the primary key of the role
1745            * @param permission the permission
1746            * @throws SystemException if a system exception occurred
1747            */
1748            public static void removePermission(long pk,
1749                    com.liferay.portal.model.Permission permission)
1750                    throws com.liferay.portal.kernel.exception.SystemException {
1751                    getPersistence().removePermission(pk, permission);
1752            }
1753    
1754            /**
1755            * Removes the association between the role and the permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1756            *
1757            * @param pk the primary key of the role
1758            * @param permissionPKs the primary keys of the permissions
1759            * @throws SystemException if a system exception occurred
1760            */
1761            public static void removePermissions(long pk, long[] permissionPKs)
1762                    throws com.liferay.portal.kernel.exception.SystemException {
1763                    getPersistence().removePermissions(pk, permissionPKs);
1764            }
1765    
1766            /**
1767            * Removes the association between the role and the permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1768            *
1769            * @param pk the primary key of the role
1770            * @param permissions the permissions
1771            * @throws SystemException if a system exception occurred
1772            */
1773            public static void removePermissions(long pk,
1774                    java.util.List<com.liferay.portal.model.Permission> permissions)
1775                    throws com.liferay.portal.kernel.exception.SystemException {
1776                    getPersistence().removePermissions(pk, permissions);
1777            }
1778    
1779            /**
1780            * 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.
1781            *
1782            * @param pk the primary key of the role to set the associations for
1783            * @param permissionPKs the primary keys of the permissions to be associated with the role
1784            * @throws SystemException if a system exception occurred
1785            */
1786            public static void setPermissions(long pk, long[] permissionPKs)
1787                    throws com.liferay.portal.kernel.exception.SystemException {
1788                    getPersistence().setPermissions(pk, permissionPKs);
1789            }
1790    
1791            /**
1792            * 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.
1793            *
1794            * @param pk the primary key of the role to set the associations for
1795            * @param permissions the permissions to be associated with the role
1796            * @throws SystemException if a system exception occurred
1797            */
1798            public static void setPermissions(long pk,
1799                    java.util.List<com.liferay.portal.model.Permission> permissions)
1800                    throws com.liferay.portal.kernel.exception.SystemException {
1801                    getPersistence().setPermissions(pk, permissions);
1802            }
1803    
1804            /**
1805            * Gets all the users associated with the role.
1806            *
1807            * @param pk the primary key of the role to get the associated users for
1808            * @return the users associated with the role
1809            * @throws SystemException if a system exception occurred
1810            */
1811            public static java.util.List<com.liferay.portal.model.User> getUsers(
1812                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
1813                    return getPersistence().getUsers(pk);
1814            }
1815    
1816            /**
1817            * Gets a range of all the users associated with the role.
1818            *
1819            * <p>
1820            * 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.
1821            * </p>
1822            *
1823            * @param pk the primary key of the role to get the associated users for
1824            * @param start the lower bound of the range of roles to return
1825            * @param end the upper bound of the range of roles to return (not inclusive)
1826            * @return the range of users associated with the role
1827            * @throws SystemException if a system exception occurred
1828            */
1829            public static java.util.List<com.liferay.portal.model.User> getUsers(
1830                    long pk, int start, int end)
1831                    throws com.liferay.portal.kernel.exception.SystemException {
1832                    return getPersistence().getUsers(pk, start, end);
1833            }
1834    
1835            /**
1836            * Gets an ordered range of all the users associated with the role.
1837            *
1838            * <p>
1839            * 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.
1840            * </p>
1841            *
1842            * @param pk the primary key of the role to get the associated users for
1843            * @param start the lower bound of the range of roles to return
1844            * @param end the upper bound of the range of roles to return (not inclusive)
1845            * @param orderByComparator the comparator to order the results by
1846            * @return the ordered range of users associated with the role
1847            * @throws SystemException if a system exception occurred
1848            */
1849            public static java.util.List<com.liferay.portal.model.User> getUsers(
1850                    long pk, int start, int end,
1851                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1852                    throws com.liferay.portal.kernel.exception.SystemException {
1853                    return getPersistence().getUsers(pk, start, end, orderByComparator);
1854            }
1855    
1856            /**
1857            * Gets the number of users associated with the role.
1858            *
1859            * @param pk the primary key of the role to get the number of associated users for
1860            * @return the number of users associated with the role
1861            * @throws SystemException if a system exception occurred
1862            */
1863            public static int getUsersSize(long pk)
1864                    throws com.liferay.portal.kernel.exception.SystemException {
1865                    return getPersistence().getUsersSize(pk);
1866            }
1867    
1868            /**
1869            * Determines if the user is associated with the role.
1870            *
1871            * @param pk the primary key of the role
1872            * @param userPK the primary key of the user
1873            * @return <code>true</code> if the user is associated with the role; <code>false</code> otherwise
1874            * @throws SystemException if a system exception occurred
1875            */
1876            public static boolean containsUser(long pk, long userPK)
1877                    throws com.liferay.portal.kernel.exception.SystemException {
1878                    return getPersistence().containsUser(pk, userPK);
1879            }
1880    
1881            /**
1882            * Determines if the role has any users associated with it.
1883            *
1884            * @param pk the primary key of the role to check for associations with users
1885            * @return <code>true</code> if the role has any users associated with it; <code>false</code> otherwise
1886            * @throws SystemException if a system exception occurred
1887            */
1888            public static boolean containsUsers(long pk)
1889                    throws com.liferay.portal.kernel.exception.SystemException {
1890                    return getPersistence().containsUsers(pk);
1891            }
1892    
1893            /**
1894            * Adds an association between the role and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1895            *
1896            * @param pk the primary key of the role
1897            * @param userPK the primary key of the user
1898            * @throws SystemException if a system exception occurred
1899            */
1900            public static void addUser(long pk, long userPK)
1901                    throws com.liferay.portal.kernel.exception.SystemException {
1902                    getPersistence().addUser(pk, userPK);
1903            }
1904    
1905            /**
1906            * Adds an association between the role and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1907            *
1908            * @param pk the primary key of the role
1909            * @param user the user
1910            * @throws SystemException if a system exception occurred
1911            */
1912            public static void addUser(long pk, com.liferay.portal.model.User user)
1913                    throws com.liferay.portal.kernel.exception.SystemException {
1914                    getPersistence().addUser(pk, user);
1915            }
1916    
1917            /**
1918            * Adds an association between the role and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1919            *
1920            * @param pk the primary key of the role
1921            * @param userPKs the primary keys of the users
1922            * @throws SystemException if a system exception occurred
1923            */
1924            public static void addUsers(long pk, long[] userPKs)
1925                    throws com.liferay.portal.kernel.exception.SystemException {
1926                    getPersistence().addUsers(pk, userPKs);
1927            }
1928    
1929            /**
1930            * Adds an association between the role and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1931            *
1932            * @param pk the primary key of the role
1933            * @param users the users
1934            * @throws SystemException if a system exception occurred
1935            */
1936            public static void addUsers(long pk,
1937                    java.util.List<com.liferay.portal.model.User> users)
1938                    throws com.liferay.portal.kernel.exception.SystemException {
1939                    getPersistence().addUsers(pk, users);
1940            }
1941    
1942            /**
1943            * Clears all associations between the role and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1944            *
1945            * @param pk the primary key of the role to clear the associated users from
1946            * @throws SystemException if a system exception occurred
1947            */
1948            public static void clearUsers(long pk)
1949                    throws com.liferay.portal.kernel.exception.SystemException {
1950                    getPersistence().clearUsers(pk);
1951            }
1952    
1953            /**
1954            * Removes the association between the role and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1955            *
1956            * @param pk the primary key of the role
1957            * @param userPK the primary key of the user
1958            * @throws SystemException if a system exception occurred
1959            */
1960            public static void removeUser(long pk, long userPK)
1961                    throws com.liferay.portal.kernel.exception.SystemException {
1962                    getPersistence().removeUser(pk, userPK);
1963            }
1964    
1965            /**
1966            * Removes the association between the role and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1967            *
1968            * @param pk the primary key of the role
1969            * @param user the user
1970            * @throws SystemException if a system exception occurred
1971            */
1972            public static void removeUser(long pk, com.liferay.portal.model.User user)
1973                    throws com.liferay.portal.kernel.exception.SystemException {
1974                    getPersistence().removeUser(pk, user);
1975            }
1976    
1977            /**
1978            * Removes the association between the role and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1979            *
1980            * @param pk the primary key of the role
1981            * @param userPKs the primary keys of the users
1982            * @throws SystemException if a system exception occurred
1983            */
1984            public static void removeUsers(long pk, long[] userPKs)
1985                    throws com.liferay.portal.kernel.exception.SystemException {
1986                    getPersistence().removeUsers(pk, userPKs);
1987            }
1988    
1989            /**
1990            * Removes the association between the role and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1991            *
1992            * @param pk the primary key of the role
1993            * @param users the users
1994            * @throws SystemException if a system exception occurred
1995            */
1996            public static void removeUsers(long pk,
1997                    java.util.List<com.liferay.portal.model.User> users)
1998                    throws com.liferay.portal.kernel.exception.SystemException {
1999                    getPersistence().removeUsers(pk, users);
2000            }
2001    
2002            /**
2003            * 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.
2004            *
2005            * @param pk the primary key of the role to set the associations for
2006            * @param userPKs the primary keys of the users to be associated with the role
2007            * @throws SystemException if a system exception occurred
2008            */
2009            public static void setUsers(long pk, long[] userPKs)
2010                    throws com.liferay.portal.kernel.exception.SystemException {
2011                    getPersistence().setUsers(pk, userPKs);
2012            }
2013    
2014            /**
2015            * 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.
2016            *
2017            * @param pk the primary key of the role to set the associations for
2018            * @param users the users to be associated with the role
2019            * @throws SystemException if a system exception occurred
2020            */
2021            public static void setUsers(long pk,
2022                    java.util.List<com.liferay.portal.model.User> users)
2023                    throws com.liferay.portal.kernel.exception.SystemException {
2024                    getPersistence().setUsers(pk, users);
2025            }
2026    
2027            public static RolePersistence getPersistence() {
2028                    if (_persistence == null) {
2029                            _persistence = (RolePersistence)PortalBeanLocatorUtil.locate(RolePersistence.class.getName());
2030    
2031                            ReferenceRegistry.registerReference(RoleUtil.class, "_persistence");
2032                    }
2033    
2034                    return _persistence;
2035            }
2036    
2037            public void setPersistence(RolePersistence persistence) {
2038                    _persistence = persistence;
2039    
2040                    ReferenceRegistry.registerReference(RoleUtil.class, "_persistence");
2041            }
2042    
2043            private static RolePersistence _persistence;
2044    }