Module spring.data.relational
Class RelationalQueryCreator<T>
java.lang.Object
org.springframework.data.repository.query.parser.AbstractQueryCreator<T,Criteria>
org.springframework.data.relational.repository.query.RelationalQueryCreator<T>
Implementation of
AbstractQueryCreator that creates a query from a PartTree.- Since:
- 2.0
- Author:
- Roman Chigvintsev, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionRelationalQueryCreator(PartTree tree, RelationalParameterAccessor accessor) Creates new instance of this class with the givenPartTree,RelationalEntityMetadataandParameterMetadataProvider. -
Method Summary
Modifier and TypeMethodDescriptionprotected CriteriaCombines 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(PartTree tree, 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
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
CreatesCriteriafor the given method name part.- Specified by:
createin classAbstractQueryCreator<T,Criteria> - Parameters:
part- method name part, must not be null.iterator- iterator over query parameter values- Returns:
- new instance of
Criteria
-
and
Combines the givenCriteriawith the new one created for the given method name part usingAND. -
or
Combines twoCriterias usingOR. -
validate
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-
-