Liferay 6.0-ee

com.liferay.portal.service.persistence
Class PermissionUtil

java.lang.Object
  extended by com.liferay.portal.service.persistence.PermissionUtil

public class PermissionUtil
extends Object

The persistence utility for the permission service. This utility wraps PermissionPersistenceImpl and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.

Never modify this class directly. Modify service.xml and rerun ServiceBuilder to regenerate this class.

Caching information and settings can be found in portal.properties

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

Constructor Summary
PermissionUtil()
           
 
Method Summary
static void addGroup(long pk, Group group)
          Adds an association between the permission and the group.
static void addGroup(long pk, long groupPK)
          Adds an association between the permission and the group.
static void addGroups(long pk, List<Group> groups)
          Adds an association between the permission and the groups.
static void addGroups(long pk, long[] groupPKs)
          Adds an association between the permission and the groups.
static void addRole(long pk, long rolePK)
          Adds an association between the permission and the role.
static void addRole(long pk, Role role)
          Adds an association between the permission and the role.
static void addRoles(long pk, List<Role> roles)
          Adds an association between the permission and the roles.
static void addRoles(long pk, long[] rolePKs)
          Adds an association between the permission and the roles.
static void addUser(long pk, long userPK)
          Adds an association between the permission and the user.
static void addUser(long pk, User user)
          Adds an association between the permission and the user.
static void addUsers(long pk, List<User> users)
          Adds an association between the permission and the users.
static void addUsers(long pk, long[] userPKs)
          Adds an association between the permission and the users.
static void cacheResult(List<Permission> permissions)
          Caches the permissions in the entity cache if it is enabled.
static void cacheResult(Permission permission)
          Caches the permission in the entity cache if it is enabled.
static void clearCache()
           
static void clearCache(Permission permission)
           
static void clearGroups(long pk)
          Clears all associations between the permission and its groups.
static void clearRoles(long pk)
          Clears all associations between the permission and its roles.
static void clearUsers(long pk)
          Clears all associations between the permission and its users.
static boolean containsGroup(long pk, long groupPK)
          Determines whether the group is associated with the permission.
static boolean containsGroups(long pk)
          Determines whether the permission has any groups associated with it.
static boolean containsRole(long pk, long rolePK)
          Determines whether the role is associated with the permission.
static boolean containsRoles(long pk)
          Determines whether the permission has any roles associated with it.
static boolean containsUser(long pk, long userPK)
          Determines whether the user is associated with the permission.
static boolean containsUsers(long pk)
          Determines whether the permission has any users associated with it.
static int countAll()
          Counts all the permissions.
static int countByA_R(String actionId, long resourceId)
          Counts all the permissions where actionId = ? and resourceId = ?.
static int countByResourceId(long resourceId)
          Counts all the permissions where resourceId = ?.
 long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static Permission create(long permissionId)
          Creates a new permission with the primary key.
static Permission fetchByA_R(String actionId, long resourceId)
          Finds the permission where actionId = ? and resourceId = ? or returns null if it could not be found.
static 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.
static Permission fetchByPrimaryKey(long permissionId)
          Finds the permission with the primary key or returns null if it could not be found.
static List<Permission> findAll()
          Finds all the permissions.
static List<Permission> findAll(int start, int end)
          Finds a range of all the permissions.
static List<Permission> findAll(int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the permissions.
static Permission findByA_R(String actionId, long resourceId)
          Finds the permission where actionId = ? and resourceId = ? or throws a NoSuchPermissionException if it could not be found.
static Permission findByPrimaryKey(long permissionId)
          Finds the permission with the primary key or throws a NoSuchPermissionException if it could not be found.
static Permission findByResourceId_First(long resourceId, OrderByComparator orderByComparator)
          Finds the first permission in the ordered set where resourceId = ?.
static Permission findByResourceId_Last(long resourceId, OrderByComparator orderByComparator)
          Finds the last permission in the ordered set where resourceId = ?.
static Permission[] findByResourceId_PrevAndNext(long permissionId, long resourceId, OrderByComparator orderByComparator)
          Finds the permissions before and after the current permission in the ordered set where resourceId = ?.
static List<Permission> findByResourceId(long resourceId)
          Finds all the permissions where resourceId = ?.
static List<Permission> findByResourceId(long resourceId, int start, int end)
          Finds a range of all the permissions where resourceId = ?.
static List<Permission> findByResourceId(long resourceId, int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the permissions where resourceId = ?.
static List<Permission> findWithDynamicQuery(DynamicQuery dynamicQuery)
           
static List<Permission> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
           
static List<Permission> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
           
static List<Group> getGroups(long pk)
          Gets all the groups associated with the permission.
static List<Group> getGroups(long pk, int start, int end)
          Gets a range of all the groups associated with the permission.
static List<Group> getGroups(long pk, int start, int end, OrderByComparator orderByComparator)
          Gets an ordered range of all the groups associated with the permission.
static int getGroupsSize(long pk)
          Gets the number of groups associated with the permission.
static PermissionPersistence getPersistence()
           
static List<Role> getRoles(long pk)
          Gets all the roles associated with the permission.
static List<Role> getRoles(long pk, int start, int end)
          Gets a range of all the roles associated with the permission.
static List<Role> getRoles(long pk, int start, int end, OrderByComparator orderByComparator)
          Gets an ordered range of all the roles associated with the permission.
static int getRolesSize(long pk)
          Gets the number of roles associated with the permission.
static List<User> getUsers(long pk)
          Gets all the users associated with the permission.
static List<User> getUsers(long pk, int start, int end)
          Gets a range of all the users associated with the permission.
static List<User> getUsers(long pk, int start, int end, OrderByComparator orderByComparator)
          Gets an ordered range of all the users associated with the permission.
static int getUsersSize(long pk)
          Gets the number of users associated with the permission.
static Permission remove(long permissionId)
          Removes the permission with the primary key from the database.
static Permission remove(Permission permission)
           
static void removeAll()
          Removes all the permissions from the database.
static void removeByA_R(String actionId, long resourceId)
          Removes the permission where actionId = ? and resourceId = ? from the database.
static void removeByResourceId(long resourceId)
          Removes all the permissions where resourceId = ? from the database.
static void removeGroup(long pk, Group group)
          Removes the association between the permission and the group.
static void removeGroup(long pk, long groupPK)
          Removes the association between the permission and the group.
static void removeGroups(long pk, List<Group> groups)
          Removes the association between the permission and the groups.
static void removeGroups(long pk, long[] groupPKs)
          Removes the association between the permission and the groups.
static void removeRole(long pk, long rolePK)
          Removes the association between the permission and the role.
static void removeRole(long pk, Role role)
          Removes the association between the permission and the role.
static void removeRoles(long pk, List<Role> roles)
          Removes the association between the permission and the roles.
static void removeRoles(long pk, long[] rolePKs)
          Removes the association between the permission and the roles.
static void removeUser(long pk, long userPK)
          Removes the association between the permission and the user.
static void removeUser(long pk, User user)
          Removes the association between the permission and the user.
static void removeUsers(long pk, List<User> users)
          Removes the association between the permission and the users.
static void removeUsers(long pk, long[] userPKs)
          Removes the association between the permission and the users.
static void setGroups(long pk, List<Group> groups)
          Sets the groups associated with the permission, removing and adding associations as necessary.
static void setGroups(long pk, long[] groupPKs)
          Sets the groups associated with the permission, removing and adding associations as necessary.
 void setPersistence(PermissionPersistence persistence)
           
static void setRoles(long pk, List<Role> roles)
          Sets the roles associated with the permission, removing and adding associations as necessary.
static void setRoles(long pk, long[] rolePKs)
          Sets the roles associated with the permission, removing and adding associations as necessary.
static void setUsers(long pk, List<User> users)
          Sets the users associated with the permission, removing and adding associations as necessary.
static void setUsers(long pk, long[] userPKs)
          Sets the users associated with the permission, removing and adding associations as necessary.
static Permission update(Permission permission, boolean merge)
           
static Permission update(Permission permission, boolean merge, ServiceContext serviceContext)
           
static Permission updateImpl(Permission permission, boolean merge)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionUtil

public PermissionUtil()
Method Detail

clearCache

public static void clearCache()
See Also:
BasePersistence.clearCache()

clearCache

public static void clearCache(Permission permission)
See Also:
BasePersistence.clearCache(com.liferay.portal.model.BaseModel)

countWithDynamicQuery

public long countWithDynamicQuery(DynamicQuery dynamicQuery)
                           throws SystemException
Throws:
SystemException
See Also:
BasePersistence.countWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<Permission> findWithDynamicQuery(DynamicQuery dynamicQuery)
                                             throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<Permission> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                                    int start,
                                                    int end)
                                             throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)

findWithDynamicQuery

public static List<Permission> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                                    int start,
                                                    int end,
                                                    OrderByComparator orderByComparator)
                                             throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)

remove

public static Permission remove(Permission permission)
                         throws SystemException
Throws:
SystemException
See Also:
BasePersistence.remove(com.liferay.portal.model.BaseModel)

update

public static Permission update(Permission permission,
                                boolean merge)
                         throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean)

update

public static Permission update(Permission permission,
                                boolean merge,
                                ServiceContext serviceContext)
                         throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)

cacheResult

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

Parameters:
permission - the permission to cache

cacheResult

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

Parameters:
permissions - the permissions to cache

create

public static 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

public static 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

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

findByPrimaryKey

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

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

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

findAll

public static 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

public static 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

public static 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

public static 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

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

Throws:
SystemException - if a system exception occurred

countByResourceId

public static 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

public static 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

public static int countAll()
                    throws SystemException
Counts all the permissions.

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

getGroups

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

getPersistence

public static PermissionPersistence getPersistence()

setPersistence

public void setPersistence(PermissionPersistence persistence)

Liferay 6.0-ee