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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classValue object to represent a field and its meta-information.protected static classExtension ofQueryMapper.Fieldto be backed with mapping metadata. -
Constructor Summary
ConstructorsConstructorDescriptionQueryMapper(JdbcConverter converter) Creates a newQueryMapperwith the givenJdbcConverter.QueryMapper(Dialect dialect, JdbcConverter converter) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectconvertValue(Object value, TypeInformation<?> typeInformation) getMappedObject(MapSqlParameterSource parameterSource, CriteriaDefinition criteria, Table table, RelationalPersistentEntity<?> entity) getMappedSort(Table table, Sort sort, RelationalPersistentEntity<?> entity) Map theSortobject to apply field name mapping usingthe type to read.protected MappingContext<? extends RelationalPersistentEntity<?>,RelationalPersistentProperty>
-
Constructor Details
-
QueryMapper
Deprecated.Creates a newQueryMapperwith the givenJdbcConverter.- Parameters:
dialect- must not be null.converter- must not be null.
-
QueryMapper
Creates a newQueryMapperwith the givenJdbcConverter.- Parameters:
converter- must not be null.
-
-
Method Details
-
getMappedSort
public List<OrderByField> getMappedSort(Table table, Sort sort, @Nullable RelationalPersistentEntity<?> entity) Map theSortobject to apply field name mapping usingthe type to read.- Parameters:
sort- must not be null.entity- relatedRelationalPersistentEntity, can be null.- Returns:
- a List of
OrderByFieldobjects 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.