Class UserQuery
- java.lang.Object
-
- ch.ivyteam.ivy.persistence.query.Query<IUser>
-
- ch.ivyteam.ivy.security.query.UserQuery
-
- Direct Known Subclasses:
UserQuery.FilterLink,UserQuery.GroupByQuery,UserQuery.OrderByQuery
@Generated(value="ch.ivyteam.db.meta.generator.internal.query.JavaQueryClassGenerator", date="Jul 29, 2022, 2:23:57 PM") public class UserQuery extends Query<IUser>Provides a query builder to query
userdata of thecurrent security context.To execute the query use
IUserQueryExecutor. Seeivy.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 withUserQuery.IFilterableColumns.applicationId()as this is already implicitly done by the UserQuery itself.- API:
- This is a public API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUserQuery.FilterLinkLinks a where condition with another.static classUserQuery.FilterQueryProvides filter functionality forIUserstatic classUserQuery.GroupByQueryProvides methods to group the result by certain fields.static interfaceUserQuery.IBoolFilterQuerystatic interfaceUserQuery.IColumnFilterQueryBasic filter functionality provider for a column ofIUserstatic interfaceUserQuery.IFilterableColumnsProvides filter functionality forIUserstatic interfaceUserQuery.IFilterLinkLinks a where condition with another.static interfaceUserQuery.IFilterQueryProvides filter functionality forIUserstatic interfaceUserQuery.IGroupByQueryColumnsProvides methods to group the result by certain fields.static interfaceUserQuery.IIntegerColumnFilterQueryProvides filter functionality for an integer column ofIUserstatic interfaceUserQuery.INumberColumnFilterQueryProvides filter functionality for a decimal number column ofIUserstatic interfaceUserQuery.IOrderByQueryColumnsProvides methods to order the result by columns ofIUser.static interfaceUserQuery.IPatternColumnFilterQueryProvides filter functionality for columns ofIUserthat can be filter by string patterns (isLike)static interfaceUserQuery.IStringColumnFilterQueryProvides filter functionality for a string column ofIUserstatic classUserQuery.OrderByColumnQueryProvides methods to define the direction of the sorting either ascending or descending.static classUserQuery.OrderByQueryProvides methods to order the result by columns ofIUser.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UserQuerycreate()Creates a new queryIFluentQueryExecutor<IUser>executor()Provides a fluent API to execute this query and fetch its results.UserQuery.IGroupByQueryColumnsgroupBy()Returns an object which contains the group by part for this query.
It provides methods to group the result by certain fields.UserQuery.IOrderByQueryColumnsorderBy()Returns an object which contains the order by part for this query.
It provides methods to order the result by certain columns.UserQuery.IFilterQuerywhere()Returns an object which contains the where part for this query.
It provides methods to filter the result by certain columns.
-
-
-
Method Detail
-
create
public static UserQuery 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
public IFluentQueryExecutor<IUser> 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
public UserQuery.IGroupByQueryColumns 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
public UserQuery.IOrderByQueryColumns 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
public UserQuery.IFilterQuery 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.
-
-