From 49f27dcd0e073bd0474de4d7c9ec1dd4fab8d93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Kuruc?= Date: Tue, 19 Mar 2024 13:40:51 +0100 Subject: [PATCH] HHH-17862 Fix TemporaryTable identity column sqlTypeName error --- .../hibernate/dialect/temptable/TemporaryTable.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/temptable/TemporaryTable.java b/hibernate-core/src/main/java/org/hibernate/dialect/temptable/TemporaryTable.java index ae1aaf6eea..e7840c9d94 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/temptable/TemporaryTable.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/temptable/TemporaryTable.java @@ -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()