Package com.oracle.nosql.spring.data.core.convert

# 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

  Constructors
  Constructor
  Description
  `MappingNosqlConverter(org.springframework.data.mapping.context.MappingContext<? extends NosqlPersistentEntity<?>,NosqlPersistentProperty> mappingContext)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static RuntimeException`
  `convert(NoSQLException nse)`
  `<ID> MapValue`
  `convertIdToPrimaryKey(String idColumnName, ID id)`
  Converts the ID id to a MapValue representing the primaryKey.
  `FieldValue`
  `convertObjToFieldValue(Object javaObj, NosqlPersistentProperty prop, boolean isItemInCollection)`
  `<T> MapValue`
  `convertObjToRow(T objectToSave, boolean skipSetId)`
  Converts an entity to the value stored in NosqlDB.
  `org.springframework.context.ApplicationContext`
  `getApplicationContext()`
  `org.springframework.core.convert.ConversionService`
  `getConversionService()`
  `<E> NosqlPersistentProperty`
  `getIdProperty(Class<E> entityClass)`
  `org.springframework.data.mapping.context.MappingContext<? extends NosqlPersistentEntity<?>,NosqlPersistentProperty>`
  `getMappingContext()`
  `<R> R`
  `read(Class<R> type, FieldValue nosqlRowValue)`
  `void`
  `setApplicationContext(org.springframework.context.ApplicationContext applicationContext)`
  `<E, ID> E`
  `setId(E objectToSave, FieldValue id)`
  `static String`
  `toNosqlSqlType(Object fromPropertyValue)`
  `void`
  `write(Object sourceEntity, FieldValue document)`
  Deprecated.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MappingNosqlConverter

    public MappingNosqlConverter(@NonNull org.springframework.data.mapping.context.MappingContext<? extends NosqlPersistentEntity<?>,NosqlPersistentProperty> mappingContext)

- ## Method Details

  - ### getIdProperty

    public <E> NosqlPersistentProperty getIdProperty(@NonNull Class<E> entityClass)

  - ### read

    @Nullable public <R> R read(@NonNull Class<R> type, @NonNull FieldValue nosqlRowValue)
    Specified by:
      `read` in interface `org.springframework.data.convert.EntityReader<Object,FieldValue>`

  - ### write

    @Deprecated public void write(@Nullable Object sourceEntity, @Nullable FieldValue document)
    Deprecated.
    Specified by:
      `write` in interface `org.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:
      `setApplicationContext` in interface `org.springframework.context.ApplicationContextAware`

  - ### getConversionService

    @NonNull public org.springframework.core.convert.ConversionService getConversionService()
    Specified by:
      `getConversionService` in interface `org.springframework.data.convert.EntityConverter<NosqlPersistentEntity<?>,NosqlPersistentProperty,Object,FieldValue>`

  - ### getMappingContext

    @NonNull public org.springframework.data.mapping.context.MappingContext<? extends NosqlPersistentEntity<?>,NosqlPersistentProperty> getMappingContext()
    Specified by:
      `getMappingContext` in interface `org.springframework.data.convert.EntityConverter<NosqlPersistentEntity<?>,NosqlPersistentProperty,Object,FieldValue>`

  - ### convertObjToRow

    public <T> MapValue convertObjToRow(T objectToSave, boolean skipSetId)
    Converts an entity to the value stored in NosqlDB.
    Parameters:
      `objectToSave` - entity to be converted
      `skipSetId` - 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

    public <E, ID> E setId(E objectToSave, FieldValue id)

  - ### convertIdToPrimaryKey

    public <ID> MapValue convertIdToPrimaryKey(String idColumnName, ID id)
    Converts the ID id to a MapValue representing the primaryKey.

  - ### toNosqlSqlType

    public static String toNosqlSqlType(Object fromPropertyValue)

  - ### convert

    public static RuntimeException convert(NoSQLException nse)