diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/internal/JdbcEnvironmentImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/internal/JdbcEnvironmentImpl.java index ab55ef3d46..e19585abbc 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/internal/JdbcEnvironmentImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/internal/JdbcEnvironmentImpl.java @@ -209,6 +209,20 @@ public class JdbcEnvironmentImpl implements JdbcEnvironment { } } + /** + * @deprecated currently used by Hibernate Reactive + * This version of the constructor should handle the case in which we do actually have the option to access the DatabaseMetaData, + * but since Hibernate Reactive is currently not making use of it we take a shortcut. + */ + @Deprecated + public JdbcEnvironmentImpl( + ServiceRegistryImplementor serviceRegistry, + Dialect dialect, + DatabaseMetaData databaseMetaData + /*JdbcConnectionAccess jdbcConnectionAccess*/) throws SQLException { + this(serviceRegistry, dialect); + } + /** * The main constructor form. Builds a JdbcEnvironment using the available DatabaseMetaData * @@ -361,9 +375,4 @@ public class JdbcEnvironmentImpl implements JdbcEnvironment { return lobCreatorBuilder; } - public TypeInfo getTypeInfoForJdbcCode(int jdbcTypeCode) { - throw new UnsupportedOperationException( "Support for getting TypeInfo from jdbcTypeCode has been disabled as it wasn't used." + - " Use org.hibernate.engine.jdbc.spi.TypeInfo.extractTypeInfo as alternative, or report an issue and explain." ); - } - } diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/JdbcEnvironment.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/JdbcEnvironment.java index 3d4f79a1c8..2a9fa57f0b 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/JdbcEnvironment.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/JdbcEnvironment.java @@ -9,6 +9,7 @@ package org.hibernate.engine.jdbc.env.spi; import org.hibernate.boot.model.naming.Identifier; import org.hibernate.dialect.Dialect; import org.hibernate.engine.jdbc.spi.SqlExceptionHelper; +import org.hibernate.engine.jdbc.spi.TypeInfo; import org.hibernate.service.Service; /** @@ -88,4 +89,13 @@ public interface JdbcEnvironment extends Service { */ LobCreatorBuilder getLobCreatorBuilder(); + /** + * @deprecated This is currently not implemented an will likely be removed + * (A default method is provided to facilitate removal from implementors) + */ + @Deprecated + default TypeInfo getTypeInfoForJdbcCode(int jdbcTypeCode) { + throw new UnsupportedOperationException( "Support for getting TypeInfo from jdbcTypeCode has been disabled as it wasn't used. Use org.hibernate.engine.jdbc.spi.TypeInfo.extractTypeInfo as alternative, or report an issue and explain." ); + } + }