Replace some uses of Type#getSqlTypeCodes with BasicType#getJdbcType
This commit is contained in:
parent
445cedfec7
commit
5fcacce3b1
|
@ -36,7 +36,7 @@ public class ExportableColumn extends Column {
|
|||
table,
|
||||
name,
|
||||
type,
|
||||
database.getDialect().getTypeName( type.getSqlTypeCodes( null )[0] )
|
||||
database.getDialect().getTypeName( type.getJdbcType().getDefaultSqlTypeCode() )
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -3261,7 +3261,7 @@ public abstract class AbstractEntityPersister
|
|||
.getIdentitySelectString(
|
||||
getTableName( 0 ),
|
||||
getKeyColumns( 0 )[0],
|
||||
getIdentifierType().getSqlTypeCodes( getFactory() )[0]
|
||||
( (BasicType<?>) getIdentifierType() ).getJdbcType().getDefaultSqlTypeCode()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.hibernate.type.descriptor.jdbc.TimestampJdbcType;
|
|||
* datatype is supported). Depends on the frequency of DML operations...
|
||||
*
|
||||
* @author Steve Ebersole
|
||||
* @deprecated We should replace this with a different contract to handle DB generation
|
||||
*/
|
||||
@Deprecated
|
||||
public class DbTimestampType extends AbstractSingleColumnStandardBasicType<Date> {
|
||||
|
|
|
@ -30,6 +30,7 @@ import jakarta.persistence.TemporalType;
|
|||
* Wrapper Java type descriptor for that uses the database timestamp as seed value for versions.
|
||||
*
|
||||
* @author Christian Beikov
|
||||
* @deprecated We should replace this with a different contract to handle DB generation
|
||||
*/
|
||||
@Deprecated
|
||||
public class DbTimestampJavaType<T> implements VersionJavaType<T>, TemporalJavaType<T> {
|
||||
|
|
|
@ -236,22 +236,10 @@ public class TypeConfiguration implements SessionFactoryObserver, Serializable {
|
|||
() -> basicType.getJavaTypeDescriptor()
|
||||
);
|
||||
|
||||
try {
|
||||
int[] jdbcTypes = basicType.getSqlTypeCodes( null );
|
||||
|
||||
if ( jdbcTypes.length == 1 ) {
|
||||
int jdbcType = jdbcTypes[0];
|
||||
Set<String> hibernateTypes = jdbcToHibernateTypeContributionMap.computeIfAbsent(
|
||||
jdbcType,
|
||||
k -> new HashSet<>()
|
||||
);
|
||||
hibernateTypes.add( basicType.getName() );
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.errorf( e, "Cannot register [%s] Hibernate Type contribution", basicType.getName() );
|
||||
}
|
||||
|
||||
jdbcToHibernateTypeContributionMap.computeIfAbsent(
|
||||
basicType.getJdbcType().getDefaultSqlTypeCode(),
|
||||
k -> new HashSet<>()
|
||||
).add( basicType.getName() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue