Class UserQuery

  • Direct Known Subclasses:
    UserQuery.FilterLink, UserQuery.GroupByQuery, UserQuery.OrderByQuery

    @Generated(value="ch.ivyteam.db.meta.generator.internal.query.JavaQueryClassGenerator",
               date="May 2, 2024, 2:58:02 AM")
    public class UserQuery
    extends Query<IUser>

    Provides a query builder to query user data.

    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();
     
    API:
    This is a public API.
    • 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:

        UserQuery.create().groupBy().name();
        Corresponds to SQL:
        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.