Use dialect default precision for additional types

This commit is contained in:
Chris Cranford 2021-03-11 15:04:27 -05:00 committed by Christian Beikov
parent 79a0c325e9
commit fd73a1af85
1 changed files with 9 additions and 1 deletions

View File

@ -947,10 +947,18 @@ public abstract class Dialect implements ConversionContext {
}
public String getTypeName(int code) throws HibernateException {
// explicitly enforce dialect's default precisions
switch ( code ) {
case Types.DECIMAL:
case Types.NUMERIC:
return getTypeName( code, Size.precision( getDefaultDecimalPrecision() ) );
case Types.FLOAT:
case Types.REAL:
return getTypeName( code, Size.precision( getFloatPrecision() ) );
case Types.DOUBLE:
return getTypeName( code, Size.precision( getDoublePrecision() ) );
case Types.TIMESTAMP:
case Types.TIMESTAMP_WITH_TIMEZONE:
// explicitly enforce dialect's default timestamp precision
return getTypeName( code, Size.precision( getDefaultTimestampPrecision() ) );
default:
return getTypeName( code, Size.nil() );