org.springframework.data.relational.repository.query

## 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 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 and Description
`RelationalQueryCreator(PartTree tree, RelationalParameterAccessor accessor)` Creates new instance of this class with the given `PartTree`, `RelationalEntityMetadata` and `ParameterMetadataProvider`.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected Criteria` `and(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(Part part, Iterator<Object> iterator)` Creates `Criteria` for the given method name part.
`protected Criteria` `or(Criteria base, Criteria criteria)` Combines two `Criteria`s using `OR`.
`static void` `validate(PartTree tree, 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 Detail

#### RelationalQueryCreator

    public RelationalQueryCreator(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 Detail

#### create

    protected Criteria create(Part part,
                              Iterator<Object> iterator)

Creates `Criteria` for the given method name part.

Specified by:
  `create` in class `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(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 `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 `Criteria`s using `OR`.

Specified by:
  `or` in class `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(PartTree tree,
                                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` -