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
ConstructorsConstructorDescriptionAbstractQueryCreator(PartTree tree) Creates a newAbstractQueryCreatorfor the givenPartTree.AbstractQueryCreator(PartTree tree, ParameterAccessor parameters) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract SCreates a new criteria object from the given part and and-concatenates it to the given base criteria.protected abstract TActually creates the query object applying the given criteria object andSortdefinition.protected abstract SCreates a new atomic instance of the criteria object.Creates the actual query object.createQuery(Sort dynamicSort) Creates the actual query object applying the givenSortparameter.protected abstract SOr-concatenates the given base criteria to the given new criteria.
-
Constructor Details
-
AbstractQueryCreator
Creates a newAbstractQueryCreatorfor the givenPartTree. This will cause null be handed for theIteratorin the callback methods.- Parameters:
tree- must not be null.- Since:
- 2.0
-
AbstractQueryCreator
Creates a newAbstractQueryCreatorfor the givenPartTreeandParametersParameterAccessor. The latter is used to hand actual parameter values into the callback methods as well as to apply dynamic sorting via aSortparameter.- 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 givenSortparameter. Use this method in case you haven't provided aParameterAccessorin 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 andSortdefinition.- Parameters:
criteria- can be null.sort- must not be null.- Returns:
-