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