#309 - ScalarTypeConverters for Java8 time datatypes not working

This commit is contained in:
rbygrave
2015-06-17 21:13:48 +12:00
parent 2a900165f0
commit 7d02a42276
8 changed files with 51 additions and 7 deletions
@@ -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