Interface ColumnProperty.ValueConverter<T,​C>

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

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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T fromColumnValue​(C columnValue)
      Translates the given sql column value into a property value.
      C 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 Detail

      • 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
        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 property value.
        Parameters:
        columnValue - the sql value to translate from
        Returns:
        the value of sql columnValue
        Throws:
        SQLException - in case of an exception