Module is.codion.framework.domain
Interface Column.Converter<T,C>
- Type Parameters:
T
- the type of the valueC
- the type of the underlying column
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 TypeMethodDescriptionfromColumnValue
(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
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 translatestatement
- 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
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
-