Package org.fastnate.generator.converter
Class DurationConverter
java.lang.Object
org.fastnate.generator.converter.DurationConverter
- All Implemented Interfaces:
ValueConverter<Duration>
Converts a
Duration to an SQL expression.- 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(Duration value, GeneratorContext context) Builds the expression for writing the given value into an SQL clause.
-
Constructor Details
-
DurationConverter
public DurationConverter()
-
-
Method Details
-
getExpression
Description copied from interface:ValueConverterBuilds the expression for writing the given value into an SQL clause.- Specified by:
getExpressionin interfaceValueConverter<Duration>- Parameters:
value- the current valuecontext- 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 default value into an SQL clause.- Specified by:
getExpressionin interfaceValueConverter<Duration>- 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)
-