From 126be8f249976a86461c302df95e9056917a2257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Kuruc?= Date: Tue, 3 Sep 2024 13:13:50 +0200 Subject: [PATCH] HHH-18558 Fix for Informix UUID type support --- .../org/hibernate/community/dialect/InformixDialect.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixDialect.java index d31b169b93..1c12fdc799 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixDialect.java @@ -26,6 +26,7 @@ import org.hibernate.dialect.Dialect; import org.hibernate.dialect.NullOrdering; import org.hibernate.dialect.Replacer; import org.hibernate.dialect.SelectItemReferenceStrategy; +import org.hibernate.dialect.VarcharUUIDJdbcType; import org.hibernate.dialect.function.CaseLeastGreatestEmulation; import org.hibernate.dialect.function.CommonFunctionFactory; import org.hibernate.dialect.identity.IdentityColumnSupport; @@ -74,6 +75,7 @@ import org.hibernate.type.descriptor.jdbc.ClobJdbcType; import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeRegistry; import org.hibernate.type.descriptor.sql.DdlType; import org.hibernate.type.descriptor.sql.internal.CapacityDependentDdlType; +import org.hibernate.type.descriptor.sql.internal.DdlTypeImpl; import org.hibernate.type.descriptor.sql.spi.DdlTypeRegistry; import org.hibernate.type.spi.TypeConfiguration; @@ -91,6 +93,7 @@ import static org.hibernate.type.SqlTypes.TIME; import static org.hibernate.type.SqlTypes.TIMESTAMP; import static org.hibernate.type.SqlTypes.TIMESTAMP_WITH_TIMEZONE; import static org.hibernate.type.SqlTypes.TINYINT; +import static org.hibernate.type.SqlTypes.UUID; import static org.hibernate.type.SqlTypes.VARBINARY; import static org.hibernate.type.SqlTypes.VARCHAR; import static org.hibernate.type.descriptor.DateTimeUtils.JDBC_ESCAPE_END; @@ -216,6 +219,7 @@ public class InformixDialect extends Dialect { .withTypeCapacity( getMaxNVarcharLength(), columnType( NVARCHAR ) ) .build() ); + ddlTypeRegistry.addDescriptor( new DdlTypeImpl( UUID, "char(36)", this ) ); } @Override @@ -811,5 +815,6 @@ public class InformixDialect extends Dialect { super.contributeTypes( typeContributions, serviceRegistry ); final JdbcTypeRegistry jdbcTypeRegistry = typeContributions.getTypeConfiguration().getJdbcTypeRegistry(); jdbcTypeRegistry.addDescriptor( Types.NCLOB, ClobJdbcType.DEFAULT ); + typeContributions.contributeJdbcType( VarcharUUIDJdbcType.INSTANCE ); } }