Class UserQuery
- Direct Known Subclasses:
UserQuery.FilterLink
,UserQuery.GroupByQuery
,UserQuery.OrderByQuery
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
Modifier and TypeClassDescriptionstatic class
Links a where condition with another.static class
Provides filter functionality forIUser
static class
Provides methods to group the result by certain fields.static interface
static interface
Basic filter functionality provider for a column ofIUser
static interface
Provides filter functionality forIUser
static interface
Links a where condition with another.static interface
Provides filter functionality forIUser
static interface
Provides methods to group the result by certain fields.static interface
Provides filter functionality for an integer column ofIUser
static interface
Provides filter functionality for a decimal number column ofIUser
static interface
Provides methods to order the result by columns ofIUser
.static interface
Provides filter functionality for columns ofIUser
that can be filter by string patterns (isLike)static interface
Provides filter functionality for a string column ofIUser
static class
Provides methods to define the direction of the sorting either ascending or descending.static class
Provides methods to order the result by columns ofIUser
. -
Method Summary
Modifier and TypeMethodDescriptionstatic UserQuery
create()
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 IvyScript and Java. It has the visibility EXPERT.
-
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 IvyScript and Java. It has the visibility NOVICE.
-
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 IvyScript and Java. It has the visibility EXPERT.
-
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 IvyScript and Java. It has the visibility EXPERT.
-
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 IvyScript and Java. It has the visibility EXPERT.
-