Class QueryMapper
java.lang.Object
org.springframework.data.jdbc.core.convert.QueryMapper
Maps
CriteriaDefinition
and Sort
objects considering mapping metadata and dialect-specific
conversion.- Since:
- 3.0
- Author:
- Mark Paluch, Jens Schauder, Yan Qiang
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Value object to represent a field and its meta-information.protected static class
Extension ofQueryMapper.Field
to be backed with mapping metadata. -
Constructor Summary
ConstructorsConstructorDescriptionQueryMapper
(JdbcConverter converter) Creates a newQueryMapper
with the givenJdbcConverter
.QueryMapper
(Dialect dialect, JdbcConverter converter) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
convertValue
(Object value, TypeInformation<?> typeInformation) getMappedObject
(MapSqlParameterSource parameterSource, CriteriaDefinition criteria, Table table, RelationalPersistentEntity<?> entity) getMappedSort
(Table table, Sort sort, RelationalPersistentEntity<?> entity) Map theSort
object to apply field name mapping usingthe type to read
.protected MappingContext<? extends RelationalPersistentEntity<?>,
RelationalPersistentProperty>
-
Constructor Details
-
QueryMapper
Deprecated.Creates a newQueryMapper
with the givenJdbcConverter
.- Parameters:
dialect
- must not be null.converter
- must not be null.
-
QueryMapper
Creates a newQueryMapper
with the givenJdbcConverter
.- Parameters:
converter
- must not be null.
-
-
Method Details
-
getMappedSort
public List<OrderByField> getMappedSort(Table table, Sort sort, @Nullable RelationalPersistentEntity<?> entity) Map theSort
object to apply field name mapping usingthe type to read
.- Parameters:
sort
- must not be null.entity
- relatedRelationalPersistentEntity
, can be null.- Returns:
- a List of
OrderByField
objects guaranteed to be not null.
-
getMappedObject
public Condition getMappedObject(MapSqlParameterSource parameterSource, CriteriaDefinition criteria, Table table, @Nullable RelationalPersistentEntity<?> entity) - Parameters:
parameterSource
- bind parameterSource object, must not be null.criteria
- criteria definition to map, must not be null.table
- must not be null.entity
- relatedRelationalPersistentEntity
, can be null.- Returns:
- the mapped
Condition
.
-
convertValue
-
getMappingContext
protected MappingContext<? extends RelationalPersistentEntity<?>,RelationalPersistentProperty> getMappingContext()
-
QueryMapper(org.springframework.data.jdbc.core.convert.JdbcConverter)
instead.