Class RelationalQueryCreator<T>

java.lang.Object
org.springframework.data.repository.query.parser.AbstractQueryCreator<T,Criteria>
org.springframework.data.relational.repository.query.RelationalQueryCreator<T>

public abstract class RelationalQueryCreator<T> extends org.springframework.data.repository.query.parser.AbstractQueryCreator<T,Criteria>
Implementation of AbstractQueryCreator that creates a query from a PartTree.
Since:
2.0
Author:
Roman Chigvintsev, Mark Paluch
  • Constructor Summary

    Constructors
    Constructor
    Description
    RelationalQueryCreator(org.springframework.data.repository.query.parser.PartTree tree, RelationalParameterAccessor accessor)
    Creates new instance of this class with the given PartTree, RelationalEntityMetadata and ParameterMetadataProvider.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Criteria
    and(org.springframework.data.repository.query.parser.Part part, Criteria base, Iterator<Object> iterator)
    Combines the given Criteria with the new one created for the given method name part using AND.
    protected Criteria
    create(org.springframework.data.repository.query.parser.Part part, Iterator<Object> iterator)
    Creates Criteria for the given method name part.
    protected Criteria
    or(Criteria base, Criteria criteria)
    Combines two Criterias using OR.
    static void
    validate(org.springframework.data.repository.query.parser.PartTree tree, org.springframework.data.repository.query.Parameters<?,?> parameters)
    Validate parameters for the derived query.

    Methods inherited from class org.springframework.data.repository.query.parser.AbstractQueryCreator

    complete, createQuery, createQuery

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RelationalQueryCreator

      public RelationalQueryCreator(org.springframework.data.repository.query.parser.PartTree tree, RelationalParameterAccessor accessor)
      Creates new instance of this class with the given PartTree, RelationalEntityMetadata and ParameterMetadataProvider.
      Parameters:
      tree - part tree, must not be null.
      accessor - parameter metadata provider, must not be null.
  • Method Details

    • create

      protected Criteria create(org.springframework.data.repository.query.parser.Part part, Iterator<Object> iterator)
      Creates Criteria for the given method name part.
      Specified by:
      create in class org.springframework.data.repository.query.parser.AbstractQueryCreator<T,Criteria>
      Parameters:
      part - method name part, must not be null.
      iterator - iterator over query parameter values
      Returns:
      new instance of Criteria
    • and

      protected Criteria and(org.springframework.data.repository.query.parser.Part part, Criteria base, Iterator<Object> iterator)
      Combines the given Criteria with the new one created for the given method name part using AND.
      Specified by:
      and in class org.springframework.data.repository.query.parser.AbstractQueryCreator<T,Criteria>
      Parameters:
      part - method name part, must not be null.
      base - Criteria to be combined, must not be null.
      iterator - iterator over query parameter values
      Returns:
      Criteria combination
    • or

      protected Criteria or(Criteria base, Criteria criteria)
      Combines two Criterias using OR.
      Specified by:
      or in class org.springframework.data.repository.query.parser.AbstractQueryCreator<T,Criteria>
      Parameters:
      base - Criteria to be combined, must not be null.
      criteria - another Criteria to be combined, must not be null.
      Returns:
      Criteria combination
    • validate

      public static void validate(org.springframework.data.repository.query.parser.PartTree tree, org.springframework.data.repository.query.Parameters<?,?> parameters)
      Validate parameters for the derived query. Specifically checking that the query method defines scalar parameters and collection parameters where required and that invalid parameter declarations are rejected.
      Parameters:
      tree -
      parameters -