001    /**
002     * Copyright (c) 2000-2012 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.Permission;
018    
019    /**
020     * The persistence interface for the permission service.
021     *
022     * <p>
023     * Caching information and settings can be found in <code>portal.properties</code>
024     * </p>
025     *
026     * @author Brian Wing Shun Chan
027     * @see PermissionPersistenceImpl
028     * @see PermissionUtil
029     * @generated
030     */
031    public interface PermissionPersistence extends BasePersistence<Permission> {
032            /*
033             * NOTE FOR DEVELOPERS:
034             *
035             * Never modify or reference this interface directly. Always use {@link PermissionUtil} to access the permission persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
036             */
037    
038            /**
039            * Caches the permission in the entity cache if it is enabled.
040            *
041            * @param permission the permission
042            */
043            public void cacheResult(com.liferay.portal.model.Permission permission);
044    
045            /**
046            * Caches the permissions in the entity cache if it is enabled.
047            *
048            * @param permissions the permissions
049            */
050            public void cacheResult(
051                    java.util.List<com.liferay.portal.model.Permission> permissions);
052    
053            /**
054            * Creates a new permission with the primary key. Does not add the permission to the database.
055            *
056            * @param permissionId the primary key for the new permission
057            * @return the new permission
058            */
059            public com.liferay.portal.model.Permission create(long permissionId);
060    
061            /**
062            * Removes the permission with the primary key from the database. Also notifies the appropriate model listeners.
063            *
064            * @param permissionId the primary key of the permission
065            * @return the permission that was removed
066            * @throws com.liferay.portal.NoSuchPermissionException if a permission with the primary key could not be found
067            * @throws SystemException if a system exception occurred
068            */
069            public com.liferay.portal.model.Permission remove(long permissionId)
070                    throws com.liferay.portal.NoSuchPermissionException,
071                            com.liferay.portal.kernel.exception.SystemException;
072    
073            public com.liferay.portal.model.Permission updateImpl(
074                    com.liferay.portal.model.Permission permission, boolean merge)
075                    throws com.liferay.portal.kernel.exception.SystemException;
076    
077            /**
078            * Returns the permission with the primary key or throws a {@link com.liferay.portal.NoSuchPermissionException} if it could not be found.
079            *
080            * @param permissionId the primary key of the permission
081            * @return the permission
082            * @throws com.liferay.portal.NoSuchPermissionException if a permission with the primary key could not be found
083            * @throws SystemException if a system exception occurred
084            */
085            public com.liferay.portal.model.Permission findByPrimaryKey(
086                    long permissionId)
087                    throws com.liferay.portal.NoSuchPermissionException,
088                            com.liferay.portal.kernel.exception.SystemException;
089    
090            /**
091            * Returns the permission with the primary key or returns <code>null</code> if it could not be found.
092            *
093            * @param permissionId the primary key of the permission
094            * @return the permission, or <code>null</code> if a permission with the primary key could not be found
095            * @throws SystemException if a system exception occurred
096            */
097            public com.liferay.portal.model.Permission fetchByPrimaryKey(
098                    long permissionId)
099                    throws com.liferay.portal.kernel.exception.SystemException;
100    
101            /**
102            * Returns all the permissions where resourceId = &#63;.
103            *
104            * @param resourceId the resource ID
105            * @return the matching permissions
106            * @throws SystemException if a system exception occurred
107            */
108            public java.util.List<com.liferay.portal.model.Permission> findByResourceId(
109                    long resourceId)
110                    throws com.liferay.portal.kernel.exception.SystemException;
111    
112            /**
113            * Returns a range of all the permissions where resourceId = &#63;.
114            *
115            * <p>
116            * 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.
117            * </p>
118            *
119            * @param resourceId the resource ID
120            * @param start the lower bound of the range of permissions
121            * @param end the upper bound of the range of permissions (not inclusive)
122            * @return the range of matching permissions
123            * @throws SystemException if a system exception occurred
124            */
125            public java.util.List<com.liferay.portal.model.Permission> findByResourceId(
126                    long resourceId, int start, int end)
127                    throws com.liferay.portal.kernel.exception.SystemException;
128    
129            /**
130            * Returns an ordered range of all the permissions where resourceId = &#63;.
131            *
132            * <p>
133            * 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.
134            * </p>
135            *
136            * @param resourceId the resource ID
137            * @param start the lower bound of the range of permissions
138            * @param end the upper bound of the range of permissions (not inclusive)
139            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
140            * @return the ordered range of matching permissions
141            * @throws SystemException if a system exception occurred
142            */
143            public java.util.List<com.liferay.portal.model.Permission> findByResourceId(
144                    long resourceId, int start, int end,
145                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
146                    throws com.liferay.portal.kernel.exception.SystemException;
147    
148            /**
149            * Returns the first permission in the ordered set where resourceId = &#63;.
150            *
151            * <p>
152            * 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.
153            * </p>
154            *
155            * @param resourceId the resource ID
156            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
157            * @return the first matching permission
158            * @throws com.liferay.portal.NoSuchPermissionException if a matching permission could not be found
159            * @throws SystemException if a system exception occurred
160            */
161            public com.liferay.portal.model.Permission findByResourceId_First(
162                    long resourceId,
163                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
164                    throws com.liferay.portal.NoSuchPermissionException,
165                            com.liferay.portal.kernel.exception.SystemException;
166    
167            /**
168            * Returns the last permission in the ordered set where resourceId = &#63;.
169            *
170            * <p>
171            * 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.
172            * </p>
173            *
174            * @param resourceId the resource ID
175            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
176            * @return the last matching permission
177            * @throws com.liferay.portal.NoSuchPermissionException if a matching permission could not be found
178            * @throws SystemException if a system exception occurred
179            */
180            public com.liferay.portal.model.Permission findByResourceId_Last(
181                    long resourceId,
182                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
183                    throws com.liferay.portal.NoSuchPermissionException,
184                            com.liferay.portal.kernel.exception.SystemException;
185    
186            /**
187            * Returns the permissions before and after the current permission in the ordered set where resourceId = &#63;.
188            *
189            * <p>
190            * 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.
191            * </p>
192            *
193            * @param permissionId the primary key of the current permission
194            * @param resourceId the resource ID
195            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
196            * @return the previous, current, and next permission
197            * @throws com.liferay.portal.NoSuchPermissionException if a permission with the primary key could not be found
198            * @throws SystemException if a system exception occurred
199            */
200            public com.liferay.portal.model.Permission[] findByResourceId_PrevAndNext(
201                    long permissionId, long resourceId,
202                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
203                    throws com.liferay.portal.NoSuchPermissionException,
204                            com.liferay.portal.kernel.exception.SystemException;
205    
206            /**
207            * Returns the permission where actionId = &#63; and resourceId = &#63; or throws a {@link com.liferay.portal.NoSuchPermissionException} if it could not be found.
208            *
209            * @param actionId the action ID
210            * @param resourceId the resource ID
211            * @return the matching permission
212            * @throws com.liferay.portal.NoSuchPermissionException if a matching permission could not be found
213            * @throws SystemException if a system exception occurred
214            */
215            public com.liferay.portal.model.Permission findByA_R(
216                    java.lang.String actionId, long resourceId)
217                    throws com.liferay.portal.NoSuchPermissionException,
218                            com.liferay.portal.kernel.exception.SystemException;
219    
220            /**
221            * Returns the permission where actionId = &#63; and resourceId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
222            *
223            * @param actionId the action ID
224            * @param resourceId the resource ID
225            * @return the matching permission, or <code>null</code> if a matching permission could not be found
226            * @throws SystemException if a system exception occurred
227            */
228            public com.liferay.portal.model.Permission fetchByA_R(
229                    java.lang.String actionId, long resourceId)
230                    throws com.liferay.portal.kernel.exception.SystemException;
231    
232            /**
233            * Returns the permission where actionId = &#63; and resourceId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
234            *
235            * @param actionId the action ID
236            * @param resourceId the resource ID
237            * @param retrieveFromCache whether to use the finder cache
238            * @return the matching permission, or <code>null</code> if a matching permission could not be found
239            * @throws SystemException if a system exception occurred
240            */
241            public com.liferay.portal.model.Permission fetchByA_R(
242                    java.lang.String actionId, long resourceId, boolean retrieveFromCache)
243                    throws com.liferay.portal.kernel.exception.SystemException;
244    
245            /**
246            * Returns all the permissions.
247            *
248            * @return the permissions
249            * @throws SystemException if a system exception occurred
250            */
251            public java.util.List<com.liferay.portal.model.Permission> findAll()
252                    throws com.liferay.portal.kernel.exception.SystemException;
253    
254            /**
255            * Returns a range of all the permissions.
256            *
257            * <p>
258            * 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.
259            * </p>
260            *
261            * @param start the lower bound of the range of permissions
262            * @param end the upper bound of the range of permissions (not inclusive)
263            * @return the range of permissions
264            * @throws SystemException if a system exception occurred
265            */
266            public java.util.List<com.liferay.portal.model.Permission> findAll(
267                    int start, int end)
268                    throws com.liferay.portal.kernel.exception.SystemException;
269    
270            /**
271            * Returns an ordered range of all the permissions.
272            *
273            * <p>
274            * 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.
275            * </p>
276            *
277            * @param start the lower bound of the range of permissions
278            * @param end the upper bound of the range of permissions (not inclusive)
279            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
280            * @return the ordered range of permissions
281            * @throws SystemException if a system exception occurred
282            */
283            public java.util.List<com.liferay.portal.model.Permission> findAll(
284                    int start, int end,
285                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
286                    throws com.liferay.portal.kernel.exception.SystemException;
287    
288            /**
289            * Removes all the permissions where resourceId = &#63; from the database.
290            *
291            * @param resourceId the resource ID
292            * @throws SystemException if a system exception occurred
293            */
294            public void removeByResourceId(long resourceId)
295                    throws com.liferay.portal.kernel.exception.SystemException;
296    
297            /**
298            * Removes the permission where actionId = &#63; and resourceId = &#63; from the database.
299            *
300            * @param actionId the action ID
301            * @param resourceId the resource ID
302            * @throws SystemException if a system exception occurred
303            */
304            public void removeByA_R(java.lang.String actionId, long resourceId)
305                    throws com.liferay.portal.NoSuchPermissionException,
306                            com.liferay.portal.kernel.exception.SystemException;
307    
308            /**
309            * Removes all the permissions from the database.
310            *
311            * @throws SystemException if a system exception occurred
312            */
313            public void removeAll()
314                    throws com.liferay.portal.kernel.exception.SystemException;
315    
316            /**
317            * Returns the number of permissions where resourceId = &#63;.
318            *
319            * @param resourceId the resource ID
320            * @return the number of matching permissions
321            * @throws SystemException if a system exception occurred
322            */
323            public int countByResourceId(long resourceId)
324                    throws com.liferay.portal.kernel.exception.SystemException;
325    
326            /**
327            * Returns the number of permissions where actionId = &#63; and resourceId = &#63;.
328            *
329            * @param actionId the action ID
330            * @param resourceId the resource ID
331            * @return the number of matching permissions
332            * @throws SystemException if a system exception occurred
333            */
334            public int countByA_R(java.lang.String actionId, long resourceId)
335                    throws com.liferay.portal.kernel.exception.SystemException;
336    
337            /**
338            * Returns the number of permissions.
339            *
340            * @return the number of permissions
341            * @throws SystemException if a system exception occurred
342            */
343            public int countAll()
344                    throws com.liferay.portal.kernel.exception.SystemException;
345    
346            /**
347            * Returns all the groups associated with the permission.
348            *
349            * @param pk the primary key of the permission
350            * @return the groups associated with the permission
351            * @throws SystemException if a system exception occurred
352            */
353            public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
354                    throws com.liferay.portal.kernel.exception.SystemException;
355    
356            /**
357            * Returns a range of all the groups associated with the permission.
358            *
359            * <p>
360            * 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.
361            * </p>
362            *
363            * @param pk the primary key of the permission
364            * @param start the lower bound of the range of permissions
365            * @param end the upper bound of the range of permissions (not inclusive)
366            * @return the range of groups associated with the permission
367            * @throws SystemException if a system exception occurred
368            */
369            public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
370                    int start, int end)
371                    throws com.liferay.portal.kernel.exception.SystemException;
372    
373            /**
374            * Returns an ordered range of all the groups associated with the permission.
375            *
376            * <p>
377            * 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.
378            * </p>
379            *
380            * @param pk the primary key of the permission
381            * @param start the lower bound of the range of permissions
382            * @param end the upper bound of the range of permissions (not inclusive)
383            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
384            * @return the ordered range of groups associated with the permission
385            * @throws SystemException if a system exception occurred
386            */
387            public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
388                    int start, int end,
389                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
390                    throws com.liferay.portal.kernel.exception.SystemException;
391    
392            /**
393            * Returns the number of groups associated with the permission.
394            *
395            * @param pk the primary key of the permission
396            * @return the number of groups associated with the permission
397            * @throws SystemException if a system exception occurred
398            */
399            public int getGroupsSize(long pk)
400                    throws com.liferay.portal.kernel.exception.SystemException;
401    
402            /**
403            * Returns <code>true</code> if the group is associated with the permission.
404            *
405            * @param pk the primary key of the permission
406            * @param groupPK the primary key of the group
407            * @return <code>true</code> if the group is associated with the permission; <code>false</code> otherwise
408            * @throws SystemException if a system exception occurred
409            */
410            public boolean containsGroup(long pk, long groupPK)
411                    throws com.liferay.portal.kernel.exception.SystemException;
412    
413            /**
414            * Returns <code>true</code> if the permission has any groups associated with it.
415            *
416            * @param pk the primary key of the permission to check for associations with groups
417            * @return <code>true</code> if the permission has any groups associated with it; <code>false</code> otherwise
418            * @throws SystemException if a system exception occurred
419            */
420            public boolean containsGroups(long pk)
421                    throws com.liferay.portal.kernel.exception.SystemException;
422    
423            /**
424            * Adds an association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
425            *
426            * @param pk the primary key of the permission
427            * @param groupPK the primary key of the group
428            * @throws SystemException if a system exception occurred
429            */
430            public void addGroup(long pk, long groupPK)
431                    throws com.liferay.portal.kernel.exception.SystemException;
432    
433            /**
434            * Adds an association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
435            *
436            * @param pk the primary key of the permission
437            * @param group the group
438            * @throws SystemException if a system exception occurred
439            */
440            public void addGroup(long pk, com.liferay.portal.model.Group group)
441                    throws com.liferay.portal.kernel.exception.SystemException;
442    
443            /**
444            * Adds an association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
445            *
446            * @param pk the primary key of the permission
447            * @param groupPKs the primary keys of the groups
448            * @throws SystemException if a system exception occurred
449            */
450            public void addGroups(long pk, long[] groupPKs)
451                    throws com.liferay.portal.kernel.exception.SystemException;
452    
453            /**
454            * Adds an association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
455            *
456            * @param pk the primary key of the permission
457            * @param groups the groups
458            * @throws SystemException if a system exception occurred
459            */
460            public void addGroups(long pk,
461                    java.util.List<com.liferay.portal.model.Group> groups)
462                    throws com.liferay.portal.kernel.exception.SystemException;
463    
464            /**
465            * Clears all associations between the permission and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
466            *
467            * @param pk the primary key of the permission to clear the associated groups from
468            * @throws SystemException if a system exception occurred
469            */
470            public void clearGroups(long pk)
471                    throws com.liferay.portal.kernel.exception.SystemException;
472    
473            /**
474            * Removes the association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
475            *
476            * @param pk the primary key of the permission
477            * @param groupPK the primary key of the group
478            * @throws SystemException if a system exception occurred
479            */
480            public void removeGroup(long pk, long groupPK)
481                    throws com.liferay.portal.kernel.exception.SystemException;
482    
483            /**
484            * Removes the association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
485            *
486            * @param pk the primary key of the permission
487            * @param group the group
488            * @throws SystemException if a system exception occurred
489            */
490            public void removeGroup(long pk, com.liferay.portal.model.Group group)
491                    throws com.liferay.portal.kernel.exception.SystemException;
492    
493            /**
494            * Removes the association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
495            *
496            * @param pk the primary key of the permission
497            * @param groupPKs the primary keys of the groups
498            * @throws SystemException if a system exception occurred
499            */
500            public void removeGroups(long pk, long[] groupPKs)
501                    throws com.liferay.portal.kernel.exception.SystemException;
502    
503            /**
504            * Removes the association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
505            *
506            * @param pk the primary key of the permission
507            * @param groups the groups
508            * @throws SystemException if a system exception occurred
509            */
510            public void removeGroups(long pk,
511                    java.util.List<com.liferay.portal.model.Group> groups)
512                    throws com.liferay.portal.kernel.exception.SystemException;
513    
514            /**
515            * Sets the groups associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
516            *
517            * @param pk the primary key of the permission
518            * @param groupPKs the primary keys of the groups to be associated with the permission
519            * @throws SystemException if a system exception occurred
520            */
521            public void setGroups(long pk, long[] groupPKs)
522                    throws com.liferay.portal.kernel.exception.SystemException;
523    
524            /**
525            * Sets the groups associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
526            *
527            * @param pk the primary key of the permission
528            * @param groups the groups to be associated with the permission
529            * @throws SystemException if a system exception occurred
530            */
531            public void setGroups(long pk,
532                    java.util.List<com.liferay.portal.model.Group> groups)
533                    throws com.liferay.portal.kernel.exception.SystemException;
534    
535            /**
536            * Returns all the roles associated with the permission.
537            *
538            * @param pk the primary key of the permission
539            * @return the roles associated with the permission
540            * @throws SystemException if a system exception occurred
541            */
542            public java.util.List<com.liferay.portal.model.Role> getRoles(long pk)
543                    throws com.liferay.portal.kernel.exception.SystemException;
544    
545            /**
546            * Returns a range of all the roles associated with the permission.
547            *
548            * <p>
549            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
550            * </p>
551            *
552            * @param pk the primary key of the permission
553            * @param start the lower bound of the range of permissions
554            * @param end the upper bound of the range of permissions (not inclusive)
555            * @return the range of roles associated with the permission
556            * @throws SystemException if a system exception occurred
557            */
558            public java.util.List<com.liferay.portal.model.Role> getRoles(long pk,
559                    int start, int end)
560                    throws com.liferay.portal.kernel.exception.SystemException;
561    
562            /**
563            * Returns an ordered range of all the roles associated with the permission.
564            *
565            * <p>
566            * 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.
567            * </p>
568            *
569            * @param pk the primary key of the permission
570            * @param start the lower bound of the range of permissions
571            * @param end the upper bound of the range of permissions (not inclusive)
572            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
573            * @return the ordered range of roles associated with the permission
574            * @throws SystemException if a system exception occurred
575            */
576            public java.util.List<com.liferay.portal.model.Role> getRoles(long pk,
577                    int start, int end,
578                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
579                    throws com.liferay.portal.kernel.exception.SystemException;
580    
581            /**
582            * Returns the number of roles associated with the permission.
583            *
584            * @param pk the primary key of the permission
585            * @return the number of roles associated with the permission
586            * @throws SystemException if a system exception occurred
587            */
588            public int getRolesSize(long pk)
589                    throws com.liferay.portal.kernel.exception.SystemException;
590    
591            /**
592            * Returns <code>true</code> if the role is associated with the permission.
593            *
594            * @param pk the primary key of the permission
595            * @param rolePK the primary key of the role
596            * @return <code>true</code> if the role is associated with the permission; <code>false</code> otherwise
597            * @throws SystemException if a system exception occurred
598            */
599            public boolean containsRole(long pk, long rolePK)
600                    throws com.liferay.portal.kernel.exception.SystemException;
601    
602            /**
603            * Returns <code>true</code> if the permission has any roles associated with it.
604            *
605            * @param pk the primary key of the permission to check for associations with roles
606            * @return <code>true</code> if the permission has any roles associated with it; <code>false</code> otherwise
607            * @throws SystemException if a system exception occurred
608            */
609            public boolean containsRoles(long pk)
610                    throws com.liferay.portal.kernel.exception.SystemException;
611    
612            /**
613            * Adds an association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache.
614            *
615            * @param pk the primary key of the permission
616            * @param rolePK the primary key of the role
617            * @throws SystemException if a system exception occurred
618            */
619            public void addRole(long pk, long rolePK)
620                    throws com.liferay.portal.kernel.exception.SystemException;
621    
622            /**
623            * Adds an association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache.
624            *
625            * @param pk the primary key of the permission
626            * @param role the role
627            * @throws SystemException if a system exception occurred
628            */
629            public void addRole(long pk, com.liferay.portal.model.Role role)
630                    throws com.liferay.portal.kernel.exception.SystemException;
631    
632            /**
633            * Adds an association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.
634            *
635            * @param pk the primary key of the permission
636            * @param rolePKs the primary keys of the roles
637            * @throws SystemException if a system exception occurred
638            */
639            public void addRoles(long pk, long[] rolePKs)
640                    throws com.liferay.portal.kernel.exception.SystemException;
641    
642            /**
643            * Adds an association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.
644            *
645            * @param pk the primary key of the permission
646            * @param roles the roles
647            * @throws SystemException if a system exception occurred
648            */
649            public void addRoles(long pk,
650                    java.util.List<com.liferay.portal.model.Role> roles)
651                    throws com.liferay.portal.kernel.exception.SystemException;
652    
653            /**
654            * Clears all associations between the permission and its roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.
655            *
656            * @param pk the primary key of the permission to clear the associated roles from
657            * @throws SystemException if a system exception occurred
658            */
659            public void clearRoles(long pk)
660                    throws com.liferay.portal.kernel.exception.SystemException;
661    
662            /**
663            * Removes the association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache.
664            *
665            * @param pk the primary key of the permission
666            * @param rolePK the primary key of the role
667            * @throws SystemException if a system exception occurred
668            */
669            public void removeRole(long pk, long rolePK)
670                    throws com.liferay.portal.kernel.exception.SystemException;
671    
672            /**
673            * Removes the association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache.
674            *
675            * @param pk the primary key of the permission
676            * @param role the role
677            * @throws SystemException if a system exception occurred
678            */
679            public void removeRole(long pk, com.liferay.portal.model.Role role)
680                    throws com.liferay.portal.kernel.exception.SystemException;
681    
682            /**
683            * Removes the association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.
684            *
685            * @param pk the primary key of the permission
686            * @param rolePKs the primary keys of the roles
687            * @throws SystemException if a system exception occurred
688            */
689            public void removeRoles(long pk, long[] rolePKs)
690                    throws com.liferay.portal.kernel.exception.SystemException;
691    
692            /**
693            * Removes the association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.
694            *
695            * @param pk the primary key of the permission
696            * @param roles the roles
697            * @throws SystemException if a system exception occurred
698            */
699            public void removeRoles(long pk,
700                    java.util.List<com.liferay.portal.model.Role> roles)
701                    throws com.liferay.portal.kernel.exception.SystemException;
702    
703            /**
704            * Sets the roles associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
705            *
706            * @param pk the primary key of the permission
707            * @param rolePKs the primary keys of the roles to be associated with the permission
708            * @throws SystemException if a system exception occurred
709            */
710            public void setRoles(long pk, long[] rolePKs)
711                    throws com.liferay.portal.kernel.exception.SystemException;
712    
713            /**
714            * Sets the roles associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
715            *
716            * @param pk the primary key of the permission
717            * @param roles the roles to be associated with the permission
718            * @throws SystemException if a system exception occurred
719            */
720            public void setRoles(long pk,
721                    java.util.List<com.liferay.portal.model.Role> roles)
722                    throws com.liferay.portal.kernel.exception.SystemException;
723    
724            /**
725            * Returns all the users associated with the permission.
726            *
727            * @param pk the primary key of the permission
728            * @return the users associated with the permission
729            * @throws SystemException if a system exception occurred
730            */
731            public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
732                    throws com.liferay.portal.kernel.exception.SystemException;
733    
734            /**
735            * Returns a range of all the users associated with the permission.
736            *
737            * <p>
738            * 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.
739            * </p>
740            *
741            * @param pk the primary key of the permission
742            * @param start the lower bound of the range of permissions
743            * @param end the upper bound of the range of permissions (not inclusive)
744            * @return the range of users associated with the permission
745            * @throws SystemException if a system exception occurred
746            */
747            public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
748                    int start, int end)
749                    throws com.liferay.portal.kernel.exception.SystemException;
750    
751            /**
752            * Returns an ordered range of all the users associated with the permission.
753            *
754            * <p>
755            * 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.
756            * </p>
757            *
758            * @param pk the primary key of the permission
759            * @param start the lower bound of the range of permissions
760            * @param end the upper bound of the range of permissions (not inclusive)
761            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
762            * @return the ordered range of users associated with the permission
763            * @throws SystemException if a system exception occurred
764            */
765            public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
766                    int start, int end,
767                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
768                    throws com.liferay.portal.kernel.exception.SystemException;
769    
770            /**
771            * Returns the number of users associated with the permission.
772            *
773            * @param pk the primary key of the permission
774            * @return the number of users associated with the permission
775            * @throws SystemException if a system exception occurred
776            */
777            public int getUsersSize(long pk)
778                    throws com.liferay.portal.kernel.exception.SystemException;
779    
780            /**
781            * Returns <code>true</code> if the user is associated with the permission.
782            *
783            * @param pk the primary key of the permission
784            * @param userPK the primary key of the user
785            * @return <code>true</code> if the user is associated with the permission; <code>false</code> otherwise
786            * @throws SystemException if a system exception occurred
787            */
788            public boolean containsUser(long pk, long userPK)
789                    throws com.liferay.portal.kernel.exception.SystemException;
790    
791            /**
792            * Returns <code>true</code> if the permission has any users associated with it.
793            *
794            * @param pk the primary key of the permission to check for associations with users
795            * @return <code>true</code> if the permission has any users associated with it; <code>false</code> otherwise
796            * @throws SystemException if a system exception occurred
797            */
798            public boolean containsUsers(long pk)
799                    throws com.liferay.portal.kernel.exception.SystemException;
800    
801            /**
802            * Adds an association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
803            *
804            * @param pk the primary key of the permission
805            * @param userPK the primary key of the user
806            * @throws SystemException if a system exception occurred
807            */
808            public void addUser(long pk, long userPK)
809                    throws com.liferay.portal.kernel.exception.SystemException;
810    
811            /**
812            * Adds an association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
813            *
814            * @param pk the primary key of the permission
815            * @param user the user
816            * @throws SystemException if a system exception occurred
817            */
818            public void addUser(long pk, com.liferay.portal.model.User user)
819                    throws com.liferay.portal.kernel.exception.SystemException;
820    
821            /**
822            * Adds an association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
823            *
824            * @param pk the primary key of the permission
825            * @param userPKs the primary keys of the users
826            * @throws SystemException if a system exception occurred
827            */
828            public void addUsers(long pk, long[] userPKs)
829                    throws com.liferay.portal.kernel.exception.SystemException;
830    
831            /**
832            * Adds an association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
833            *
834            * @param pk the primary key of the permission
835            * @param users the users
836            * @throws SystemException if a system exception occurred
837            */
838            public void addUsers(long pk,
839                    java.util.List<com.liferay.portal.model.User> users)
840                    throws com.liferay.portal.kernel.exception.SystemException;
841    
842            /**
843            * Clears all associations between the permission and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
844            *
845            * @param pk the primary key of the permission to clear the associated users from
846            * @throws SystemException if a system exception occurred
847            */
848            public void clearUsers(long pk)
849                    throws com.liferay.portal.kernel.exception.SystemException;
850    
851            /**
852            * Removes the association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
853            *
854            * @param pk the primary key of the permission
855            * @param userPK the primary key of the user
856            * @throws SystemException if a system exception occurred
857            */
858            public void removeUser(long pk, long userPK)
859                    throws com.liferay.portal.kernel.exception.SystemException;
860    
861            /**
862            * Removes the association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
863            *
864            * @param pk the primary key of the permission
865            * @param user the user
866            * @throws SystemException if a system exception occurred
867            */
868            public void removeUser(long pk, com.liferay.portal.model.User user)
869                    throws com.liferay.portal.kernel.exception.SystemException;
870    
871            /**
872            * Removes the association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
873            *
874            * @param pk the primary key of the permission
875            * @param userPKs the primary keys of the users
876            * @throws SystemException if a system exception occurred
877            */
878            public void removeUsers(long pk, long[] userPKs)
879                    throws com.liferay.portal.kernel.exception.SystemException;
880    
881            /**
882            * Removes the association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
883            *
884            * @param pk the primary key of the permission
885            * @param users the users
886            * @throws SystemException if a system exception occurred
887            */
888            public void removeUsers(long pk,
889                    java.util.List<com.liferay.portal.model.User> users)
890                    throws com.liferay.portal.kernel.exception.SystemException;
891    
892            /**
893            * Sets the users associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
894            *
895            * @param pk the primary key of the permission
896            * @param userPKs the primary keys of the users to be associated with the permission
897            * @throws SystemException if a system exception occurred
898            */
899            public void setUsers(long pk, long[] userPKs)
900                    throws com.liferay.portal.kernel.exception.SystemException;
901    
902            /**
903            * Sets the users associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
904            *
905            * @param pk the primary key of the permission
906            * @param users the users to be associated with the permission
907            * @throws SystemException if a system exception occurred
908            */
909            public void setUsers(long pk,
910                    java.util.List<com.liferay.portal.model.User> users)
911                    throws com.liferay.portal.kernel.exception.SystemException;
912    }