public class MappingR2dbcConverter extends org.springframework.data.relational.core.conversion.BasicRelationalConverter implements R2dbcConverter
Constructor and Description |
---|
MappingR2dbcConverter(MappingContext<? extends org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>,? extends org.springframework.data.relational.core.mapping.RelationalPersistentProperty> context)
Creates a new
MappingR2dbcConverter given MappingContext . |
MappingR2dbcConverter(MappingContext<? extends org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>,? extends org.springframework.data.relational.core.mapping.RelationalPersistentProperty> context,
CustomConversions conversions)
|
Modifier and Type | Method and Description |
---|---|
protected List<Object> |
createCollection(Collection<?> collection,
org.springframework.data.relational.core.mapping.RelationalPersistentProperty property)
Writes the given
Collection using the given RelationalPersistentProperty information. |
Object |
getArrayValue(org.springframework.data.relational.core.dialect.ArrayColumns arrayColumns,
org.springframework.data.relational.core.mapping.RelationalPersistentProperty property,
Object value)
Convert a
value into an array representation according to ArrayColumns . |
Class<?> |
getTargetType(Class<?> valueType)
Return the target type for a value considering registered converters.
|
boolean |
isSimpleType(Class<?> type)
Return whether the
type is a simple type. |
<T> BiFunction<Row,RowMetadata,T> |
populateIdIfNecessary(T object)
|
<R> R |
read(Class<R> type,
Row row) |
<R> R |
read(Class<R> type,
Row row,
RowMetadata metadata)
Reads the given source into the given type.
|
Object |
readValue(Object value,
TypeInformation<?> type) |
void |
write(Object source,
OutboundRow sink) |
createInstance, getConversions, getConversionService, getEntityInstantiators, getMappingContext, getPropertyAccessor, writeValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConversionService, getMappingContext
public MappingR2dbcConverter(MappingContext<? extends org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>,? extends org.springframework.data.relational.core.mapping.RelationalPersistentProperty> context)
MappingR2dbcConverter
given MappingContext
.context
- must not be null.public MappingR2dbcConverter(MappingContext<? extends org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>,? extends org.springframework.data.relational.core.mapping.RelationalPersistentProperty> context, CustomConversions conversions)
context
- must not be null.public <R> R read(Class<R> type, Row row)
read
in interface EntityReader<Object,Row>
public <R> R read(Class<R> type, Row row, @Nullable RowMetadata metadata)
R2dbcConverter
read
in interface R2dbcConverter
type
- they type to convert the given source to.row
- the source to create an object of the given type from.metadata
- the RowMetadata
.public Object readValue(@Nullable Object value, TypeInformation<?> type)
readValue
in interface org.springframework.data.relational.core.conversion.RelationalConverter
readValue
in class org.springframework.data.relational.core.conversion.BasicRelationalConverter
public void write(Object source, OutboundRow sink)
write
in interface EntityWriter<Object,OutboundRow>
protected List<Object> createCollection(Collection<?> collection, org.springframework.data.relational.core.mapping.RelationalPersistentProperty property)
Collection
using the given RelationalPersistentProperty
information.collection
- must not be null.property
- must not be null.public Object getArrayValue(org.springframework.data.relational.core.dialect.ArrayColumns arrayColumns, org.springframework.data.relational.core.mapping.RelationalPersistentProperty property, Object value)
R2dbcConverter
value
into an array representation according to ArrayColumns
.getArrayValue
in interface R2dbcConverter
arrayColumns
- dialect-specific array handling configuration.public Class<?> getTargetType(Class<?> valueType)
R2dbcConverter
getTargetType
in interface R2dbcConverter
valueType
- must not be null.public boolean isSimpleType(Class<?> type)
R2dbcConverter
type
is a simple type. Simple types are database primitives or types with a custom
mapping strategy.isSimpleType
in interface R2dbcConverter
type
- the type to inspect, must not be null.SimpleTypeHolder
public <T> BiFunction<Row,RowMetadata,T> populateIdIfNecessary(T object)
populateIdIfNecessary
in interface R2dbcConverter
object
- must not be null.Copyright © 2018–2022 Pivotal Software, Inc.. All rights reserved.