Interface Column.Converter<T,C>

Type Parameters:
T - the type of the value
C - the type of the underlying column
Enclosing interface:
Column<T>

public static interface Column.Converter<T,C>
Converts to and from SQL values, such as integers being used to represent booleans in a database.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromColumnValue(C columnValue)
    Translates the given sql column value into a column value.
    toColumnValue(T value, Statement statement)
    Translates the given value into a sql value, usually this is not required but for certain types this may be necessary, such as boolean values where the values are represented by a non-boolean data type in the underlying database
  • Method Details

    • toColumnValue

      C toColumnValue(T value, Statement statement) throws SQLException
      Translates the given value into a sql value, usually this is not required but for certain types this may be necessary, such as boolean values where the values are represented by a non-boolean data type in the underlying database
      Parameters:
      value - the value to translate
      statement - the statement using the value, may be null
      Returns:
      the sql value used to represent the given value
      Throws:
      SQLException - in case of an exception
    • fromColumnValue

      T fromColumnValue(C columnValue) throws SQLException
      Translates the given sql column value into a column value.
      Parameters:
      columnValue - the sql value to translate from
      Returns:
      the value of sql columnValue
      Throws:
      SQLException - in case of an exception