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, Mikhail Fedorov
-
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. -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable ObjectconvertValue(@Nullable Object value, org.springframework.data.core.TypeInformation<?> typeInformation) getMappedObject(MapSqlParameterSource parameterSource, CriteriaDefinition criteria, Table table, @Nullable RelationalPersistentEntity<?> entity) getMappedSort(Table table, Sort sort, @Nullable RelationalPersistentEntity<?> entity) Map theSortobject to apply field name mapping usingthe type to read.protected MappingContext<? extends RelationalPersistentEntity<?>, RelationalPersistentProperty>
-
Constructor Details
-
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()
-