Liferay 6.1.2-ce-ga3

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.

Caching information and settings can be found in portal.properties

See Also:
PermissionPersistence, PermissionPersistenceImpl

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)
          Returns true if the group is associated with the permission.
static boolean containsGroups(long pk)
          Returns true if the permission has any groups associated with it.
static boolean containsRole(long pk, long rolePK)
          Returns true if the role is associated with the permission.
static boolean containsRoles(long pk)
          Returns true if the permission has any roles associated with it.
static boolean containsUser(long pk, long userPK)
          Returns true if the user is associated with the permission.
static boolean containsUsers(long pk)
          Returns true if the permission has any users associated with it.
static int countAll()
          Returns the number of permissions.
static int countByA_R(String actionId, long resourceId)
          Returns the number of permissions where actionId = ? and resourceId = ?.
static int countByResourceId(long resourceId)
          Returns the number of 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)
          Returns 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)
          Returns 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)
          Returns the permission with the primary key or returns null if it could not be found.
static Permission fetchByResourceId_First(long resourceId, OrderByComparator orderByComparator)
          Returns the first permission in the ordered set where resourceId = ?.
static Permission fetchByResourceId_Last(long resourceId, OrderByComparator orderByComparator)
          Returns the last permission in the ordered set where resourceId = ?.
static List<Permission> findAll()
          Returns all the permissions.
static List<Permission> findAll(int start, int end)
          Returns a range of all the permissions.
static List<Permission> findAll(int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the permissions.
static Permission findByA_R(String actionId, long resourceId)
          Returns the permission where actionId = ? and resourceId = ? or throws a NoSuchPermissionException if it could not be found.
static Permission findByPrimaryKey(long permissionId)
          Returns the permission with the primary key or throws a NoSuchPermissionException if it could not be found.
static Permission findByResourceId_First(long resourceId, OrderByComparator orderByComparator)
          Returns the first permission in the ordered set where resourceId = ?.
static Permission findByResourceId_Last(long resourceId, OrderByComparator orderByComparator)
          Returns the last permission in the ordered set where resourceId = ?.
static Permission[] findByResourceId_PrevAndNext(long permissionId, long resourceId, OrderByComparator orderByComparator)
          Returns the permissions before and after the current permission in the ordered set where resourceId = ?.
static List<Permission> findByResourceId(long resourceId)
          Returns all the permissions where resourceId = ?.
static List<Permission> findByResourceId(long resourceId, int start, int end)
          Returns a range of all the permissions where resourceId = ?.
static List<Permission> findByResourceId(long resourceId, int start, int end, OrderByComparator orderByComparator)
          Returns 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)
          Returns all the groups associated with the permission.
static List<Group> getGroups(long pk, int start, int end)
          Returns a range of all the groups associated with the permission.
static List<Group> getGroups(long pk, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the groups associated with the permission.
static int getGroupsSize(long pk)
          Returns the number of groups associated with the permission.
static PermissionPersistence getPersistence()
           
static List<Role> getRoles(long pk)
          Returns all the roles associated with the permission.
static List<Role> getRoles(long pk, int start, int end)
          Returns a range of all the roles associated with the permission.
static List<Role> getRoles(long pk, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the roles associated with the permission.
static int getRolesSize(long pk)
          Returns the number of roles associated with the permission.
static List<User> getUsers(long pk)
          Returns all the users associated with the permission.
static List<User> getUsers(long pk, int start, int end)
          Returns a range of all the users associated with the permission.
static List<User> getUsers(long pk, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the users associated with the permission.
static int getUsersSize(long pk)
          Returns the number of users associated with the permission.
static Permission remove(long permissionId)
          Removes the permission with the primary key from the database.
static void removeAll()
          Removes all the permissions from the database.
static Permission 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)
          Deprecated.  
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)

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

cacheResult

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

Parameters:
permissions - the permissions

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
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
Returns the permission with the primary key or throws a NoSuchPermissionException if it could not be found.

Parameters:
permissionId - the primary key of the permission
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
Returns the permission with the primary key or returns null if it could not be found.

Parameters:
permissionId - the primary key of the permission
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
Returns all the permissions where resourceId = ?.

Parameters:
resourceId - the resource ID
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
Returns 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
start - the lower bound of the range of permissions
end - the upper bound of the range of permissions (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
Returns 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
start - the lower bound of the range of permissions
end - the upper bound of the range of permissions (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
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
Returns the first permission in the ordered set where resourceId = ?.

Parameters:
resourceId - the resource ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching permission
Throws:
NoSuchPermissionException - if a matching permission could not be found
SystemException - if a system exception occurred

fetchByResourceId_First

public static Permission fetchByResourceId_First(long resourceId,
                                                 OrderByComparator orderByComparator)
                                          throws SystemException
Returns the first permission in the ordered set where resourceId = ?.

Parameters:
resourceId - the resource ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching permission, or null if a matching permission could not be found
Throws:
SystemException - if a system exception occurred

findByResourceId_Last

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

Parameters:
resourceId - the resource ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching permission
Throws:
NoSuchPermissionException - if a matching permission could not be found
SystemException - if a system exception occurred

fetchByResourceId_Last

public static Permission fetchByResourceId_Last(long resourceId,
                                                OrderByComparator orderByComparator)
                                         throws SystemException
Returns the last permission in the ordered set where resourceId = ?.

Parameters:
resourceId - the resource ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching permission, or null if a matching permission could not be found
Throws:
SystemException - if a system exception occurred

findByResourceId_PrevAndNext

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

Parameters:
permissionId - the primary key of the current permission
resourceId - the resource ID
orderByComparator - the comparator to order the set by (optionally null)
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
Returns the permission where actionId = ? and resourceId = ? or throws a NoSuchPermissionException if it could not be found.

Parameters:
actionId - the action ID
resourceId - the resource ID
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
Returns the permission where actionId = ? and resourceId = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
actionId - the action ID
resourceId - the resource ID
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
Returns 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
resourceId - the resource ID
retrieveFromCache - whether to use the finder cache
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
Returns 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
Returns 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
end - the upper bound of the range of permissions (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
Returns 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
end - the upper bound of the range of permissions (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
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
Throws:
SystemException - if a system exception occurred

removeByA_R

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

Parameters:
actionId - the action ID
resourceId - the resource ID
Returns:
the permission that was removed
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
Returns the number of permissions where resourceId = ?.

Parameters:
resourceId - the resource ID
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
Returns the number of permissions where actionId = ? and resourceId = ?.

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

countAll

public static int countAll()
                    throws SystemException
Returns the number of permissions.

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

getGroups

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

Parameters:
pk - the primary key of the permission
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
Returns 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
start - the lower bound of the range of permissions
end - the upper bound of the range of permissions (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
Returns 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
start - the lower bound of the range of permissions
end - the upper bound of the range of permissions (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
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
Returns the number of groups associated with the permission.

Parameters:
pk - the primary key of the permission
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
Returns true if the group is associated with the permission.

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

containsGroups

public static boolean containsGroups(long pk)
                              throws SystemException
Returns true if the permission has any groups associated with it.

Parameters:
pk - the primary key of the permission to check for associations with groups
Returns:
true if the permission has any groups associated with it; false otherwise
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
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
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
Returns all the roles associated with the permission.

Parameters:
pk - the primary key of the permission
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
Returns 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
start - the lower bound of the range of permissions
end - the upper bound of the range of permissions (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
Returns 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
start - the lower bound of the range of permissions
end - the upper bound of the range of permissions (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
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
Returns the number of roles associated with the permission.

Parameters:
pk - the primary key of the permission
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
Returns true if the role is associated with the permission.

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

containsRoles

public static boolean containsRoles(long pk)
                             throws SystemException
Returns true if the permission has any roles associated with it.

Parameters:
pk - the primary key of the permission to check for associations with roles
Returns:
true if the permission has any roles associated with it; false otherwise
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
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
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
Returns all the users associated with the permission.

Parameters:
pk - the primary key of the permission
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
Returns 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
start - the lower bound of the range of permissions
end - the upper bound of the range of permissions (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
Returns 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
start - the lower bound of the range of permissions
end - the upper bound of the range of permissions (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
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
Returns the number of users associated with the permission.

Parameters:
pk - the primary key of the permission
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
Returns true if the user is associated with the permission.

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

containsUsers

public static boolean containsUsers(long pk)
                             throws SystemException
Returns true if the permission has any users associated with it.

Parameters:
pk - the primary key of the permission to check for associations with users
Returns:
true if the permission has any users associated with it; false otherwise
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
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
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)
Deprecated. 


Liferay 6.1.2-ce-ga3