HHH-16094 HHH-17097 MySQL schema generation and validation : tinytext instead of longtext for @Lob

This commit is contained in:
Andrea Boriero 2024-04-23 09:15:18 +02:00 committed by Christian Beikov
parent 5b9057e2ed
commit 55eea3d0df
1 changed files with 11 additions and 2 deletions

View File

@ -152,6 +152,16 @@ public class MySQLDialect extends Dialect {
//we set scale > 20
size.setScale( Math.min( size.getPrecision(), 20 ) );
return size;
case BLOB:
case NCLOB:
case CLOB:
return super.resolveSize(
jdbcType,
javaType,
precision,
scale,
length == null ? getDefaultLobLength() : length
);
default:
return super.resolveSize( jdbcType, javaType, precision, scale, length );
}
@ -524,8 +534,7 @@ public class MySQLDialect extends Dialect {
@Override
public long getDefaultLobLength() {
//max length for mediumblob or mediumtext
return 16_777_215;
return Integer.MAX_VALUE;
}
@Override