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