Package org.fastnate.generator.converter
Interface ValueConverter<T>
- Type Parameters:
T- The type of the handled values
- All Known Implementing Classes:
AbstractDateConverter,BooleanConverter,CalendarConverter,CharConverter,CustomValueConverter,DateConverter,DurationConverter,EntityConverter,EnumConverter,LobConverter,NumberConverter,SerializableConverter,StringConverter,TemporalConverter,UnsupportedTypeConverter
public interface ValueConverter<T>
Converts a primitive value to an expression.
- Author:
- Tobias Liefke
-
Method Summary
Modifier and TypeMethodDescriptiondefault ColumnExpressiongetExpression(String defaultValue, GeneratorContext context) Builds the expression for writing the default value into an SQL clause.getExpression(T value, GeneratorContext context) Builds the expression for writing the given value into an SQL clause.
-
Method Details
-
getExpression
Builds the expression for writing the default value into an SQL clause.- Parameters:
defaultValue- the default value, as given in anDefaultValueexpressioncontext- the current context (contains the database dialect).- Returns:
- the expression (that is including surrounding ' for string literals)
-
getExpression
Builds the expression for writing the given value into an SQL clause.- Parameters:
value- the current valuecontext- the current context (contains the database dialect).- Returns:
- the expression (that is including surrounding ' for string literals)
-