Interface R2dbcConverter

All Superinterfaces:
EntityReader<Object,Row>, EntityWriter<Object,OutboundRow>, org.springframework.data.relational.core.conversion.RelationalConverter
All Known Implementing Classes:
MappingR2dbcConverter

public interface R2dbcConverter extends EntityReader<Object,Row>, EntityWriter<Object,OutboundRow>, org.springframework.data.relational.core.conversion.RelationalConverter
Central R2DBC specific converter interface.
Author:
Mark Paluch
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    getArrayValue(org.springframework.data.relational.core.dialect.ArrayColumns arrayColumns, org.springframework.data.relational.core.mapping.RelationalPersistentProperty property, Object value)
    Convert a value into an array representation according to ArrayColumns.
    Returns the underlying ConversionService used by the converter.
    getTargetType(Class<?> valueType)
    Return the target type for a value considering registered converters.
    boolean
    Return whether the type is a simple type.
    Returns a Function that populates the id property of the object from a Row.
    <R> R
    read(Class<R> type, Row source, RowMetadata metadata)
    Reads the given source into the given type.
    org.springframework.data.relational.domain.RowDocument
    toRowDocument(Class<?> type, Readable row, Iterable<? extends ReadableMetadata> metadata)
    Create a flat RowDocument from a single Row or Stored Procedure output.

    Methods inherited from interface org.springframework.data.convert.EntityReader

    read

    Methods inherited from interface org.springframework.data.convert.EntityWriter

    write

    Methods inherited from interface org.springframework.data.relational.core.conversion.RelationalConverter

    createInstance, getEntityInstantiators, getMappingContext, getPropertyAccessor, introspectProjection, project, read, readValue, writeValue
  • Method Details

    • getConversionService

      ConversionService getConversionService()
      Returns the underlying ConversionService used by the converter.
      Specified by:
      getConversionService in interface org.springframework.data.relational.core.conversion.RelationalConverter
      Returns:
      never null.
    • getArrayValue

      Object getArrayValue(org.springframework.data.relational.core.dialect.ArrayColumns arrayColumns, org.springframework.data.relational.core.mapping.RelationalPersistentProperty property, Object value)
      Convert a value into an array representation according to ArrayColumns.
      Parameters:
      arrayColumns - dialect-specific array handling configuration.
      property -
      value -
      Returns:
    • getTargetType

      Class<?> getTargetType(Class<?> valueType)
      Return the target type for a value considering registered converters.
      Parameters:
      valueType - must not be null.
      Returns:
      Since:
      1.1
    • isSimpleType

      boolean isSimpleType(Class<?> type)
      Return whether the type is a simple type. Simple types are database primitives or types with a custom mapping strategy.
      Parameters:
      type - the type to inspect, must not be null.
      Returns:
      true if the type is a simple one.
      Since:
      1.2
      See Also:
    • populateIdIfNecessary

      <T> BiFunction<Row,RowMetadata,T> populateIdIfNecessary(T object)
      Returns a Function that populates the id property of the object from a Row.
      Parameters:
      object - must not be null.
      Returns:
    • read

      <R> R read(Class<R> type, Row source, RowMetadata metadata)
      Reads the given source into the given type.
      Parameters:
      type - they type to convert the given source to.
      source - the source to create an object of the given type from.
      metadata - the RowMetadata.
      Returns:
    • toRowDocument

      org.springframework.data.relational.domain.RowDocument toRowDocument(Class<?> type, Readable row, Iterable<? extends ReadableMetadata> metadata)
      Create a flat RowDocument from a single Row or Stored Procedure output.
      Parameters:
      type - the underlying entity type.
      row - the row or stored procedure output to retrieve data from.
      metadata - readable metadata.
      Returns:
      the RowDocument containing the data.
      Since:
      3.2