diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmCriteriaNodeBuilder.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmCriteriaNodeBuilder.java index 770bcb5ab6..fb72ec5e5c 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmCriteriaNodeBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmCriteriaNodeBuilder.java @@ -1334,7 +1334,7 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext, final EnumJavaType javaType = new EnumJavaType<>( type ); final JdbcType jdbcType = javaType.getRecommendedJdbcType( typeConfiguration.getCurrentBaseSqlTypeIndicators() ); - return new BasicTypeImpl<>( javaType, jdbcType ); + return typeConfiguration.getBasicTypeRegistry().resolve( javaType, jdbcType ); } else { return result; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/exec/internal/AbstractJdbcParameter.java b/hibernate-core/src/main/java/org/hibernate/sql/exec/internal/AbstractJdbcParameter.java index aa8e1d6683..dea2c41ed8 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/exec/internal/AbstractJdbcParameter.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/exec/internal/AbstractJdbcParameter.java @@ -18,7 +18,6 @@ import org.hibernate.metamodel.mapping.JdbcMapping; import org.hibernate.metamodel.mapping.MappingModelExpressible; import org.hibernate.metamodel.mapping.MappingType; import org.hibernate.metamodel.mapping.SqlExpressible; -import org.hibernate.metamodel.model.domain.internal.BasicTypeImpl; import org.hibernate.query.BindableType; import org.hibernate.sql.ast.SqlAstWalker; import org.hibernate.sql.ast.tree.expression.JdbcParameter; @@ -27,6 +26,7 @@ import org.hibernate.sql.exec.spi.ExecutionContext; import org.hibernate.sql.exec.spi.JdbcParameterBinder; import org.hibernate.sql.exec.spi.JdbcParameterBinding; import org.hibernate.sql.exec.spi.JdbcParameterBindings; +import org.hibernate.type.BasicType; import org.hibernate.type.descriptor.java.EnumJavaType; import org.hibernate.type.descriptor.jdbc.JdbcType; import org.hibernate.type.descriptor.jdbc.JdbcTypeIndicators; @@ -135,7 +135,7 @@ public abstract class AbstractJdbcParameter } } - private static > BasicTypeImpl createEnumType(ExecutionContext executionContext, Class enumClass) { + private static > BasicType createEnumType(ExecutionContext executionContext, Class enumClass) { final EnumJavaType enumJavaType = new EnumJavaType<>( enumClass ); final JdbcTypeIndicators indicators = executionContext.getSession().getTypeConfiguration().getCurrentBaseSqlTypeIndicators(); @@ -144,7 +144,7 @@ public abstract class AbstractJdbcParameter // so just accept the default from the TypeConfiguration, which // is usually ORDINAL (the default according to JPA) enumJavaType.getRecommendedJdbcType(indicators); - return new BasicTypeImpl<>( enumJavaType, jdbcType ); + return indicators.getTypeConfiguration().getBasicTypeRegistry().resolve( enumJavaType, jdbcType ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/AbstractArrayJavaType.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/AbstractArrayJavaType.java index c0de85c7e4..5f4ecba47f 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/AbstractArrayJavaType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/AbstractArrayJavaType.java @@ -20,7 +20,6 @@ import org.hibernate.type.descriptor.converter.spi.BasicValueConverter; import org.hibernate.type.descriptor.java.spi.UnknownBasicJavaType; import org.hibernate.type.descriptor.jdbc.JdbcType; import org.hibernate.type.descriptor.jdbc.JdbcTypeIndicators; -import org.hibernate.type.internal.BasicTypeImpl; import org.hibernate.type.spi.TypeConfiguration; public abstract class AbstractArrayJavaType extends AbstractClassJavaType @@ -49,7 +48,8 @@ public abstract class AbstractArrayJavaType extends AbstractClassJavaType< // Always determine the recommended type to make sure this is a valid basic java type return indicators.getTypeConfiguration().getJdbcTypeRegistry().resolveTypeConstructorDescriptor( indicators.getPreferredSqlTypeCodeForArray(), - new BasicTypeImpl<>( componentJavaType, componentJavaType.getRecommendedJdbcType( indicators ) ), + indicators.getTypeConfiguration().getBasicTypeRegistry().resolve( + componentJavaType, componentJavaType.getRecommendedJdbcType( indicators ) ), ColumnTypeInformation.EMPTY ); } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/BasicCollectionJavaType.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/BasicCollectionJavaType.java index 70a7d653d0..31b679dfd8 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/BasicCollectionJavaType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/BasicCollectionJavaType.java @@ -40,7 +40,6 @@ import org.hibernate.type.descriptor.java.JavaType; import org.hibernate.type.descriptor.java.MutabilityPlan; import org.hibernate.type.descriptor.jdbc.JdbcType; import org.hibernate.type.descriptor.jdbc.JdbcTypeIndicators; -import org.hibernate.type.internal.BasicTypeImpl; import org.hibernate.type.spi.TypeConfiguration; /** @@ -78,7 +77,8 @@ public class BasicCollectionJavaType, E> extends Abstrac // (even though we only use this inside the if block, we want it to throw here if something wrong) return indicators.getTypeConfiguration().getJdbcTypeRegistry().resolveTypeConstructorDescriptor( indicators.getPreferredSqlTypeCodeForArray(), - new BasicTypeImpl<>( componentJavaType, componentJavaType.getRecommendedJdbcType( indicators ) ), + indicators.getTypeConfiguration().getBasicTypeRegistry().resolve( + componentJavaType, componentJavaType.getRecommendedJdbcType( indicators ) ), ColumnTypeInformation.EMPTY ); }