Class MappingNosqlConverter
java.lang.Object
com.oracle.nosql.spring.data.core.convert.MappingNosqlConverter
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.data.convert.EntityConverter<NosqlPersistentEntity<?>,
,NosqlPersistentProperty, Object, oracle.nosql.driver.values.FieldValue> org.springframework.data.convert.EntityReader<Object,
,oracle.nosql.driver.values.FieldValue> org.springframework.data.convert.EntityWriter<Object,
oracle.nosql.driver.values.FieldValue>
public class MappingNosqlConverter
extends Object
implements org.springframework.data.convert.EntityConverter<NosqlPersistentEntity<?>,NosqlPersistentProperty,Object,oracle.nosql.driver.values.FieldValue>, org.springframework.context.ApplicationContextAware
-
Constructor Summary
ConstructorsConstructorDescriptionMappingNosqlConverter
(org.springframework.data.mapping.context.MappingContext<? extends NosqlPersistentEntity<?>, NosqlPersistentProperty> mappingContext) -
Method Summary
Modifier and TypeMethodDescriptionstatic RuntimeException
convert
(oracle.nosql.driver.NoSQLException nse) <ID> oracle.nosql.driver.values.MapValue
convertIdToPrimaryKey
(String idColumnName, ID id) Converts the ID id to a MapValue representing the primaryKey.oracle.nosql.driver.values.FieldValue
convertObjToFieldValue
(Object javaObj, NosqlPersistentProperty prop, boolean isItemInCollection) <T> oracle.nosql.driver.values.MapValue
convertObjToRow
(T objectToSave, boolean skipSetId) Converts an entity to the value stored in NosqlDB.org.springframework.context.ApplicationContext
org.springframework.core.convert.ConversionService
getIdProperty
(Class<E> entityClass) org.springframework.data.mapping.context.MappingContext<? extends NosqlPersistentEntity<?>,
NosqlPersistentProperty> <R> R
void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) <E,
ID> E setId
(E objectToSave, oracle.nosql.driver.values.FieldValue id) static String
toNosqlSqlType
(Object fromPropertyValue) void
Deprecated.
-
Constructor Details
-
MappingNosqlConverter
public MappingNosqlConverter(@NonNull org.springframework.data.mapping.context.MappingContext<? extends NosqlPersistentEntity<?>, NosqlPersistentProperty> mappingContext)
-
-
Method Details
-
getIdProperty
-
read
@Nullable public <R> R read(@NonNull Class<R> type, @NonNull oracle.nosql.driver.values.FieldValue nosqlRowValue) - Specified by:
read
in interfaceorg.springframework.data.convert.EntityReader<Object,
oracle.nosql.driver.values.FieldValue>
-
write
@Deprecated public void write(@Nullable Object sourceEntity, @Nullable oracle.nosql.driver.values.FieldValue document) Deprecated.- Specified by:
write
in interfaceorg.springframework.data.convert.EntityWriter<Object,
oracle.nosql.driver.values.FieldValue>
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext() -
setApplicationContext
public void setApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
getConversionService
@NonNull public org.springframework.core.convert.ConversionService getConversionService()- Specified by:
getConversionService
in interfaceorg.springframework.data.convert.EntityConverter<NosqlPersistentEntity<?>,
NosqlPersistentProperty, Object, oracle.nosql.driver.values.FieldValue>
-
getMappingContext
@NonNull public org.springframework.data.mapping.context.MappingContext<? extends NosqlPersistentEntity<?>,NosqlPersistentProperty> getMappingContext()- Specified by:
getMappingContext
in interfaceorg.springframework.data.convert.EntityConverter<NosqlPersistentEntity<?>,
NosqlPersistentProperty, Object, oracle.nosql.driver.values.FieldValue>
-
convertObjToRow
public <T> oracle.nosql.driver.values.MapValue convertObjToRow(T objectToSave, boolean skipSetId) Converts an entity to the value stored in NosqlDB.- Parameters:
objectToSave
- entity to be convertedskipSetId
- for inserts id is not set, it will be generated by Nosql driver- Returns:
- the Nosql row representation to be saved into table
-
convertObjToFieldValue
@Nullable public oracle.nosql.driver.values.FieldValue convertObjToFieldValue(Object javaObj, @Nullable NosqlPersistentProperty prop, boolean isItemInCollection) -
setId
public <E,ID> E setId(E objectToSave, oracle.nosql.driver.values.FieldValue id) -
convertIdToPrimaryKey
Converts the ID id to a MapValue representing the primaryKey. -
toNosqlSqlType
-
convert
-