Liferay 6.0.5

com.liferay.portal.service.persistence
Interface PermissionPersistence

All Superinterfaces:
BasePersistence<Permission>
All Known Implementing Classes:
PermissionPersistenceImpl

public interface PermissionPersistence
extends BasePersistence<Permission>

The persistence interface for the permission service.

Never modify or reference this interface directly. Always use PermissionUtil to access the permission persistence. Modify service.xml and rerun ServiceBuilder to regenerate this interface.

Caching information and settings can be found in portal.properties

See Also:
PermissionPersistenceImpl, PermissionUtil
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time is generated.

Method Summary
 void addGroup(long pk, Group group)
          Adds an association between the permission and the group.
 void addGroup(long pk, long groupPK)
          Adds an association between the permission and the group.
 void addGroups(long pk, List<Group> groups)
          Adds an association between the permission and the groups.
 void addGroups(long pk, long[] groupPKs)
          Adds an association between the permission and the groups.
 void addRole(long pk, long rolePK)
          Adds an association between the permission and the role.
 void addRole(long pk, Role role)
          Adds an association between the permission and the role.
 void addRoles(long pk, List<Role> roles)
          Adds an association between the permission and the roles.
 void addRoles(long pk, long[] rolePKs)
          Adds an association between the permission and the roles.
 void addUser(long pk, long userPK)
          Adds an association between the permission and the user.
 void addUser(long pk, User user)
          Adds an association between the permission and the user.
 void addUsers(long pk, List<User> users)
          Adds an association between the permission and the users.
 void addUsers(long pk, long[] userPKs)
          Adds an association between the permission and the users.
 void cacheResult(List<Permission> permissions)
          Caches the permissions in the entity cache if it is enabled.
 void cacheResult(Permission permission)
          Caches the permission in the entity cache if it is enabled.
 void clearGroups(long pk)
          Clears all associations between the permission and its groups.
 void clearRoles(long pk)
          Clears all associations between the permission and its roles.
 void clearUsers(long pk)
          Clears all associations between the permission and its users.
 boolean containsGroup(long pk, long groupPK)
          Determines whether the group is associated with the permission.
 boolean containsGroups(long pk)
          Determines whether the permission has any groups associated with it.
 boolean containsRole(long pk, long rolePK)
          Determines whether the role is associated with the permission.
 boolean containsRoles(long pk)
          Determines whether the permission has any roles associated with it.
 boolean containsUser(long pk, long userPK)
          Determines whether the user is associated with the permission.
 boolean containsUsers(long pk)
          Determines whether the permission has any users associated with it.
 int countAll()
          Counts all the permissions.
 int countByA_R(String actionId, long resourceId)
          Counts all the permissions where actionId = ? and resourceId = ?.
 int countByResourceId(long resourceId)
          Counts all the permissions where resourceId = ?.
 Permission create(long permissionId)
          Creates a new permission with the primary key.
 Permission fetchByA_R(String actionId, long resourceId)
          Finds the permission where actionId = ? and resourceId = ? or returns null if it could not be found.
 Permission fetchByA_R(String actionId, long resourceId, boolean retrieveFromCache)
          Finds the permission where actionId = ? and resourceId = ? or returns null if it could not be found, optionally using the finder cache.
 Permission fetchByPrimaryKey(long permissionId)
          Finds the permission with the primary key or returns null if it could not be found.
 List<Permission> findAll()
          Finds all the permissions.
 List<Permission> findAll(int start, int end)
          Finds a range of all the permissions.
 List<Permission> findAll(int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the permissions.
 Permission findByA_R(String actionId, long resourceId)
          Finds the permission where actionId = ? and resourceId = ? or throws a NoSuchPermissionException if it could not be found.
 Permission findByPrimaryKey(long permissionId)
          Finds the permission with the primary key or throws a NoSuchPermissionException if it could not be found.
 Permission findByResourceId_First(long resourceId, OrderByComparator orderByComparator)
          Finds the first permission in the ordered set where resourceId = ?.
 Permission findByResourceId_Last(long resourceId, OrderByComparator orderByComparator)
          Finds the last permission in the ordered set where resourceId = ?.
 Permission[] findByResourceId_PrevAndNext(long permissionId, long resourceId, OrderByComparator orderByComparator)
          Finds the permissions before and after the current permission in the ordered set where resourceId = ?.
 List<Permission> findByResourceId(long resourceId)
          Finds all the permissions where resourceId = ?.
 List<Permission> findByResourceId(long resourceId, int start, int end)
          Finds a range of all the permissions where resourceId = ?.
 List<Permission> findByResourceId(long resourceId, int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the permissions where resourceId = ?.
 List<Group> getGroups(long pk)
          Gets all the groups associated with the permission.
 List<Group> getGroups(long pk, int start, int end)
          Gets a range of all the groups associated with the permission.
 List<Group> getGroups(long pk, int start, int end, OrderByComparator orderByComparator)
          Gets an ordered range of all the groups associated with the permission.
 int getGroupsSize(long pk)
          Gets the number of groups associated with the permission.
 List<Role> getRoles(long pk)
          Gets all the roles associated with the permission.
 List<Role> getRoles(long pk, int start, int end)
          Gets a range of all the roles associated with the permission.
 List<Role> getRoles(long pk, int start, int end, OrderByComparator orderByComparator)
          Gets an ordered range of all the roles associated with the permission.
 int getRolesSize(long pk)
          Gets the number of roles associated with the permission.
 List<User> getUsers(long pk)
          Gets all the users associated with the permission.
 List<User> getUsers(long pk, int start, int end)
          Gets a range of all the users associated with the permission.
 List<User> getUsers(long pk, int start, int end, OrderByComparator orderByComparator)
          Gets an ordered range of all the users associated with the permission.
 int getUsersSize(long pk)
          Gets the number of users associated with the permission.
 Permission remove(long permissionId)
          Removes the permission with the primary key from the database.
 void removeAll()
          Removes all the permissions from the database.
 void removeByA_R(String actionId, long resourceId)
          Removes the permission where actionId = ? and resourceId = ? from the database.
 void removeByResourceId(long resourceId)
          Removes all the permissions where resourceId = ? from the database.
 void removeGroup(long pk, Group group)
          Removes the association between the permission and the group.
 void removeGroup(long pk, long groupPK)
          Removes the association between the permission and the group.
 void removeGroups(long pk, List<Group> groups)
          Removes the association between the permission and the groups.
 void removeGroups(long pk, long[] groupPKs)
          Removes the association between the permission and the groups.
 void removeRole(long pk, long rolePK)
          Removes the association between the permission and the role.
 void removeRole(long pk, Role role)
          Removes the association between the permission and the role.
 void removeRoles(long pk, List<Role> roles)
          Removes the association between the permission and the roles.
 void removeRoles(long pk, long[] rolePKs)
          Removes the association between the permission and the roles.
 void removeUser(long pk, long userPK)
          Removes the association between the permission and the user.
 void removeUser(long pk, User user)
          Removes the association between the permission and the user.
 void removeUsers(long pk, List<User> users)
          Removes the association between the permission and the users.
 void removeUsers(long pk, long[] userPKs)
          Removes the association between the permission and the users.
 void setGroups(long pk, List<Group> groups)
          Sets the groups associated with the permission, removing and adding associations as necessary.
 void setGroups(long pk, long[] groupPKs)
          Sets the groups associated with the permission, removing and adding associations as necessary.
 void setRoles(long pk, List<Role> roles)
          Sets the roles associated with the permission, removing and adding associations as necessary.
 void setRoles(long pk, long[] rolePKs)
          Sets the roles associated with the permission, removing and adding associations as necessary.
 void setUsers(long pk, List<User> users)
          Sets the users associated with the permission, removing and adding associations as necessary.
 void setUsers(long pk, long[] userPKs)
          Sets the users associated with the permission, removing and adding associations as necessary.
 Permission updateImpl(Permission permission, boolean merge)
           
 
Methods inherited from interface com.liferay.portal.service.persistence.BasePersistence
clearCache, clearCache, countWithDynamicQuery, fetchByPrimaryKey, findByPrimaryKey, findWithDynamicQuery, findWithDynamicQuery, findWithDynamicQuery, getDataSource, getListeners, registerListener, remove, remove, setDataSource, unregisterListener, update, update
 

Method Detail

cacheResult

void cacheResult(Permission permission)
Caches the permission in the entity cache if it is enabled.

Parameters:
permission - the permission to cache

cacheResult

void cacheResult(List<Permission> permissions)
Caches the permissions in the entity cache if it is enabled.

Parameters:
permissions - the permissions to cache

create

Permission create(long permissionId)
Creates a new permission with the primary key. Does not add the permission to the database.

Parameters:
permissionId - the primary key for the new permission
Returns:
the new permission

remove

Permission remove(long permissionId)
                  throws NoSuchPermissionException,
                         SystemException
Removes the permission with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
permissionId - the primary key of the permission to remove
Returns:
the permission that was removed
Throws:
NoSuchPermissionException - if a permission with the primary key could not be found
SystemException - if a system exception occurred

updateImpl

Permission updateImpl(Permission permission,
                      boolean merge)
                      throws SystemException
Throws:
SystemException

findByPrimaryKey

Permission findByPrimaryKey(long permissionId)
                            throws NoSuchPermissionException,
                                   SystemException
Finds the permission with the primary key or throws a NoSuchPermissionException if it could not be found.

Parameters:
permissionId - the primary key of the permission to find
Returns:
the permission
Throws:
NoSuchPermissionException - if a permission with the primary key could not be found
SystemException - if a system exception occurred

fetchByPrimaryKey

Permission fetchByPrimaryKey(long permissionId)
                             throws SystemException
Finds the permission with the primary key or returns null if it could not be found.

Parameters:
permissionId - the primary key of the permission to find
Returns:
the permission, or null if a permission with the primary key could not be found
Throws:
SystemException - if a system exception occurred

findByResourceId

List<Permission> findByResourceId(long resourceId)
                                  throws SystemException
Finds all the permissions where resourceId = ?.

Parameters:
resourceId - the resource id to search with
Returns:
the matching permissions
Throws:
SystemException - if a system exception occurred

findByResourceId

List<Permission> findByResourceId(long resourceId,
                                  int start,
                                  int end)
                                  throws SystemException
Finds a range of all the permissions where resourceId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
resourceId - the resource id to search with
start - the lower bound of the range of permissions to return
end - the upper bound of the range of permissions to return (not inclusive)
Returns:
the range of matching permissions
Throws:
SystemException - if a system exception occurred

findByResourceId

List<Permission> findByResourceId(long resourceId,
                                  int start,
                                  int end,
                                  OrderByComparator orderByComparator)
                                  throws SystemException
Finds an ordered range of all the permissions where resourceId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
resourceId - the resource id to search with
start - the lower bound of the range of permissions to return
end - the upper bound of the range of permissions to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of matching permissions
Throws:
SystemException - if a system exception occurred

findByResourceId_First

Permission findByResourceId_First(long resourceId,
                                  OrderByComparator orderByComparator)
                                  throws NoSuchPermissionException,
                                         SystemException
Finds the first permission in the ordered set where resourceId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
resourceId - the resource id to search with
orderByComparator - the comparator to order the set by
Returns:
the first matching permission
Throws:
NoSuchPermissionException - if a matching permission could not be found
SystemException - if a system exception occurred

findByResourceId_Last

Permission findByResourceId_Last(long resourceId,
                                 OrderByComparator orderByComparator)
                                 throws NoSuchPermissionException,
                                        SystemException
Finds the last permission in the ordered set where resourceId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
resourceId - the resource id to search with
orderByComparator - the comparator to order the set by
Returns:
the last matching permission
Throws:
NoSuchPermissionException - if a matching permission could not be found
SystemException - if a system exception occurred

findByResourceId_PrevAndNext

Permission[] findByResourceId_PrevAndNext(long permissionId,
                                          long resourceId,
                                          OrderByComparator orderByComparator)
                                          throws NoSuchPermissionException,
                                                 SystemException
Finds the permissions before and after the current permission in the ordered set where resourceId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
permissionId - the primary key of the current permission
resourceId - the resource id to search with
orderByComparator - the comparator to order the set by
Returns:
the previous, current, and next permission
Throws:
NoSuchPermissionException - if a permission with the primary key could not be found
SystemException - if a system exception occurred

findByA_R

Permission findByA_R(String actionId,
                     long resourceId)
                     throws NoSuchPermissionException,
                            SystemException
Finds the permission where actionId = ? and resourceId = ? or throws a NoSuchPermissionException if it could not be found.

Parameters:
actionId - the action id to search with
resourceId - the resource id to search with
Returns:
the matching permission
Throws:
NoSuchPermissionException - if a matching permission could not be found
SystemException - if a system exception occurred

fetchByA_R

Permission fetchByA_R(String actionId,
                      long resourceId)
                      throws SystemException
Finds the permission where actionId = ? and resourceId = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
actionId - the action id to search with
resourceId - the resource id to search with
Returns:
the matching permission, or null if a matching permission could not be found
Throws:
SystemException - if a system exception occurred

fetchByA_R

Permission fetchByA_R(String actionId,
                      long resourceId,
                      boolean retrieveFromCache)
                      throws SystemException
Finds the permission where actionId = ? and resourceId = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
actionId - the action id to search with
resourceId - the resource id to search with
Returns:
the matching permission, or null if a matching permission could not be found
Throws:
SystemException - if a system exception occurred

findAll

List<Permission> findAll()
                         throws SystemException
Finds all the permissions.

Returns:
the permissions
Throws:
SystemException - if a system exception occurred

findAll

List<Permission> findAll(int start,
                         int end)
                         throws SystemException
Finds a range of all the permissions.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of permissions to return
end - the upper bound of the range of permissions to return (not inclusive)
Returns:
the range of permissions
Throws:
SystemException - if a system exception occurred

findAll

List<Permission> findAll(int start,
                         int end,
                         OrderByComparator orderByComparator)
                         throws SystemException
Finds an ordered range of all the permissions.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of permissions to return
end - the upper bound of the range of permissions to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of permissions
Throws:
SystemException - if a system exception occurred

removeByResourceId

void removeByResourceId(long resourceId)
                        throws SystemException
Removes all the permissions where resourceId = ? from the database.

Parameters:
resourceId - the resource id to search with
Throws:
SystemException - if a system exception occurred

removeByA_R

void removeByA_R(String actionId,
                 long resourceId)
                 throws NoSuchPermissionException,
                        SystemException
Removes the permission where actionId = ? and resourceId = ? from the database.

Parameters:
actionId - the action id to search with
resourceId - the resource id to search with
Throws:
SystemException - if a system exception occurred
NoSuchPermissionException

removeAll

void removeAll()
               throws SystemException
Removes all the permissions from the database.

Throws:
SystemException - if a system exception occurred

countByResourceId

int countByResourceId(long resourceId)
                      throws SystemException
Counts all the permissions where resourceId = ?.

Parameters:
resourceId - the resource id to search with
Returns:
the number of matching permissions
Throws:
SystemException - if a system exception occurred

countByA_R

int countByA_R(String actionId,
               long resourceId)
               throws SystemException
Counts all the permissions where actionId = ? and resourceId = ?.

Parameters:
actionId - the action id to search with
resourceId - the resource id to search with
Returns:
the number of matching permissions
Throws:
SystemException - if a system exception occurred

countAll

int countAll()
             throws SystemException
Counts all the permissions.

Returns:
the number of permissions
Throws:
SystemException - if a system exception occurred

getGroups

List<Group> getGroups(long pk)
                      throws SystemException
Gets all the groups associated with the permission.

Parameters:
pk - the primary key of the permission to get the associated groups for
Returns:
the groups associated with the permission
Throws:
SystemException - if a system exception occurred

getGroups

List<Group> getGroups(long pk,
                      int start,
                      int end)
                      throws SystemException
Gets a range of all the groups associated with the permission.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
pk - the primary key of the permission to get the associated groups for
start - the lower bound of the range of permissions to return
end - the upper bound of the range of permissions to return (not inclusive)
Returns:
the range of groups associated with the permission
Throws:
SystemException - if a system exception occurred

getGroups

List<Group> getGroups(long pk,
                      int start,
                      int end,
                      OrderByComparator orderByComparator)
                      throws SystemException
Gets an ordered range of all the groups associated with the permission.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
pk - the primary key of the permission to get the associated groups for
start - the lower bound of the range of permissions to return
end - the upper bound of the range of permissions to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of groups associated with the permission
Throws:
SystemException - if a system exception occurred

getGroupsSize

int getGroupsSize(long pk)
                  throws SystemException
Gets the number of groups associated with the permission.

Parameters:
pk - the primary key of the permission to get the number of associated groups for
Returns:
the number of groups associated with the permission
Throws:
SystemException - if a system exception occurred

containsGroup

boolean containsGroup(long pk,
                      long groupPK)
                      throws SystemException
Determines whether the group is associated with the permission.

Parameters:
pk - the primary key of the permission
groupPK - the primary key of the group
Returns:
whether the group is associated with the permission
Throws:
SystemException - if a system exception occurred

containsGroups

boolean containsGroups(long pk)
                       throws SystemException
Determines whether the permission has any groups associated with it.

Parameters:
pk - the primary key of the permission to check for associations with groups
Returns:
whether the permission has any groups associated with it
Throws:
SystemException - if a system exception occurred

addGroup

void addGroup(long pk,
              long groupPK)
              throws SystemException
Adds an association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
groupPK - the primary key of the group
Throws:
SystemException - if a system exception occurred

addGroup

void addGroup(long pk,
              Group group)
              throws SystemException
Adds an association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
group - the group
Throws:
SystemException - if a system exception occurred

addGroups

void addGroups(long pk,
               long[] groupPKs)
               throws SystemException
Adds an association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
groupPKs - the primary keys of the groups
Throws:
SystemException - if a system exception occurred

addGroups

void addGroups(long pk,
               List<Group> groups)
               throws SystemException
Adds an association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
groups - the groups
Throws:
SystemException - if a system exception occurred

clearGroups

void clearGroups(long pk)
                 throws SystemException
Clears all associations between the permission and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission to clear the associated groups from
Throws:
SystemException - if a system exception occurred

removeGroup

void removeGroup(long pk,
                 long groupPK)
                 throws SystemException
Removes the association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
groupPK - the primary key of the group
Throws:
SystemException - if a system exception occurred

removeGroup

void removeGroup(long pk,
                 Group group)
                 throws SystemException
Removes the association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
group - the group
Throws:
SystemException - if a system exception occurred

removeGroups

void removeGroups(long pk,
                  long[] groupPKs)
                  throws SystemException
Removes the association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
groupPKs - the primary keys of the groups
Throws:
SystemException - if a system exception occurred

removeGroups

void removeGroups(long pk,
                  List<Group> groups)
                  throws SystemException
Removes the association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
groups - the groups
Throws:
SystemException - if a system exception occurred

setGroups

void setGroups(long pk,
               long[] groupPKs)
               throws SystemException
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.

Parameters:
pk - the primary key of the permission to set the associations for
groupPKs - the primary keys of the groups to be associated with the permission
Throws:
SystemException - if a system exception occurred

setGroups

void setGroups(long pk,
               List<Group> groups)
               throws SystemException
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.

Parameters:
pk - the primary key of the permission to set the associations for
groups - the groups to be associated with the permission
Throws:
SystemException - if a system exception occurred

getRoles

List<Role> getRoles(long pk)
                    throws SystemException
Gets all the roles associated with the permission.

Parameters:
pk - the primary key of the permission to get the associated roles for
Returns:
the roles associated with the permission
Throws:
SystemException - if a system exception occurred

getRoles

List<Role> getRoles(long pk,
                    int start,
                    int end)
                    throws SystemException
Gets a range of all the roles associated with the permission.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
pk - the primary key of the permission to get the associated roles for
start - the lower bound of the range of permissions to return
end - the upper bound of the range of permissions to return (not inclusive)
Returns:
the range of roles associated with the permission
Throws:
SystemException - if a system exception occurred

getRoles

List<Role> getRoles(long pk,
                    int start,
                    int end,
                    OrderByComparator orderByComparator)
                    throws SystemException
Gets an ordered range of all the roles associated with the permission.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
pk - the primary key of the permission to get the associated roles for
start - the lower bound of the range of permissions to return
end - the upper bound of the range of permissions to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of roles associated with the permission
Throws:
SystemException - if a system exception occurred

getRolesSize

int getRolesSize(long pk)
                 throws SystemException
Gets the number of roles associated with the permission.

Parameters:
pk - the primary key of the permission to get the number of associated roles for
Returns:
the number of roles associated with the permission
Throws:
SystemException - if a system exception occurred

containsRole

boolean containsRole(long pk,
                     long rolePK)
                     throws SystemException
Determines whether the role is associated with the permission.

Parameters:
pk - the primary key of the permission
rolePK - the primary key of the role
Returns:
whether the role is associated with the permission
Throws:
SystemException - if a system exception occurred

containsRoles

boolean containsRoles(long pk)
                      throws SystemException
Determines whether the permission has any roles associated with it.

Parameters:
pk - the primary key of the permission to check for associations with roles
Returns:
whether the permission has any roles associated with it
Throws:
SystemException - if a system exception occurred

addRole

void addRole(long pk,
             long rolePK)
             throws SystemException
Adds an association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
rolePK - the primary key of the role
Throws:
SystemException - if a system exception occurred

addRole

void addRole(long pk,
             Role role)
             throws SystemException
Adds an association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
role - the role
Throws:
SystemException - if a system exception occurred

addRoles

void addRoles(long pk,
              long[] rolePKs)
              throws SystemException
Adds an association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
rolePKs - the primary keys of the roles
Throws:
SystemException - if a system exception occurred

addRoles

void addRoles(long pk,
              List<Role> roles)
              throws SystemException
Adds an association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
roles - the roles
Throws:
SystemException - if a system exception occurred

clearRoles

void clearRoles(long pk)
                throws SystemException
Clears all associations between the permission and its roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission to clear the associated roles from
Throws:
SystemException - if a system exception occurred

removeRole

void removeRole(long pk,
                long rolePK)
                throws SystemException
Removes the association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
rolePK - the primary key of the role
Throws:
SystemException - if a system exception occurred

removeRole

void removeRole(long pk,
                Role role)
                throws SystemException
Removes the association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
role - the role
Throws:
SystemException - if a system exception occurred

removeRoles

void removeRoles(long pk,
                 long[] rolePKs)
                 throws SystemException
Removes the association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
rolePKs - the primary keys of the roles
Throws:
SystemException - if a system exception occurred

removeRoles

void removeRoles(long pk,
                 List<Role> roles)
                 throws SystemException
Removes the association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
roles - the roles
Throws:
SystemException - if a system exception occurred

setRoles

void setRoles(long pk,
              long[] rolePKs)
              throws SystemException
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.

Parameters:
pk - the primary key of the permission to set the associations for
rolePKs - the primary keys of the roles to be associated with the permission
Throws:
SystemException - if a system exception occurred

setRoles

void setRoles(long pk,
              List<Role> roles)
              throws SystemException
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.

Parameters:
pk - the primary key of the permission to set the associations for
roles - the roles to be associated with the permission
Throws:
SystemException - if a system exception occurred

getUsers

List<User> getUsers(long pk)
                    throws SystemException
Gets all the users associated with the permission.

Parameters:
pk - the primary key of the permission to get the associated users for
Returns:
the users associated with the permission
Throws:
SystemException - if a system exception occurred

getUsers

List<User> getUsers(long pk,
                    int start,
                    int end)
                    throws SystemException
Gets a range of all the users associated with the permission.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
pk - the primary key of the permission to get the associated users for
start - the lower bound of the range of permissions to return
end - the upper bound of the range of permissions to return (not inclusive)
Returns:
the range of users associated with the permission
Throws:
SystemException - if a system exception occurred

getUsers

List<User> getUsers(long pk,
                    int start,
                    int end,
                    OrderByComparator orderByComparator)
                    throws SystemException
Gets an ordered range of all the users associated with the permission.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
pk - the primary key of the permission to get the associated users for
start - the lower bound of the range of permissions to return
end - the upper bound of the range of permissions to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of users associated with the permission
Throws:
SystemException - if a system exception occurred

getUsersSize

int getUsersSize(long pk)
                 throws SystemException
Gets the number of users associated with the permission.

Parameters:
pk - the primary key of the permission to get the number of associated users for
Returns:
the number of users associated with the permission
Throws:
SystemException - if a system exception occurred

containsUser

boolean containsUser(long pk,
                     long userPK)
                     throws SystemException
Determines whether the user is associated with the permission.

Parameters:
pk - the primary key of the permission
userPK - the primary key of the user
Returns:
whether the user is associated with the permission
Throws:
SystemException - if a system exception occurred

containsUsers

boolean containsUsers(long pk)
                      throws SystemException
Determines whether the permission has any users associated with it.

Parameters:
pk - the primary key of the permission to check for associations with users
Returns:
whether the permission has any users associated with it
Throws:
SystemException - if a system exception occurred

addUser

void addUser(long pk,
             long userPK)
             throws SystemException
Adds an association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
userPK - the primary key of the user
Throws:
SystemException - if a system exception occurred

addUser

void addUser(long pk,
             User user)
             throws SystemException
Adds an association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
user - the user
Throws:
SystemException - if a system exception occurred

addUsers

void addUsers(long pk,
              long[] userPKs)
              throws SystemException
Adds an association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
userPKs - the primary keys of the users
Throws:
SystemException - if a system exception occurred

addUsers

void addUsers(long pk,
              List<User> users)
              throws SystemException
Adds an association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
users - the users
Throws:
SystemException - if a system exception occurred

clearUsers

void clearUsers(long pk)
                throws SystemException
Clears all associations between the permission and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission to clear the associated users from
Throws:
SystemException - if a system exception occurred

removeUser

void removeUser(long pk,
                long userPK)
                throws SystemException
Removes the association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
userPK - the primary key of the user
Throws:
SystemException - if a system exception occurred

removeUser

void removeUser(long pk,
                User user)
                throws SystemException
Removes the association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
user - the user
Throws:
SystemException - if a system exception occurred

removeUsers

void removeUsers(long pk,
                 long[] userPKs)
                 throws SystemException
Removes the association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
userPKs - the primary keys of the users
Throws:
SystemException - if a system exception occurred

removeUsers

void removeUsers(long pk,
                 List<User> users)
                 throws SystemException
Removes the association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the permission
users - the users
Throws:
SystemException - if a system exception occurred

setUsers

void setUsers(long pk,
              long[] userPKs)
              throws SystemException
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.

Parameters:
pk - the primary key of the permission to set the associations for
userPKs - the primary keys of the users to be associated with the permission
Throws:
SystemException - if a system exception occurred

setUsers

void setUsers(long pk,
              List<User> users)
              throws SystemException
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.

Parameters:
pk - the primary key of the permission to set the associations for
users - the users to be associated with the permission
Throws:
SystemException - if a system exception occurred

Liferay 6.0.5