eliminate unnecessary dupe method call

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-06-26 10:53:27 +02:00
parent 93ec580fad
commit 1b25f8c6ea
1 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,6 @@ import org.hibernate.type.ComponentType;
import org.hibernate.type.EntityType; import org.hibernate.type.EntityType;
import org.hibernate.type.Type; import org.hibernate.type.Type;
import org.hibernate.type.descriptor.JdbcTypeNameMapper; import org.hibernate.type.descriptor.JdbcTypeNameMapper;
import org.hibernate.type.descriptor.java.JavaTypeHelper;
import org.hibernate.type.descriptor.jdbc.JdbcType; import org.hibernate.type.descriptor.jdbc.JdbcType;
import org.hibernate.type.descriptor.sql.DdlType; import org.hibernate.type.descriptor.sql.DdlType;
import org.hibernate.type.descriptor.sql.spi.DdlTypeRegistry; import org.hibernate.type.descriptor.sql.spi.DdlTypeRegistry;
@ -44,6 +43,7 @@ import static org.hibernate.internal.util.StringHelper.isEmpty;
import static org.hibernate.internal.util.StringHelper.lastIndexOfLetter; import static org.hibernate.internal.util.StringHelper.lastIndexOfLetter;
import static org.hibernate.internal.util.StringHelper.nullIfEmpty; import static org.hibernate.internal.util.StringHelper.nullIfEmpty;
import static org.hibernate.internal.util.StringHelper.safeInterning; import static org.hibernate.internal.util.StringHelper.safeInterning;
import static org.hibernate.type.descriptor.java.JavaTypeHelper.isTemporal;
/** /**
* A mapping model object representing a {@linkplain jakarta.persistence.Column column} * A mapping model object representing a {@linkplain jakarta.persistence.Column column}
@ -311,7 +311,7 @@ public class Column implements Selectable, Serializable, Cloneable, ColumnTypeIn
private String getSqlTypeName(DdlTypeRegistry ddlTypeRegistry, Dialect dialect, Mapping mapping) { private String getSqlTypeName(DdlTypeRegistry ddlTypeRegistry, Dialect dialect, Mapping mapping) {
if ( sqlTypeName == null ) { if ( sqlTypeName == null ) {
final int typeCode = getSqlTypeCode( mapping ); final int typeCode = getSqlTypeCode( mapping );
final DdlType descriptor = ddlTypeRegistry.getDescriptor( getSqlTypeCode( mapping ) ); final DdlType descriptor = ddlTypeRegistry.getDescriptor( typeCode );
if ( descriptor == null ) { if ( descriptor == null ) {
throw new MappingException( throw new MappingException(
String.format( String.format(
@ -455,7 +455,7 @@ public class Column implements Selectable, Serializable, Cloneable, ColumnTypeIn
} }
if ( type instanceof BasicType ) { if ( type instanceof BasicType ) {
final BasicType<?> basicType = (BasicType<?>) type; final BasicType<?> basicType = (BasicType<?>) type;
if ( JavaTypeHelper.isTemporal( basicType.getExpressibleJavaType() ) ) { if ( isTemporal( basicType.getExpressibleJavaType() ) ) {
precisionToUse = getTemporalPrecision(); precisionToUse = getTemporalPrecision();
lengthToUse = null; lengthToUse = null;
scaleToUse = null; scaleToUse = null;
@ -465,7 +465,7 @@ public class Column implements Selectable, Serializable, Cloneable, ColumnTypeIn
throw new AssertionFailure( "no typing information available to determine column size" ); throw new AssertionFailure( "no typing information available to determine column size" );
} }
final JdbcMapping jdbcMapping = (JdbcMapping) type; final JdbcMapping jdbcMapping = (JdbcMapping) type;
Size size = dialect.getSizeStrategy().resolveSize( final Size size = dialect.getSizeStrategy().resolveSize(
jdbcMapping.getJdbcType(), jdbcMapping.getJdbcType(),
jdbcMapping.getJdbcJavaType(), jdbcMapping.getJdbcJavaType(),
precisionToUse, precisionToUse,