|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.liferay.portal.service.persistence.PermissionUtil
public class PermissionUtil
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
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 |
---|
public PermissionUtil()
Method Detail |
---|
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(Permission permission)
BasePersistence.clearCache(com.liferay.portal.model.BaseModel)
public long countWithDynamicQuery(DynamicQuery dynamicQuery) throws SystemException
SystemException
BasePersistence.countWithDynamicQuery(DynamicQuery)
public static List<Permission> findWithDynamicQuery(DynamicQuery dynamicQuery) throws SystemException
SystemException
BasePersistence.findWithDynamicQuery(DynamicQuery)
public static List<Permission> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end) throws SystemException
SystemException
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
public static List<Permission> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator) throws SystemException
SystemException
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
public static Permission update(Permission permission, boolean merge) throws SystemException
SystemException
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean)
public static Permission update(Permission permission, boolean merge, ServiceContext serviceContext) throws SystemException
SystemException
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
public static void cacheResult(Permission permission)
permission
- the permissionpublic static void cacheResult(List<Permission> permissions)
permissions
- the permissionspublic static Permission create(long permissionId)
permissionId
- the primary key for the new permission
public static Permission remove(long permissionId) throws NoSuchPermissionException, SystemException
permissionId
- the primary key of the permission
NoSuchPermissionException
- if a permission with the primary key could not be found
SystemException
- if a system exception occurredpublic static Permission updateImpl(Permission permission, boolean merge) throws SystemException
SystemException
public static Permission findByPrimaryKey(long permissionId) throws NoSuchPermissionException, SystemException
NoSuchPermissionException
if it could not be found.
permissionId
- the primary key of the permission
NoSuchPermissionException
- if a permission with the primary key could not be found
SystemException
- if a system exception occurredpublic static Permission fetchByPrimaryKey(long permissionId) throws SystemException
null
if it could not be found.
permissionId
- the primary key of the permission
null
if a permission with the primary key could not be found
SystemException
- if a system exception occurredpublic static List<Permission> findByResourceId(long resourceId) throws SystemException
resourceId
- the resource ID
SystemException
- if a system exception occurredpublic static List<Permission> findByResourceId(long resourceId, int start, int end) throws SystemException
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.
resourceId
- the resource IDstart
- the lower bound of the range of permissionsend
- the upper bound of the range of permissions (not inclusive)
SystemException
- if a system exception occurredpublic static List<Permission> findByResourceId(long resourceId, int start, int end, OrderByComparator orderByComparator) throws SystemException
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.
resourceId
- the resource IDstart
- the lower bound of the range of permissionsend
- the upper bound of the range of permissions (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static Permission findByResourceId_First(long resourceId, OrderByComparator orderByComparator) throws NoSuchPermissionException, SystemException
resourceId
- the resource IDorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchPermissionException
- if a matching permission could not be found
SystemException
- if a system exception occurredpublic static Permission fetchByResourceId_First(long resourceId, OrderByComparator orderByComparator) throws SystemException
resourceId
- the resource IDorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching permission could not be found
SystemException
- if a system exception occurredpublic static Permission findByResourceId_Last(long resourceId, OrderByComparator orderByComparator) throws NoSuchPermissionException, SystemException
resourceId
- the resource IDorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchPermissionException
- if a matching permission could not be found
SystemException
- if a system exception occurredpublic static Permission fetchByResourceId_Last(long resourceId, OrderByComparator orderByComparator) throws SystemException
resourceId
- the resource IDorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching permission could not be found
SystemException
- if a system exception occurredpublic static Permission[] findByResourceId_PrevAndNext(long permissionId, long resourceId, OrderByComparator orderByComparator) throws NoSuchPermissionException, SystemException
permissionId
- the primary key of the current permissionresourceId
- the resource IDorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchPermissionException
- if a permission with the primary key could not be found
SystemException
- if a system exception occurredpublic static Permission findByA_R(String actionId, long resourceId) throws NoSuchPermissionException, SystemException
NoSuchPermissionException
if it could not be found.
actionId
- the action IDresourceId
- the resource ID
NoSuchPermissionException
- if a matching permission could not be found
SystemException
- if a system exception occurredpublic static Permission fetchByA_R(String actionId, long resourceId) throws SystemException
null
if it could not be found. Uses the finder cache.
actionId
- the action IDresourceId
- the resource ID
null
if a matching permission could not be found
SystemException
- if a system exception occurredpublic static Permission fetchByA_R(String actionId, long resourceId, boolean retrieveFromCache) throws SystemException
null
if it could not be found, optionally using the finder cache.
actionId
- the action IDresourceId
- the resource IDretrieveFromCache
- whether to use the finder cache
null
if a matching permission could not be found
SystemException
- if a system exception occurredpublic static List<Permission> findAll() throws SystemException
SystemException
- if a system exception occurredpublic static List<Permission> findAll(int start, int end) throws SystemException
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.
start
- the lower bound of the range of permissionsend
- the upper bound of the range of permissions (not inclusive)
SystemException
- if a system exception occurredpublic static List<Permission> findAll(int start, int end, OrderByComparator orderByComparator) throws SystemException
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.
start
- the lower bound of the range of permissionsend
- the upper bound of the range of permissions (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static void removeByResourceId(long resourceId) throws SystemException
resourceId
- the resource ID
SystemException
- if a system exception occurredpublic static Permission removeByA_R(String actionId, long resourceId) throws NoSuchPermissionException, SystemException
actionId
- the action IDresourceId
- the resource ID
SystemException
- if a system exception occurred
NoSuchPermissionException
public static void removeAll() throws SystemException
SystemException
- if a system exception occurredpublic static int countByResourceId(long resourceId) throws SystemException
resourceId
- the resource ID
SystemException
- if a system exception occurredpublic static int countByA_R(String actionId, long resourceId) throws SystemException
actionId
- the action IDresourceId
- the resource ID
SystemException
- if a system exception occurredpublic static int countAll() throws SystemException
SystemException
- if a system exception occurredpublic static List<Group> getGroups(long pk) throws SystemException
pk
- the primary key of the permission
SystemException
- if a system exception occurredpublic static List<Group> getGroups(long pk, int start, int end) throws SystemException
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.
pk
- the primary key of the permissionstart
- the lower bound of the range of permissionsend
- the upper bound of the range of permissions (not inclusive)
SystemException
- if a system exception occurredpublic static List<Group> getGroups(long pk, int start, int end, OrderByComparator orderByComparator) throws SystemException
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.
pk
- the primary key of the permissionstart
- the lower bound of the range of permissionsend
- the upper bound of the range of permissions (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static int getGroupsSize(long pk) throws SystemException
pk
- the primary key of the permission
SystemException
- if a system exception occurredpublic static boolean containsGroup(long pk, long groupPK) throws SystemException
true
if the group is associated with the permission.
pk
- the primary key of the permissiongroupPK
- the primary key of the group
true
if the group is associated with the permission; false
otherwise
SystemException
- if a system exception occurredpublic static boolean containsGroups(long pk) throws SystemException
true
if the permission has any groups associated with it.
pk
- the primary key of the permission to check for associations with groups
true
if the permission has any groups associated with it; false
otherwise
SystemException
- if a system exception occurredpublic static void addGroup(long pk, long groupPK) throws SystemException
pk
- the primary key of the permissiongroupPK
- the primary key of the group
SystemException
- if a system exception occurredpublic static void addGroup(long pk, Group group) throws SystemException
pk
- the primary key of the permissiongroup
- the group
SystemException
- if a system exception occurredpublic static void addGroups(long pk, long[] groupPKs) throws SystemException
pk
- the primary key of the permissiongroupPKs
- the primary keys of the groups
SystemException
- if a system exception occurredpublic static void addGroups(long pk, List<Group> groups) throws SystemException
pk
- the primary key of the permissiongroups
- the groups
SystemException
- if a system exception occurredpublic static void clearGroups(long pk) throws SystemException
pk
- the primary key of the permission to clear the associated groups from
SystemException
- if a system exception occurredpublic static void removeGroup(long pk, long groupPK) throws SystemException
pk
- the primary key of the permissiongroupPK
- the primary key of the group
SystemException
- if a system exception occurredpublic static void removeGroup(long pk, Group group) throws SystemException
pk
- the primary key of the permissiongroup
- the group
SystemException
- if a system exception occurredpublic static void removeGroups(long pk, long[] groupPKs) throws SystemException
pk
- the primary key of the permissiongroupPKs
- the primary keys of the groups
SystemException
- if a system exception occurredpublic static void removeGroups(long pk, List<Group> groups) throws SystemException
pk
- the primary key of the permissiongroups
- the groups
SystemException
- if a system exception occurredpublic static void setGroups(long pk, long[] groupPKs) throws SystemException
pk
- the primary key of the permissiongroupPKs
- the primary keys of the groups to be associated with the permission
SystemException
- if a system exception occurredpublic static void setGroups(long pk, List<Group> groups) throws SystemException
pk
- the primary key of the permissiongroups
- the groups to be associated with the permission
SystemException
- if a system exception occurredpublic static List<Role> getRoles(long pk) throws SystemException
pk
- the primary key of the permission
SystemException
- if a system exception occurredpublic static List<Role> getRoles(long pk, int start, int end) throws SystemException
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.
pk
- the primary key of the permissionstart
- the lower bound of the range of permissionsend
- the upper bound of the range of permissions (not inclusive)
SystemException
- if a system exception occurredpublic static List<Role> getRoles(long pk, int start, int end, OrderByComparator orderByComparator) throws SystemException
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.
pk
- the primary key of the permissionstart
- the lower bound of the range of permissionsend
- the upper bound of the range of permissions (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static int getRolesSize(long pk) throws SystemException
pk
- the primary key of the permission
SystemException
- if a system exception occurredpublic static boolean containsRole(long pk, long rolePK) throws SystemException
true
if the role is associated with the permission.
pk
- the primary key of the permissionrolePK
- the primary key of the role
true
if the role is associated with the permission; false
otherwise
SystemException
- if a system exception occurredpublic static boolean containsRoles(long pk) throws SystemException
true
if the permission has any roles associated with it.
pk
- the primary key of the permission to check for associations with roles
true
if the permission has any roles associated with it; false
otherwise
SystemException
- if a system exception occurredpublic static void addRole(long pk, long rolePK) throws SystemException
pk
- the primary key of the permissionrolePK
- the primary key of the role
SystemException
- if a system exception occurredpublic static void addRole(long pk, Role role) throws SystemException
pk
- the primary key of the permissionrole
- the role
SystemException
- if a system exception occurredpublic static void addRoles(long pk, long[] rolePKs) throws SystemException
pk
- the primary key of the permissionrolePKs
- the primary keys of the roles
SystemException
- if a system exception occurredpublic static void addRoles(long pk, List<Role> roles) throws SystemException
pk
- the primary key of the permissionroles
- the roles
SystemException
- if a system exception occurredpublic static void clearRoles(long pk) throws SystemException
pk
- the primary key of the permission to clear the associated roles from
SystemException
- if a system exception occurredpublic static void removeRole(long pk, long rolePK) throws SystemException
pk
- the primary key of the permissionrolePK
- the primary key of the role
SystemException
- if a system exception occurredpublic static void removeRole(long pk, Role role) throws SystemException
pk
- the primary key of the permissionrole
- the role
SystemException
- if a system exception occurredpublic static void removeRoles(long pk, long[] rolePKs) throws SystemException
pk
- the primary key of the permissionrolePKs
- the primary keys of the roles
SystemException
- if a system exception occurredpublic static void removeRoles(long pk, List<Role> roles) throws SystemException
pk
- the primary key of the permissionroles
- the roles
SystemException
- if a system exception occurredpublic static void setRoles(long pk, long[] rolePKs) throws SystemException
pk
- the primary key of the permissionrolePKs
- the primary keys of the roles to be associated with the permission
SystemException
- if a system exception occurredpublic static void setRoles(long pk, List<Role> roles) throws SystemException
pk
- the primary key of the permissionroles
- the roles to be associated with the permission
SystemException
- if a system exception occurredpublic static List<User> getUsers(long pk) throws SystemException
pk
- the primary key of the permission
SystemException
- if a system exception occurredpublic static List<User> getUsers(long pk, int start, int end) throws SystemException
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.
pk
- the primary key of the permissionstart
- the lower bound of the range of permissionsend
- the upper bound of the range of permissions (not inclusive)
SystemException
- if a system exception occurredpublic static List<User> getUsers(long pk, int start, int end, OrderByComparator orderByComparator) throws SystemException
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.
pk
- the primary key of the permissionstart
- the lower bound of the range of permissionsend
- the upper bound of the range of permissions (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static int getUsersSize(long pk) throws SystemException
pk
- the primary key of the permission
SystemException
- if a system exception occurredpublic static boolean containsUser(long pk, long userPK) throws SystemException
true
if the user is associated with the permission.
pk
- the primary key of the permissionuserPK
- the primary key of the user
true
if the user is associated with the permission; false
otherwise
SystemException
- if a system exception occurredpublic static boolean containsUsers(long pk) throws SystemException
true
if the permission has any users associated with it.
pk
- the primary key of the permission to check for associations with users
true
if the permission has any users associated with it; false
otherwise
SystemException
- if a system exception occurredpublic static void addUser(long pk, long userPK) throws SystemException
pk
- the primary key of the permissionuserPK
- the primary key of the user
SystemException
- if a system exception occurredpublic static void addUser(long pk, User user) throws SystemException
pk
- the primary key of the permissionuser
- the user
SystemException
- if a system exception occurredpublic static void addUsers(long pk, long[] userPKs) throws SystemException
pk
- the primary key of the permissionuserPKs
- the primary keys of the users
SystemException
- if a system exception occurredpublic static void addUsers(long pk, List<User> users) throws SystemException
pk
- the primary key of the permissionusers
- the users
SystemException
- if a system exception occurredpublic static void clearUsers(long pk) throws SystemException
pk
- the primary key of the permission to clear the associated users from
SystemException
- if a system exception occurredpublic static void removeUser(long pk, long userPK) throws SystemException
pk
- the primary key of the permissionuserPK
- the primary key of the user
SystemException
- if a system exception occurredpublic static void removeUser(long pk, User user) throws SystemException
pk
- the primary key of the permissionuser
- the user
SystemException
- if a system exception occurredpublic static void removeUsers(long pk, long[] userPKs) throws SystemException
pk
- the primary key of the permissionuserPKs
- the primary keys of the users
SystemException
- if a system exception occurredpublic static void removeUsers(long pk, List<User> users) throws SystemException
pk
- the primary key of the permissionusers
- the users
SystemException
- if a system exception occurredpublic static void setUsers(long pk, long[] userPKs) throws SystemException
pk
- the primary key of the permissionuserPKs
- the primary keys of the users to be associated with the permission
SystemException
- if a system exception occurredpublic static void setUsers(long pk, List<User> users) throws SystemException
pk
- the primary key of the permissionusers
- the users to be associated with the permission
SystemException
- if a system exception occurredpublic static PermissionPersistence getPersistence()
public void setPersistence(PermissionPersistence persistence)
|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |