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