HHH-16686 - Fix for bug in LocalTimeJavaType.unwrap()
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
parent
21b1c71947
commit
4e9789bdff
|
@ -188,7 +188,7 @@ public class JdbcTimeJavaType extends AbstractTemporalJavaType<Date> {
|
|||
return time;
|
||||
}
|
||||
// Preserve milliseconds, which java.sql.Time supports
|
||||
return new Time( time.getTime() + DateTimeUtils.roundToPrecision( localTime.getNano(), 3 ) );
|
||||
return new Time( time.getTime() + DateTimeUtils.roundToPrecision( localTime.getNano(), 3 ) / 1000000 );
|
||||
}
|
||||
|
||||
if ( value instanceof Date ) {
|
||||
|
|
|
@ -88,7 +88,7 @@ public class LocalTimeJavaType extends AbstractTemporalJavaType<LocalTime> {
|
|||
return (X) time;
|
||||
}
|
||||
// Preserve milliseconds, which java.sql.Time supports
|
||||
return (X) new Time( time.getTime() + DateTimeUtils.roundToPrecision( value.getNano(), 3 ) );
|
||||
return (X) new Time( time.getTime() + DateTimeUtils.roundToPrecision( value.getNano(), 3 ) / 1000000 );
|
||||
}
|
||||
|
||||
// Oracle documentation says to set the Date to January 1, 1970 when convert from
|
||||
|
|
|
@ -105,7 +105,7 @@ public class OffsetTimeJavaType extends AbstractTemporalJavaType<OffsetTime> {
|
|||
return (X) time;
|
||||
}
|
||||
// Preserve milliseconds, which java.sql.Time supports
|
||||
return (X) new Time( time.getTime() + DateTimeUtils.roundToPrecision( jdbcOffsetTime.getNano(), 3 ) );
|
||||
return (X) new Time( time.getTime() + DateTimeUtils.roundToPrecision( jdbcOffsetTime.getNano(), 3 ) / 1000000 );
|
||||
}
|
||||
|
||||
final OffsetDateTime jdbcOffsetDateTime = jdbcOffsetTime.atDate( LocalDate.EPOCH );
|
||||
|
|
Loading…
Reference in New Issue