Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import org.hibernate.metamodel.model.domain.DomainType;
import org.hibernate.metamodel.model.domain.JpaMetamodel;
import org.hibernate.metamodel.model.domain.SingularPersistentAttribute;
import org.hibernate.metamodel.model.domain.internal.BasicTypeImpl;
import org.hibernate.metamodel.spi.MappingMetamodelImplementor;
import org.hibernate.query.BindableType;
import org.hibernate.query.ImmutableEntityUpdateQueryHandlingMode;
Expand Down Expand Up @@ -1540,7 +1539,7 @@ else if ( value == null ) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
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;
Expand All @@ -25,6 +24,7 @@
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;
Expand Down Expand Up @@ -133,7 +133,7 @@ private JdbcMapping guessBindType(ExecutionContext executionContext, Object bind
}
}

private static <E extends Enum<E>> BasicTypeImpl<E> createEnumType(ExecutionContext executionContext, Class<E> enumClass) {
private static <E extends Enum<E>> BasicType<E> createEnumType(ExecutionContext executionContext, Class<E> enumClass) {
final EnumJavaType<E> enumJavaType = new EnumJavaType<>( enumClass );
final JdbcTypeIndicators indicators =
executionContext.getSession().getTypeConfiguration().getCurrentBaseSqlTypeIndicators();
Expand All @@ -142,7 +142,7 @@ private static <E extends Enum<E>> BasicTypeImpl<E> createEnumType(ExecutionCont
// 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
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<T, E> extends AbstractClassJavaType<T>
Expand Down Expand Up @@ -47,7 +46,8 @@ public JdbcType getRecommendedJdbcType(JdbcTypeIndicators indicators) {
// 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
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
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;

/**
Expand Down Expand Up @@ -76,7 +75,8 @@ public JdbcType getRecommendedJdbcType(JdbcTypeIndicators indicators) {
// (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
);
}
Expand Down
Loading