public interface RelationalConverter
RelationalConverter
is responsible for converting for values to the native relational representation and
vice versa.Modifier and Type | Method and Description |
---|---|
<T> T |
createInstance(PersistentEntity<T,RelationalPersistentProperty> entity,
Function<PreferredConstructor.Parameter<?,RelationalPersistentProperty>,Object> parameterValueProvider)
Create a new instance of
PersistentEntity given ParameterValueProvider to obtain constructor
properties. |
ConversionService |
getConversionService()
Returns the underlying
ConversionService used by the converter. |
MappingContext<? extends RelationalPersistentEntity<?>,? extends RelationalPersistentProperty> |
getMappingContext()
Returns the underlying
MappingContext used by the converter. |
<T> PersistentPropertyAccessor<T> |
getPropertyAccessor(PersistentEntity<T,?> persistentEntity,
T instance)
Return a
PersistentPropertyAccessor to access property values of the instance . |
Object |
readValue(Object value,
TypeInformation<?> type)
Read a relational value into the desired
destination type . |
Object |
writeValue(Object value,
TypeInformation<?> type)
Write a property value into a relational type that can be stored natively.
|
MappingContext<? extends RelationalPersistentEntity<?>,? extends RelationalPersistentProperty> getMappingContext()
MappingContext
used by the converter.ConversionService getConversionService()
ConversionService
used by the converter.<T> T createInstance(PersistentEntity<T,RelationalPersistentProperty> entity, Function<PreferredConstructor.Parameter<?,RelationalPersistentProperty>,Object> parameterValueProvider)
PersistentEntity
given ParameterValueProvider
to obtain constructor
properties.T
- the type of entity to create.entity
- the kind of entity to create. Must not be null
.parameterValueProvider
- a function that provides the value to pass to a constructor, given a
PreferredConstructor.Parameter
. Must not be null
.null
.<T> PersistentPropertyAccessor<T> getPropertyAccessor(PersistentEntity<T,?> persistentEntity, T instance)
PersistentPropertyAccessor
to access property values of the instance
.persistentEntity
- the kind of entity to operate on. Must not be null
.instance
- the instance to operate on. Must not be null
.null
.@Nullable Object readValue(@Nullable Object value, TypeInformation<?> type)
destination type
.value
- a value as it is returned by the driver accessing the persistence store. May be null
.type
- TypeInformation
into which the value is to be converted. Must not be null
.null
.@Nullable Object writeValue(@Nullable Object value, TypeInformation<?> type)
value
- a value as it is used in the object model. May be null
.type
- TypeInformation
into which the value is to be converted. Must not be null
.null
.Copyright © 2017–2020 Pivotal Software, Inc.. All rights reserved.