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