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
ConstructorsConstructorDescriptionRelationalQueryCreator(org.springframework.data.repository.query.parser.PartTree tree, RelationalParameterAccessor accessor) Creates new instance of this class with the givenPartTree,RelationalEntityMetadataandParameterMetadataProvider. -
Method Summary
Modifier and TypeMethodDescriptionprotected Criteriaand(org.springframework.data.repository.query.parser.Part part, Criteria base, Iterator<Object> iterator) Combines the givenCriteriawith the new one created for the given method name part usingAND.protected CriteriaCreatesCriteriafor the given method name part.protected CriteriaCombines twoCriterias usingOR.static voidvalidate(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
-
Constructor Details
-
RelationalQueryCreator
public RelationalQueryCreator(org.springframework.data.repository.query.parser.PartTree tree, RelationalParameterAccessor accessor) Creates new instance of this class with the givenPartTree,RelationalEntityMetadataandParameterMetadataProvider.- 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) CreatesCriteriafor the given method name part. -
and
protected Criteria and(org.springframework.data.repository.query.parser.Part part, Criteria base, Iterator<Object> iterator) Combines the givenCriteriawith the new one created for the given method name part usingAND. -
or
Combines twoCriterias usingOR. -
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-
-