Class UserQuery
- Direct Known Subclasses:
UserQuery.FilterLink,UserQuery.GroupByQuery,UserQuery.OrderByQuery
IUser.
Provides a query builder to query user data of
the current security context.
To execute the query use IUserQueryExecutor.
See ivy.wf.getSecurityContext().users().queryExecutor()
Example how to filter and order data:
import ch.ivyteam.ivy.security.query.UserQuery;
import ch.ivyteam.ivy.security.IUser;
import ch.ivyteam.ivy.security.IRole;
IRole manager = ivy.wf.getSecurityContext().findRole("manager");
UserQuery userQuery = UserQuery.create();
List<IUser> users = userQuery.where().hasRole(manager)
.orderBy().name().ascending()
.executor().results();
Note, that a UserQuery by default returns only users of the
current security context.
It is not necessary to explicit filter the users with UserQuery.IFilterableColumns.securitySystemId()
as this is already implicitly done by the UserQuery itself.
- API:
- This is a public API.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classProvides filter functionality forIUserstatic classstatic interfaceProvides boolean filter functionality for a complex column ofIUserstatic interfaceBasic filter functionality provider for a column ofIUserstatic interfaceProvides filter functionality forIUserstatic interfaceLinks a where condition with another.static interfaceProvides filter functionality forIUserstatic interfaceProvides methods to group the result by certain fields.static interfaceProvides filter functionality for an integer column ofIUserstatic interfaceProvides filter functionality for a decimal number column ofIUserstatic interfaceProvides methods to order the result by columns ofIUser.static interfaceProvides filter functionality for columns ofIUserthat can be filter by string patterns (isLike)static interfaceProvides filter functionality for a string column ofIUserstatic classProvides methods to define the direction of the sorting either ascending or descending.static class -
Method Summary
Modifier and TypeMethodDescriptionstatic UserQuerycreate()Creates a new queryexecutor()Provides a fluent API to execute this query and fetch its results.groupBy()Returns an object which contains the group by part for this query.
It provides methods to group the result by certain fields.orderBy()Returns an object which contains the order by part for this query.
It provides methods to order the result by certain columns.where()Returns an object which contains the where part for this query.
It provides methods to filter the result by certain columns.
-
Method Details
-
create
Creates a new query- Returns:
- A new instance of UserQuery
- API:
- This public API is available in Java.
-
executor
Provides a fluent API to execute this query and fetch its results.
- Returns:
- fluent API to execute this query.
- API:
- This public API is available in Java.
-
groupBy
Returns an object which contains the group by part for this query.
It provides methods to group the result by certain fields.Example:
Corresponds to SQL:UserQuery.create().groupBy().name();
SELECT Name FROM IWA_User GROUP BY Name
- Returns:
- A query group by builder to add group by statements
- API:
- This public API is available in Java.
-
orderBy
Returns an object which contains the order by part for this query.
It provides methods to order the result by certain columns.- Returns:
- An order by query builder to add order by statements
- API:
- This public API is available in Java.
-
where
Returns an object which contains the where part for this query.
It provides methods to filter the result by certain columns.- Returns:
- An filter query builder to add where statements
- API:
- This public API is available in Java.
-