Package org.fastnate.generator.converter
Class TemporalConverter<T extends Temporal>
java.lang.Object
org.fastnate.generator.converter.TemporalConverter<T>
- Type Parameters:
T- the type of the temporal
- All Implemented Interfaces:
ValueConverter<T>
- Author:
- Tobias Liefke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetExpression(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.
-
Constructor Details
-
TemporalConverter
Creates a new converter.- Parameters:
type- the type of the attribute
-
-
Method Details
-
getExpression
Description copied from interface:ValueConverterBuilds the expression for writing the default value into an SQL clause.- Specified by:
getExpressionin interfaceValueConverter<T extends Temporal>- 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
Description copied from interface:ValueConverterBuilds the expression for writing the given value into an SQL clause.- Specified by:
getExpressionin interfaceValueConverter<T extends Temporal>- Parameters:
value- the current valuecontext- the current context (contains the database dialect).- Returns:
- the expression (that is including surrounding ' for string literals)
-