mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-27 22:39:13 +00:00
HHH-2304 Wrong type detection for sql type char(x) columns
This commit is contained in:
parent
27e9957f9e
commit
c26030a27e
@ -633,10 +633,14 @@ public Type getHibernateType(int columnPos) throws SQLException {
|
|||||||
int columnType = resultSetMetaData.getColumnType( columnPos );
|
int columnType = resultSetMetaData.getColumnType( columnPos );
|
||||||
int scale = resultSetMetaData.getScale( columnPos );
|
int scale = resultSetMetaData.getScale( columnPos );
|
||||||
int precision = resultSetMetaData.getPrecision( columnPos );
|
int precision = resultSetMetaData.getPrecision( columnPos );
|
||||||
|
int length = precision;
|
||||||
|
if ( columnType == 1 && precision == 0 ) {
|
||||||
|
length = resultSetMetaData.getColumnDisplaySize( columnPos );
|
||||||
|
}
|
||||||
return factory.getTypeResolver().heuristicType(
|
return factory.getTypeResolver().heuristicType(
|
||||||
factory.getDialect().getHibernateTypeName(
|
factory.getDialect().getHibernateTypeName(
|
||||||
columnType,
|
columnType,
|
||||||
precision,
|
length,
|
||||||
precision,
|
precision,
|
||||||
scale
|
scale
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user