T
- the type of the temporalpublic class TemporalConverter<T extends Temporal> extends Object implements ValueConverter<T>
Modifier and Type | Field and Description |
---|---|
private Method |
parse
The method that creates the actual value from a string, which was defined as
DefaultValue . |
private Function<T,String> |
toString
The method that creates the SQL string from a temporal.
|
Constructor and Description |
---|
TemporalConverter(Class<?> type)
Creates a new converter.
|
Modifier and Type | Method and Description |
---|---|
ColumnExpression |
getExpression(String defaultValue,
GeneratorContext context)
Builds the expression for writing the default value into an SQL clause.
|
ColumnExpression |
getExpression(T value,
GeneratorContext context)
Builds the expression for writing the given value into an SQL clause.
|
private Method parse
DefaultValue
.public TemporalConverter(Class<?> type)
type
- the type of the attributepublic ColumnExpression getExpression(String defaultValue, GeneratorContext context)
ValueConverter
getExpression
in interface ValueConverter<T extends Temporal>
defaultValue
- the default value, as given in an DefaultValue
expressioncontext
- the current context (contains the database dialect).public ColumnExpression getExpression(T value, GeneratorContext context)
ValueConverter
getExpression
in interface ValueConverter<T extends Temporal>
value
- the current valuecontext
- the current context (contains the database dialect).Copyright © 2022 fastnate.org. All rights reserved.