public class DateToLocalDateMapper extends Object implements TypeMapper<Date,LocalDate>
The mapping is naive, and will not include or consider timezone or the similar. Instead, the mapping will be direct: what is written in the database will be directly mapped into Java.
Example:
In database: 2016-08-01
In Java: 2016-08-01
COMPARATOR
Constructor and Description |
---|
DateToLocalDateMapper() |
Modifier and Type | Method and Description |
---|---|
Type |
getJavaType(Column column)
Returns a type describing the resulting java type when this mapper is
applied to a database result.
|
String |
getLabel()
Returns the label for this mapper that should appear to the end user.
|
Date |
toDatabaseType(LocalDate value)
Converts a value from the java domain to the database domain.
|
LocalDate |
toJavaType(Column column,
Class<?> entityType,
Date value)
Converts a value from the database domain to the java domain.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
identity, primitive
public String getLabel()
TypeMapper
getLabel
in interface TypeMapper<Date,LocalDate>
public Type getJavaType(Column column)
TypeMapper
getJavaType
in interface TypeMapper<Date,LocalDate>
column
- the column that is being mappedpublic LocalDate toJavaType(Column column, Class<?> entityType, Date value)
TypeMapper
toJavaType
in interface TypeMapper<Date,LocalDate>
column
- the column that is being mappedentityType
- the entity type that the mapping is forvalue
- the value to convertpublic Date toDatabaseType(LocalDate value)
TypeMapper
toDatabaseType
in interface TypeMapper<Date,LocalDate>
value
- the value to convertCopyright © 2017 Speedment, Inc.. All rights reserved.