Class QueryMapper
java.lang.Object
org.springframework.data.r2dbc.query.QueryMapper
- Direct Known Subclasses:
UpdateMapper
-
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(R2dbcDialect dialect, R2dbcConverter converter) Creates a newQueryMapperwith the givenR2dbcConverter. -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable ObjectconvertValue(@Nullable Object value, org.springframework.data.core.TypeInformation<?> typeInformation) getBindValue(Parameter value) Potentially convert theParameter.org.springframework.data.relational.core.sql.ExpressiongetMappedObject(org.springframework.data.relational.core.sql.Expression expression, @Nullable org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?> entity) Deprecated.getMappedObject(BindMarkers markers, org.springframework.data.relational.core.query.CriteriaDefinition criteria, org.springframework.data.relational.core.sql.Table table, @Nullable org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?> entity) List<org.springframework.data.relational.core.sql.Expression> getMappedObjects(org.springframework.data.relational.core.sql.Expression expression, @Nullable org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?> entity) Map theExpressionobject to apply field name mapping usingthe type to read.List<org.springframework.data.relational.core.sql.OrderByField> getMappedSort(org.springframework.data.relational.core.sql.Table table, Sort sort, @Nullable org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?> entity) Map theSortobject to apply field name mapping usingthe type to read.protected MappingContext<? extends org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>, org.springframework.data.relational.core.mapping.RelationalPersistentProperty> toSql(org.springframework.data.relational.core.sql.SqlIdentifier identifier) Render aSqlIdentifierfor SQL usage.
-
Constructor Details
-
QueryMapper
Creates a newQueryMapperwith the givenR2dbcConverter.- Parameters:
dialect-converter- must not be null.
-
-
Method Details
-
toSql
Render aSqlIdentifierfor SQL usage. The resulting String might contain quoting characters.- Parameters:
identifier- the identifier to be rendered.- Returns:
- an identifier String.
- Since:
- 1.1
-
getMappedSort
public List<org.springframework.data.relational.core.sql.OrderByField> getMappedSort(org.springframework.data.relational.core.sql.Table table, Sort sort, @Nullable org.springframework.data.relational.core.mapping.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:
- Since:
- 1.1
-
getMappedObject
@Deprecated(since="4.0") public org.springframework.data.relational.core.sql.Expression getMappedObject(org.springframework.data.relational.core.sql.Expression expression, @Nullable org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?> entity) Deprecated.since 4.0 in favor ofgetMappedObjects(Expression, RelationalPersistentEntity)where usage ofembeddable propertiescan return more than one mapped result.Map theExpressionobject to apply field name mapping usingthe type to read.- Parameters:
expression- must not be null.entity- relatedRelationalPersistentEntity, can be null.- Returns:
- the mapped
Expression. - Since:
- 1.1
-
getMappedObjects
public List<org.springframework.data.relational.core.sql.Expression> getMappedObjects(org.springframework.data.relational.core.sql.Expression expression, @Nullable org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?> entity) Map theExpressionobject to apply field name mapping usingthe type to read.- Parameters:
expression- must not be null.entity- relatedRelationalPersistentEntity, can be null.- Returns:
- the mapped
Expressions. - Since:
- 4.0
-
getMappedObject
public BoundCondition getMappedObject(BindMarkers markers, org.springframework.data.relational.core.query.CriteriaDefinition criteria, org.springframework.data.relational.core.sql.Table table, @Nullable org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?> entity) - Parameters:
markers- bind markers 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
BoundCondition. - Since:
- 1.1
-
getBindValue
-
convertValue
-
getMappingContext
protected MappingContext<? extends org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>, org.springframework.data.relational.core.mapping.RelationalPersistentProperty> getMappingContext()
-
getMappedObjects(Expression, RelationalPersistentEntity)where usage ofembeddable propertiescan return more than one mapped result.