Class Query

java.lang.Object
org.hisp.dhis.query.Query

public class Query extends Object
Metadata query.
Author:
Lars Helge Overland
  • Constructor Details

    • Query

      public Query()
  • Method Details

    • instance

      public static Query instance()
      Produces a query instance.
      Returns:
      a Query instance.
    • addFilter

      public Query addFilter(Filter filter)
      Adds a filter to this query.
      Parameters:
      filter - the Filter.
      Returns:
      this Query.
    • addOrder

      public Query addOrder(Order order)
      Enables ordering for this query.
      Parameters:
      order - the Order.
      Returns:
      this Query.
    • setOrder

      public Query setOrder(Order order)
      Sets ordering for this query.
      Parameters:
      order - the Order.
      Returns:
      this Query.
    • getOrder

      public List<Order> getOrder()
      Returns the order of this query.
      Returns:
      the Order.
    • getFilters

      public List<Filter> getFilters()
      Returns filters.
      Returns:
      a list of Filter.
    • setPaging

      public Query setPaging(Integer page, Integer pageSize)
      Enables paging for this query.
      Parameters:
      page - the page to return.
      pageSize - the page size to return.
      Returns:
      this Query.
    • getPaging

      public Paging getPaging()
      Returns the paging for this query.
      Returns:
      the Paging.
    • getRootJunction

      public RootJunction getRootJunction()
      Returns the root junction of this query.
      Returns:
      the RootJunction
    • withExpandAssociations

      public Query withExpandAssociations()
      Enables expansion of associations, i.e. that all properties of associated objects will be present. Applies to lists of objects only (not single objects).
      Returns:
      this Query.
    • withRootJunction

      public Query withRootJunction(RootJunction rootJunction)
      Determines the logic to use when combining filters.
      Parameters:
      rootJunction - the RootJunction.
      Returns:
      this Query
    • isExpandAssociations

      public boolean isExpandAssociations()
      Indicates whether expansion of associations is enabled. Applies to lists of objects only (not single objects).
      Returns:
      true if expansion of associations is enabled, false if not.