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, FieldValue> org.springframework.data.convert.EntityReader<Object,,FieldValue> org.springframework.data.convert.EntityWriter<Object,FieldValue>
public class MappingNosqlConverter
extends Object
implements org.springframework.data.convert.EntityConverter<NosqlPersistentEntity<?>,NosqlPersistentProperty,Object,FieldValue>, org.springframework.context.ApplicationContextAware
-
Constructor Summary
ConstructorsConstructorDescriptionMappingNosqlConverter(org.springframework.data.mapping.context.MappingContext<? extends NosqlPersistentEntity<?>, NosqlPersistentProperty> mappingContext) -
Method Summary
Modifier and TypeMethodDescriptionstatic RuntimeExceptionconvert(NoSQLException nse) <ID> MapValueconvertIdToPrimaryKey(String idColumnName, ID id) Converts the ID id to a MapValue representing the primaryKey.convertObjToFieldValue(Object javaObj, NosqlPersistentProperty prop, boolean isItemInCollection) <T> MapValueconvertObjToRow(T objectToSave, boolean skipSetId) Converts an entity to the value stored in NosqlDB.org.springframework.context.ApplicationContextorg.springframework.core.convert.ConversionServicegetIdProperty(Class<E> entityClass) org.springframework.data.mapping.context.MappingContext<? extends NosqlPersistentEntity<?>, NosqlPersistentProperty> <R> Rread(Class<R> type, FieldValue nosqlRowValue) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) <E,ID> E setId(E objectToSave, FieldValue id) static StringtoNosqlSqlType(Object fromPropertyValue) voidwrite(Object sourceEntity, FieldValue document) Deprecated.
-
Constructor Details
-
MappingNosqlConverter
public MappingNosqlConverter(@NonNull org.springframework.data.mapping.context.MappingContext<? extends NosqlPersistentEntity<?>, NosqlPersistentProperty> mappingContext)
-
-
Method Details
-
getIdProperty
-
read
- Specified by:
readin interfaceorg.springframework.data.convert.EntityReader<Object,FieldValue>
-
write
Deprecated.- Specified by:
writein interfaceorg.springframework.data.convert.EntityWriter<Object,FieldValue>
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext() -
setApplicationContext
public void setApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
getConversionService
@NonNull public org.springframework.core.convert.ConversionService getConversionService()- Specified by:
getConversionServicein interfaceorg.springframework.data.convert.EntityConverter<NosqlPersistentEntity<?>,NosqlPersistentProperty, Object, FieldValue>
-
getMappingContext
@NonNull public org.springframework.data.mapping.context.MappingContext<? extends NosqlPersistentEntity<?>,NosqlPersistentProperty> getMappingContext()- Specified by:
getMappingContextin interfaceorg.springframework.data.convert.EntityConverter<NosqlPersistentEntity<?>,NosqlPersistentProperty, Object, FieldValue>
-
convertObjToRow
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 FieldValue convertObjToFieldValue(Object javaObj, @Nullable NosqlPersistentProperty prop, boolean isItemInCollection) -
setId
-
convertIdToPrimaryKey
Converts the ID id to a MapValue representing the primaryKey. -
toNosqlSqlType
-
convert
-