org.springframework.data.jdbc.core.convert

## Interface JdbcConverter

All Superinterfaces:
  RelationalConverter

All Known Implementing Classes:
  BasicJdbcConverter

    public interface JdbcConverter
    extends RelationalConverter

A `JdbcConverter` is responsible for converting for values to the native relational representation and vice versa.

Since:
  1.1
Author:
  Jens Schauder

### Method Summary

All Methods Instance Methods Abstract Methods
`Class<?>` `getColumnType(RelationalPersistentProperty property)` The type to be used to store this property in the database.
`int` `getSqlType(RelationalPersistentProperty property)` The SQL type constant used when using this property as a parameter for a SQL statement.
`<T> T` `mapRow(PersistentPropertyPathExtension path, ResultSet resultSet, Identifier identifier, Object key)` Read the current row from `ResultSet` to an `entity`.
`<T> T` `mapRow(RelationalPersistentEntity<T> entity, ResultSet resultSet, Object key)` Read the current row from `ResultSet` to an `entity`.
`JdbcValue` `writeJdbcValue(Object value, Class<?> type, int sqlType)` Convert a property value into a `JdbcValue` that contains the converted value and information how to bind it to JDBC parameters.

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

`createInstance, getConversionService, getMappingContext, getPropertyAccessor, readValue, writeValue`

### Method Detail

#### writeJdbcValue

    JdbcValue writeJdbcValue(@Nullable
                             Object value,
                             Class<?> type,
                             int sqlType)

Convert a property value into a `JdbcValue` that contains the converted value and information how to bind it to JDBC parameters.

Parameters:
  `value` - a value as it is used in the object model. May be `null`.
  `type` - `TypeInformation` into which the value is to be converted. Must not be `null`.
  `sqlType` - the type constant from `Types` to be used if non is specified by a converter.
Returns:
  The converted value wrapped in a `JdbcValue`. Guaranteed to be not null.

#### mapRow

    <T> T mapRow(RelationalPersistentEntity<T> entity,
                 ResultSet resultSet,
                 Object key)

Read the current row from `ResultSet` to an `entity`.

Type Parameters:
  `T` -
Parameters:
  `entity` - the persistent entity type.
  `resultSet` - the `ResultSet` to read from.
  `key` - primary key.
Returns:

#### mapRow

    <T> T mapRow(PersistentPropertyPathExtension path,
                 ResultSet resultSet,
                 Identifier identifier,
                 Object key)

Read the current row from `ResultSet` to an `entity`.

Type Parameters:
  `T` -
Parameters:
  `path` - path to the owning property.
  `resultSet` - the `ResultSet` to read from.
  `identifier` - entity identifier.
  `key` - primary key.
Returns:

#### getColumnType

    Class<?> getColumnType(RelationalPersistentProperty property)

The type to be used to store this property in the database. Multidimensional arrays are unwrapped to reflect a top-level array type (e.g. `String[][]` returns `String[]`).

Returns:
  a `Class` that is suitable for usage with JDBC drivers.
Since:
  2.0
See Also:
  `JdbcUtil.sqlTypeFor(Class)`

#### getSqlType

    int getSqlType(RelationalPersistentProperty property)

The SQL type constant used when using this property as a parameter for a SQL statement.

Returns:
  Must not be `null`.
Since:
  2.0
See Also:
  `Types`