Class ValueExpressionQueryRewriter.ParsedQuery

java.lang.Object
org.springframework.data.repository.query.ValueExpressionQueryRewriter.ParsedQuery
Enclosing class:
ValueExpressionQueryRewriter

public class ValueExpressionQueryRewriter.ParsedQuery extends Object
Parses a query string, identifies the contained Value expressions, replaces them with bind parameters and offers a Map from those bind parameters to the value expression.

The parser detects quoted parts of the query string and does not detect value expressions inside such quoted parts of the query.

Author:
Jens Schauder, Oliver Gierke, Mark Paluch
  • Method Details

    • getQueryString

      public String getQueryString()
      The query with all the Value Expressions replaced with bind parameters.
      Returns:
      Guaranteed to be not null.
    • isQuoted

      public boolean isQuoted(int index)
      Return whether the query at index is quoted.
      Parameters:
      index -
      Returns:
      true if quoted; false otherwise.
    • getParameter

      public ValueExpression getParameter(String name)
    • size

      public int size()
      Returns the number of expressions in this extractor.
      Returns:
      the number of expressions in this extractor.
    • hasParameterBindings

      public boolean hasParameterBindings()
      Returns whether the query contains Value Expressions.
      Returns:
      true if the query contains Value Expressions.
    • getParameterMap

      public Map<String,ValueExpression> getParameterMap()
      A Map from parameter name to Value Expression.
      Returns:
      Guaranteed to be not null.