Interface UserQuery.IFilterableColumns
-
- All Known Subinterfaces:
UserQuery.IFilterQuery
- All Known Implementing Classes:
UserQuery.FilterQuery
- Enclosing class:
- UserQuery
public static interface UserQuery.IFilterableColumns
Provides filter functionality forIUser
Example:
Corresponds to SQL:UserQuery.create().where().name().isLike("john%");
SELECT * FROM IWA_IWA_User WHERE name LIKE 'john%'
- API:
- This is a public API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UserQuery.IIntegerColumnFilterQuery
applicationId()
Prepares a where statement for the columnApplicationId
.
Must be followed by a call to a condition method.UserQuery.IStringColumnFilterQuery
eMailAddress()
Prepares a where statement for the columnEMailAddress
.
Must be followed by a call to a condition method.UserQuery.IStringColumnFilterQuery
fullName()
Prepares a where statement for the columnFullName
.
Must be followed by a call to a condition method.UserQuery.FilterLink
hasRole(IRole role)
Filters users which has the givenrole
.UserQuery.FilterLink
hasRoleAssigned(IRole role)
Filters users which has the givenrole
directly assigned.UserQuery.IStringColumnFilterQuery
name()
Prepares a where statement for the columnName
.
Must be followed by a call to a condition method.UserQuery.FilterQuery
not(UserQuery otherQuery)
Adds a condition, which negates a set of where conditions given by theotherQuery
with a NOT expression.
Only the where clause of the givenotherQuery
is considered.
-
-
-
Method Detail
-
hasRole
UserQuery.FilterLink hasRole(IRole role)
Filters users which has the given
role
. A user has the role if the role is directly assigned, transitive over the role hierarchy or role members.Example:
Get all users that has the role "manager"import ch.ivyteam.ivy.security.IUser; import ch.ivyteam.ivy.security.IRole; import ch.ivyteam.ivy.security.query.UserQuery; IRole manager = ivy.wf.getSecurityContext().findRole("manager"); UserQuery query = UserQuery.create().where().hasRole(manager); List<IUser> usersWithRoleManager = ivy.wf.getSecurityContext().getUserQueryExecutor().getResults(query);
- Parameters:
role
- role to filter the users- Returns:
- the query for further composition
- Throws:
IllegalArgumentException
- If the given role is null- See Also:
if you are only interested in directly assigned roles to the user
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
hasRoleAssigned
UserQuery.FilterLink hasRoleAssigned(IRole role)
Filters users which has the given
role
directly assigned. In contrast tohasRole(IRole)
, it only considers directly assigned roles.Example:
Get all users that has directly assigned the role "manager"import ch.ivyteam.ivy.security.IUser; import ch.ivyteam.ivy.security.IRole; import ch.ivyteam.ivy.security.query.UserQuery; IRole manager = ivy.wf.getSecurityContext().findRole("manager"); UserQuery query = UserQuery.create().where().hasRoleAssigned(manager); List<IUser> usersWithRoleManagerAssigned = ivy.wf.getSecurityContext().getUserQueryExecutor().getResults(query);
- Parameters:
role
- role to filter the users- Returns:
- the query for further composition
- Throws:
IllegalArgumentException
- If the given role is null- See Also:
hasRole(IRole)
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
not
UserQuery.FilterQuery not(UserQuery otherQuery)
Adds a condition, which negates a set of where conditions given by the
otherQuery
with a NOT expression.
Only the where clause of the givenotherQuery
is considered. All other parts are ignored.SQL part:
NOT([otherSqlExpression])
Example:
Corresponds to SQL:UserQuery subQuery = UserQuery.create().where() .name().isEqual("john"); UserQuery query = UserQuery.create().where() .not(subQuery);
SELECT * FROM IWA_IWA_User WHERE NOT(name = 'john')
- Parameters:
otherQuery
- Query from which the negated where part will be added to the current query.- Returns:
- query for further composition
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
name
UserQuery.IStringColumnFilterQuery name()
Prepares a where statement for the column
Name
.
Must be followed by a call to a condition method.- Returns:
- query for further composition
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
fullName
UserQuery.IStringColumnFilterQuery fullName()
Prepares a where statement for the column
FullName
.
Must be followed by a call to a condition method.- Returns:
- query for further composition
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
applicationId
UserQuery.IIntegerColumnFilterQuery applicationId()
Prepares a where statement for the column
ApplicationId
.
Must be followed by a call to a condition method.- Returns:
- query for further composition
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
eMailAddress
UserQuery.IStringColumnFilterQuery eMailAddress()
Prepares a where statement for the column
EMailAddress
.
Must be followed by a call to a condition method.- Returns:
- query for further composition
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
-