HHH-17862 Fix TemporaryTable identity column sqlTypeName error

This commit is contained in:
Vladimír Kuruc 2024-03-19 13:40:51 +01:00 committed by Christian Beikov
parent 975f471c85
commit 49f27dcd0e
1 changed files with 6 additions and 4 deletions

View File

@ -319,15 +319,17 @@ public class TemporaryTable implements Exportable, Contributable {
int idIdx = 0;
for ( Column column : entityBinding.getKey().getColumns() ) {
final JdbcMapping jdbcMapping = identifierMapping.getJdbcMapping( idIdx++ );
String sqlTypeName = "";
if ( dialect.getIdentityColumnSupport().hasDataTypeInIdentityColumn() ) {
sqlTypeName = column.getSqlType( runtimeModelCreationContext.getMetadata() ) + " ";
}
sqlTypeName = sqlTypeName + dialect.getIdentityColumnSupport().getIdentityColumnString( column.getSqlTypeCode( runtimeModelCreationContext.getMetadata() ) );
columns.add(
new TemporaryTableColumn(
temporaryTable,
ENTITY_TABLE_IDENTITY_COLUMN,
jdbcMapping,
column.getSqlType(
runtimeModelCreationContext.getMetadata()
) + " " +
dialect.getIdentityColumnSupport().getIdentityColumnString( column.getSqlTypeCode( runtimeModelCreationContext.getMetadata() ) ),
sqlTypeName,
column.getColumnSize(
dialect,
runtimeModelCreationContext.getMetadata()