Class LcEntityReader
- java.lang.Object
-
- net.lecousin.reactive.data.relational.mapping.LcEntityReader
-
public class LcEntityReader extends Object
Entity mapper.- Author:
- Guillaume Le Cousin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
LcEntityReader.PropertiesSourceParameterValueProvider
-
Constructor Summary
Constructors Constructor Description LcEntityReader(EntityCache cache, LcMappingR2dbcConverter converter)
LcEntityReader(EntityCache cache, org.springframework.data.convert.CustomConversions conversions, LcReactiveDataRelationalClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityCache
getCache()
protected <T> EntityInstance<T>
getOrCreateInstance(EntityMetadata entityType, PropertiesSource source)
protected <T> EntityInstance<T>
getOrCreateInstance(EntityMetadata entityType, PropertiesSource source, Object id)
protected Object
getPotentiallyConvertedSimpleRead(Object value, Class<?> target)
Checks whether we have a custom conversion for the given simple object.<T> T
read(Class<T> type, PropertiesSource source)
<T> EntityInstance<T>
read(EntityMetadata entityType, PropertiesSource source)
protected <T> org.apache.commons.lang3.mutable.MutableObject<T>
readEntityProperty(org.springframework.data.relational.core.mapping.RelationalPersistentProperty property, Object parentInstance, PropertiesSource source)
protected <T> org.apache.commons.lang3.mutable.MutableObject<T>
readForeignKeyEntity(org.springframework.data.relational.core.mapping.RelationalPersistentProperty property, Object parentInstance, EntityMetadata entityType, PropertiesSource source)
protected org.apache.commons.lang3.mutable.MutableObject<Object>
readProperty(org.springframework.data.relational.core.mapping.RelationalPersistentProperty property, PropertiesSource source, Object instance, Class<?> targetType)
Object
readValue(Object value, Class<?> type)
-
-
-
Constructor Detail
-
LcEntityReader
public LcEntityReader(@Nullable EntityCache cache, @Nullable org.springframework.data.convert.CustomConversions conversions, LcReactiveDataRelationalClient client)
-
LcEntityReader
public LcEntityReader(@Nullable EntityCache cache, LcMappingR2dbcConverter converter)
-
-
Method Detail
-
getCache
public EntityCache getCache()
-
read
public <T> T read(Class<T> type, PropertiesSource source)
-
read
public <T> EntityInstance<T> read(EntityMetadata entityType, PropertiesSource source)
-
readProperty
protected org.apache.commons.lang3.mutable.MutableObject<Object> readProperty(org.springframework.data.relational.core.mapping.RelationalPersistentProperty property, PropertiesSource source, Object instance, Class<?> targetType)
-
getPotentiallyConvertedSimpleRead
@Nullable protected Object getPotentiallyConvertedSimpleRead(@Nullable Object value, @Nullable Class<?> target)
Checks whether we have a custom conversion for the given simple object. Converts the given value if so, appliesEnum
handling or returns the value as is.- Parameters:
value
-target
- must not be null.- Returns:
-
readEntityProperty
protected <T> org.apache.commons.lang3.mutable.MutableObject<T> readEntityProperty(org.springframework.data.relational.core.mapping.RelationalPersistentProperty property, Object parentInstance, PropertiesSource source)
-
readForeignKeyEntity
protected <T> org.apache.commons.lang3.mutable.MutableObject<T> readForeignKeyEntity(org.springframework.data.relational.core.mapping.RelationalPersistentProperty property, Object parentInstance, EntityMetadata entityType, PropertiesSource source)
-
getOrCreateInstance
protected <T> EntityInstance<T> getOrCreateInstance(EntityMetadata entityType, PropertiesSource source)
-
getOrCreateInstance
protected <T> EntityInstance<T> getOrCreateInstance(EntityMetadata entityType, PropertiesSource source, Object id)
-
-