HHH-17576 inappropriate use of getDefaultTimestampPrecision() as default precision
This default is only appropriate for timestamps (hence the name) and should not be used for dates or plain times.
This commit is contained in:
parent
6d4002bd97
commit
6d64e854e2
|
@ -142,6 +142,6 @@ public class CalendarDateJavaType extends AbstractTemporalJavaType<Calendar> {
|
|||
|
||||
@Override
|
||||
public int getDefaultSqlPrecision(Dialect dialect, JdbcType jdbcType) {
|
||||
return dialect.getDefaultTimestampPrecision();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,6 +144,9 @@ public class CalendarTimeJavaType extends AbstractTemporalJavaType<Calendar> {
|
|||
|
||||
@Override
|
||||
public int getDefaultSqlPrecision(Dialect dialect, JdbcType jdbcType) {
|
||||
return dialect.getDefaultTimestampPrecision();
|
||||
// times represent repeating events - they
|
||||
// almost never come equipped with seconds,
|
||||
// let alone fractional seconds!
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ public class DateJavaType extends AbstractTemporalJavaType<Date> implements Vers
|
|||
|
||||
@Override
|
||||
public int getDefaultSqlPrecision(Dialect dialect, JdbcType jdbcType) {
|
||||
// this "Date" is really a timestamp
|
||||
return dialect.getDefaultTimestampPrecision();
|
||||
}
|
||||
|
||||
|
|
|
@ -273,7 +273,10 @@ public class JdbcTimeJavaType extends AbstractTemporalJavaType<Date> {
|
|||
|
||||
@Override
|
||||
public int getDefaultSqlPrecision(Dialect dialect, JdbcType jdbcType) {
|
||||
return dialect.getDefaultTimestampPrecision();
|
||||
// times represent repeating events - they
|
||||
// almost never come equipped with seconds,
|
||||
// let alone fractional seconds!
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -189,7 +189,10 @@ public class LocalTimeJavaType extends AbstractTemporalJavaType<LocalTime> {
|
|||
|
||||
@Override
|
||||
public int getDefaultSqlPrecision(Dialect dialect, JdbcType jdbcType) {
|
||||
return dialect.getDefaultTimestampPrecision();
|
||||
// times represent repeating events - they
|
||||
// almost never come equipped with seconds,
|
||||
// let alone fractional seconds!
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -251,7 +251,10 @@ public class OffsetTimeJavaType extends AbstractTemporalJavaType<OffsetTime> {
|
|||
|
||||
@Override
|
||||
public int getDefaultSqlPrecision(Dialect dialect, JdbcType jdbcType) {
|
||||
return dialect.getDefaultTimestampPrecision();
|
||||
// times represent repeating events - they
|
||||
// almost never come equipped with seconds,
|
||||
// let alone fractional seconds!
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -162,9 +162,6 @@ public class DdlTypeRegistry implements Serializable {
|
|||
return getTypeName( typeCode, Size.precision( dialect.getFloatPrecision() ) );
|
||||
case SqlTypes.DOUBLE:
|
||||
return getTypeName( typeCode, Size.precision( dialect.getDoublePrecision() ) );
|
||||
case SqlTypes.TIME:
|
||||
case SqlTypes.TIME_WITH_TIMEZONE:
|
||||
case SqlTypes.TIME_UTC:
|
||||
case SqlTypes.TIMESTAMP:
|
||||
case SqlTypes.TIMESTAMP_WITH_TIMEZONE:
|
||||
case SqlTypes.TIMESTAMP_UTC:
|
||||
|
|
Loading…
Reference in New Issue