T
- the date typepublic abstract class AbstractDateConverter<T> extends Object implements ValueConverter<T>
Date
, Calendar
, Date
,
Time
or Timestamp
property of an EntityClass
to a SQL expression.Modifier and Type | Field and Description |
---|---|
private static Map<Pattern,DateFormat> |
DEFAULT_FORMATS |
private javax.persistence.TemporalType |
type |
Constructor and Description |
---|
AbstractDateConverter(AttributeAccessor attribute,
boolean mapKey)
Creates a new instance of this
AbstractDateConverter . |
AbstractDateConverter(javax.persistence.TemporalType type) |
Modifier and Type | Method and Description |
---|---|
ColumnExpression |
getExpression(Date value,
GeneratorContext context)
Converts the given value into an SQL expression.
|
ColumnExpression |
getExpression(String defaultValue,
GeneratorContext context)
Use database independent default values.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExpression
private static final Map<Pattern,DateFormat> DEFAULT_FORMATS
private final javax.persistence.TemporalType type
public AbstractDateConverter(AttributeAccessor attribute, boolean mapKey)
AbstractDateConverter
.attribute
- the inspected attributemapKey
- indicates that the converter is used for the key of a map property@ConstructorProperties(value="type") @Generated(value="lombok") public AbstractDateConverter(javax.persistence.TemporalType type)
public ColumnExpression getExpression(Date value, GeneratorContext context)
value
- the value to convertcontext
- the current contextpublic ColumnExpression getExpression(String defaultValue, GeneratorContext context)
getExpression
in interface ValueConverter<T>
defaultValue
- the default value, as given in an DefaultValue
expressioncontext
- the current context (contains the database dialect).Copyright © 2022 fastnate.org. All rights reserved.