Interface QueryMetadata

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultQueryMetadata, EmptyMetadata, OrderedQueryMetadata

public interface QueryMetadata extends Serializable
QueryMetadata defines query metadata such as query sources, filtering conditions and the projection
Author:
tiwe
  • Method Details

    • addGroupBy

      void addGroupBy(Expression<?> o)
      Add the given group by expressions
      Parameters:
      o - group by expressions
    • addHaving

      void addHaving(Predicate o)
      Add the given having expressions
      Parameters:
      o - having conditions
    • addJoin

      void addJoin(JoinType joinType, Expression<?> expr)
      Add the given query join
      Parameters:
      joinType - type of join
      expr - join target
    • addJoinFlag

      void addJoinFlag(JoinFlag flag)
      Add the given join flag to the last given join
      Parameters:
      flag - join flag
    • addJoinCondition

      void addJoinCondition(Predicate o)
      Add the given join condition to the last given join
      Parameters:
      o - join condition
    • addOrderBy

      void addOrderBy(OrderSpecifier<?> o)
      Add the given order specifiers
      Parameters:
      o - order
    • addWhere

      void addWhere(Predicate o)
      Add the given where expressions
      Parameters:
      o - where condition
    • clearOrderBy

      void clearOrderBy()
      Clear the order expressions
    • clearWhere

      void clearWhere()
      Clear the where expressions
    • clone

      QueryMetadata clone()
      Clone this QueryMetadata instance
      Returns:
      new QueryMetadata instance with cloned state
    • getGroupBy

      @Unmodifiable List<Expression<?>> getGroupBy()
      Get the group by expressions
      Returns:
      group by
    • getHaving

      @Nullable @Nullable Predicate getHaving()
      Get the having expressions
      Returns:
      having condition, or null if none set
    • getJoins

      @Unmodifiable List<JoinExpression> getJoins()
      Get the query joins
      Returns:
      joins
    • getModifiers

      QueryModifiers getModifiers()
      Get the QueryModifiers
      Returns:
      modifiers
    • getOrderBy

      @Unmodifiable List<OrderSpecifier<?>> getOrderBy()
      Get the OrderSpecifiers
      Returns:
      order by
    • getProjection

      @Nullable @Nullable Expression<?> getProjection()
      Get the projection
      Returns:
      projection
    • getParams

      @Unmodifiable Map<ParamExpression<?>,Object> getParams()
      Get the parameter bindings
      Returns:
      parameter bindings
    • getWhere

      @Nullable @Nullable Predicate getWhere()
      Get the expressions aggregated into a single boolean expression or null, if none where defined
      Returns:
      where condition or null, if none set
    • isDistinct

      boolean isDistinct()
      Get whether the projection is distinct
      Returns:
      distinct
    • isUnique

      boolean isUnique()
      Get whether the projection is unique
      Returns:
      unique
    • reset

      void reset()
      Reset the projection
    • setDistinct

      void setDistinct(boolean distinct)
      Set the distinct flag
      Parameters:
      distinct - distinct
    • setLimit

      void setLimit(@Nullable @Nullable Long limit)
      Set the maximum number of rows
      Parameters:
      limit - limit
    • setModifiers

      void setModifiers(QueryModifiers restriction)
      Set the query modifiers limit and offset
      Parameters:
      restriction - restriction
    • setOffset

      void setOffset(@Nullable @Nullable Long offset)
      Set the number of skipped rows
      Parameters:
      offset - offset
    • setUnique

      void setUnique(boolean unique)
      Set the unique flag
      Parameters:
      unique - unique
    • setParam

      <T> void setParam(ParamExpression<T> param, T value)
      Bind the value for the given parameter expression
      Type Parameters:
      T - binding type
      Parameters:
      param - parameter
      value - binding
    • setProjection

      void setProjection(Expression<?> o)
      Set the projection
      Parameters:
      o - projection
    • addFlag

      void addFlag(QueryFlag flag)
      Add the given query flag
      Parameters:
      flag - query flag
    • hasFlag

      boolean hasFlag(QueryFlag flag)
      Return whether the given query flag is applied
      Parameters:
      flag - query flag
      Returns:
      true, if present, false, if not
    • removeFlag

      void removeFlag(QueryFlag flag)
      Remove the given query flag
      Parameters:
      flag - query flag
    • getFlags

      @Unmodifiable Set<QueryFlag> getFlags()
      Get all query flags
      Returns:
      all used query flags
    • setValidate

      void setValidate(boolean v)
      Set the validate flag
      Parameters:
      v - validate