Class AbstractQueryCreator<T,S>
java.lang.Object
org.springframework.data.repository.query.parser.AbstractQueryCreator<T,S>
- Type Parameters:
T
- the actual query type to be createdS
- the intermediate criteria type
Base class for query creators that create criteria based queries from a
PartTree
.- Author:
- Oliver Gierke, Mark Paluch, Christoph Strobl, Johannes Englmeier
-
Constructor Summary
ConstructorDescriptionAbstractQueryCreator
(PartTree tree) Creates a newAbstractQueryCreator
for the givenPartTree
.AbstractQueryCreator
(PartTree tree, ParameterAccessor parameters) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract S
Creates a new criteria object from the given part and and-concatenates it to the given base criteria.protected abstract T
Actually creates the query object applying the given criteria object andSort
definition.protected abstract S
Creates a new atomic instance of the criteria object.Creates the actual query object.createQuery
(Sort dynamicSort) Creates the actual query object applying the givenSort
parameter.protected abstract S
Or-concatenates the given base criteria to the given new criteria.
-
Constructor Details
-
AbstractQueryCreator
Creates a newAbstractQueryCreator
for the givenPartTree
. This will cause null be handed for theIterator
in the callback methods.- Parameters:
tree
- must not be null.- Since:
- 2.0
-
AbstractQueryCreator
Creates a newAbstractQueryCreator
for the givenPartTree
andParametersParameterAccessor
. The latter is used to hand actual parameter values into the callback methods as well as to apply dynamic sorting via aSort
parameter.- Parameters:
tree
- must not be null.parameters
- must not be null.
-
-
Method Details
-
createQuery
Creates the actual query object.- Returns:
-
createQuery
Creates the actual query object applying the givenSort
parameter. Use this method in case you haven't provided aParameterAccessor
in the first place but want to apply dynamic sorting nevertheless.- Parameters:
dynamicSort
- must not be null.- Returns:
-
create
Creates a new atomic instance of the criteria object.- Parameters:
part
- must not be null.iterator
- must not be null.- Returns:
-
and
Creates a new criteria object from the given part and and-concatenates it to the given base criteria.- Parameters:
part
- must not be null.base
- will never be null.iterator
- must not be null.- Returns:
-
or
Or-concatenates the given base criteria to the given new criteria.- Parameters:
base
- must not be null.criteria
- must not be null.- Returns:
-
complete
Actually creates the query object applying the given criteria object andSort
definition.- Parameters:
criteria
- can be null.sort
- must not be null.- Returns:
-