mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#309 - ScalarTypeConverters for Java8 time datatypes not working
This commit is contained in:
@@ -80,9 +80,9 @@ public abstract class ScalarTypeBaseVarchar<T> extends ScalarTypeBase<T> {
|
||||
@Override
|
||||
public Object toJdbcType(Object value) {
|
||||
if (value instanceof String) {
|
||||
return parse((String) value);
|
||||
return value;
|
||||
}
|
||||
return value;
|
||||
return format(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.time.Instant;
|
||||
public class ScalarTypeInstant extends ScalarTypeBaseDateTime<Instant> {
|
||||
|
||||
public ScalarTypeInstant(JsonConfig.DateTime mode) {
|
||||
super(mode, Instant.class, true, Types.TIMESTAMP);
|
||||
super(mode, Instant.class, false, Types.TIMESTAMP);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.time.ZonedDateTime;
|
||||
public class ScalarTypeLocalDateTime extends ScalarTypeBaseDateTime<LocalDateTime> {
|
||||
|
||||
public ScalarTypeLocalDateTime(JsonConfig.DateTime mode) {
|
||||
super(mode, LocalDateTime.class, true, Types.TIMESTAMP);
|
||||
super(mode, LocalDateTime.class, false, Types.TIMESTAMP);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.time.ZoneId;
|
||||
public class ScalarTypeOffsetDateTime extends ScalarTypeBaseDateTime<OffsetDateTime> {
|
||||
|
||||
public ScalarTypeOffsetDateTime(JsonConfig.DateTime mode) {
|
||||
super(mode, OffsetDateTime.class, true, Types.TIMESTAMP);
|
||||
super(mode, OffsetDateTime.class, false, Types.TIMESTAMP);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.time.Year;
|
||||
public class ScalarTypeYear extends ScalarTypeBase<Year> {
|
||||
|
||||
public ScalarTypeYear() {
|
||||
super(Year.class, true, Types.INTEGER);
|
||||
super(Year.class, false, Types.INTEGER);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.time.ZonedDateTime;
|
||||
public class ScalarTypeZonedDateTime extends ScalarTypeBaseDateTime<ZonedDateTime> {
|
||||
|
||||
public ScalarTypeZonedDateTime(JsonConfig.DateTime mode) {
|
||||
super(mode, ZonedDateTime.class, true, Types.TIMESTAMP);
|
||||
super(mode, ZonedDateTime.class, false, Types.TIMESTAMP);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user