Enforce dialect's default timestamp precision

This commit is contained in:
Chris Cranford 2021-03-09 18:07:56 -05:00 committed by Christian Beikov
parent 2cf8131f6e
commit 4292d118ad
1 changed files with 8 additions and 1 deletions

View File

@ -947,8 +947,15 @@ public abstract class Dialect implements ConversionContext {
}
public String getTypeName(int code) throws HibernateException {
switch ( code ) {
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() );
}
}
/**
* Get the name of the database type associated with the given