Interface R2dbcConverter
- All Superinterfaces:
EntityReader<Object,,io.r2dbc.spi.Row> EntityWriter<Object,,OutboundRow> RelationalConverter
- All Known Implementing Classes:
MappingR2dbcConverter
public interface R2dbcConverter
extends EntityReader<Object,io.r2dbc.spi.Row>, EntityWriter<Object,OutboundRow>, RelationalConverter
Central R2DBC specific converter interface.
- Author:
- Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetArrayValue(ArrayColumns arrayColumns, RelationalPersistentProperty property, Object value) Convert avalueinto an array representation according toArrayColumns.Returns the underlyingConversionServiceused by the converter.MappingContext<? extends RelationalPersistentEntity<?>,? extends RelationalPersistentProperty> Returns the underlyingMappingContextused by the converter.Class<?>getTargetType(Class<?> valueType) Return the target type for a value considering registered converters.booleanisSimpleType(Class<?> type) Return whether thetypeis a simple type.<T> BiFunction<io.r2dbc.spi.Row,io.r2dbc.spi.RowMetadata, T> populateIdIfNecessary(T object) <R> RReads the given source into the given type.Methods inherited from interface org.springframework.data.convert.EntityReader
readMethods inherited from interface org.springframework.data.convert.EntityWriter
writeMethods inherited from interface org.springframework.data.relational.core.conversion.RelationalConverter
createInstance, getEntityInstantiators, getPropertyAccessor, readValue, writeValue
-
Method Details
-
getMappingContext
MappingContext<? extends RelationalPersistentEntity<?>,? extends RelationalPersistentProperty> getMappingContext()Returns the underlyingMappingContextused by the converter.- Specified by:
getMappingContextin interfaceRelationalConverter- Returns:
- never null
-
getConversionService
ConversionService getConversionService()Returns the underlyingConversionServiceused by the converter.- Specified by:
getConversionServicein interfaceRelationalConverter- Returns:
- never null.
-
getArrayValue
Object getArrayValue(ArrayColumns arrayColumns, RelationalPersistentProperty property, Object value) Convert avalueinto an array representation according toArrayColumns.- Parameters:
arrayColumns- dialect-specific array handling configuration.property-value-- Returns:
-
getTargetType
Return the target type for a value considering registered converters.- Parameters:
valueType- must not be null.- Returns:
- Since:
- 1.1
-
isSimpleType
Return whether thetypeis a simple type. Simple types are database primitives or types with a custom mapping strategy.- Parameters:
type- the type to inspect, must not be null.- Returns:
- true if the type is a simple one.
- Since:
- 1.2
- See Also:
-
populateIdIfNecessary
- Parameters:
object- must not be null.- Returns:
-
read
Reads the given source into the given type.- Parameters:
type- they type to convert the given source to.source- the source to create an object of the given type from.metadata- theRowMetadata.- Returns:
-