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 Details

  • 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)