From e874a1e34ec2147ec9d8bec737bb70e87b1f0559 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Sun, 10 Aug 2025 18:44:12 +1000 Subject: [PATCH 1/2] HHH-19702 rename back to DriverManagerConnectionProvider/DataSourceConnectionProvider --- .../topical/registries/ServiceRegistries.adoc | 2 +- .../java/org/hibernate/cfg/JdbcSettings.java | 12 ++++---- .../internal/ConnectionProviderInitiator.java | 4 +-- ...java => DataSourceConnectionProvider.java} | 12 ++++---- ...a => DriverManagerConnectionProvider.java} | 10 +++---- .../jpa/PersistenceUnitInfoTests.java | 10 +++---- .../jpa/PersistenceUnitOverridesTests.java | 28 +++++++++---------- .../cache/SingleRegisteredProviderTest.java | 6 ++-- ...roviderTransactionIsolationConfigTest.java | 4 +-- ...onnectionProviderValidationConfigTest.java | 4 +-- .../TestDataSourceConnectionProvider.java | 8 +++--- .../orm/test/dialect/AnsiNullTest.java | 10 +++---- ...QLServerDialectTempTableCollationTest.java | 4 +-- .../SequenceInformationMariaDBTest.java | 6 ++-- .../PooledWithCustomNamingStrategyTest.java | 4 +-- .../jakarta/JakartaSchemaToolingTests.java | 8 +++--- .../TransactionCommitFailureTest.java | 4 +-- .../AbstractMultiTenancyTest.java | 6 ++-- .../DatabaseTimeZoneMultiTenancyTest.java | 6 ++-- .../orm/test/querycache/QueryCacheTest.java | 4 +-- .../schemaupdate/ConnectionsReleaseTest.java | 6 ++-- .../service/ServiceBootstrappingTest.java | 8 +++--- .../timezones/UTCNormalizedInstantTest.java | 6 ++-- ...allySchemaValidatorImplConnectionTest.java | 10 +++---- .../IndividuallySchemaValidatorImplTest.java | 10 +++---- .../schema/MySQLColumnValidationTest.java | 6 ++-- .../test/type/AbstractJavaTimeTypeTest.java | 6 ++-- .../env/ConnectionProviderBuilder.java | 15 +++++----- .../testing/jdbc/DataSourceStub.java | 6 ++-- ...haredDriverManagerConnectionProvider.java} | 8 +++--- ...verManagerTypeCacheClearingIntegrator.java | 2 +- .../jta/JtaAwareConnectionProviderImpl.java | 8 +++--- ...reparedStatementSpyConnectionProvider.java | 4 +-- .../orm/jdbc/TimeZoneConnectionProvider.java | 6 ++-- .../testing/util/ServiceRegistryUtil.java | 6 ++-- 35 files changed, 129 insertions(+), 130 deletions(-) rename hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/{DatasourceConnectionProviderImpl.java => DataSourceConnectionProvider.java} (94%) rename hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/{DriverManagerConnectionProviderImpl.java => DriverManagerConnectionProvider.java} (98%) rename hibernate-testing/src/main/java/org/hibernate/testing/jdbc/{SharedDriverManagerConnectionProviderImpl.java => SharedDriverManagerConnectionProvider.java} (96%) diff --git a/documentation/src/main/asciidoc/topical/registries/ServiceRegistries.adoc b/documentation/src/main/asciidoc/topical/registries/ServiceRegistries.adoc index 4f91a3274636..42150f386edc 100644 --- a/documentation/src/main/asciidoc/topical/registries/ServiceRegistries.adoc +++ b/documentation/src/main/asciidoc/topical/registries/ServiceRegistries.adoc @@ -28,7 +28,7 @@ service is defined by the interface (service role) +org.hibernate.engine.jdbc.co which declares methods for obtaining and releasing the Connections. There are then multiple implementations of that service contract, varying in how they actually manage the Connections: -* +org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl+ for using a +javax.sql.DataSource+ +* +org.hibernate.engine.jdbc.connections.internal.DataSourceConnectionProvider+ for using a +javax.sql.DataSource+ * +org.hibernate.c3p0.internal.C3P0ConnectionProvider+ for using a C3P0 Connection pool * etc. diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/JdbcSettings.java b/hibernate-core/src/main/java/org/hibernate/cfg/JdbcSettings.java index 12b686ccf47d..4c59d442ecd6 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/JdbcSettings.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/JdbcSettings.java @@ -246,12 +246,12 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett * automatically: * *

@@ -266,7 +266,7 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett * Specifies the maximum number of inactive connections for any * {@linkplain ConnectionProvider connection pool} which respects this * setting, including every built-in implementation except for - * {@link org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl}. + * {@link org.hibernate.engine.jdbc.connections.internal.DataSourceConnectionProvider}. *

* The default pool size depends on the connection provider. */ @@ -276,7 +276,7 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett * Specifies the JDBC transaction isolation level for connections obtained * from any {@link ConnectionProvider} implementation which respects this * setting, including every built-in implementation except for - * {@link org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl}. + * {@link org.hibernate.engine.jdbc.connections.internal.DataSourceConnectionProvider}. *

* Possible values are enumerated by {@link java.sql.Connection}: * {@code READ_UNCOMMITTED}, {@code READ_COMMITTED}, @@ -293,7 +293,7 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett * Controls the autocommit mode of JDBC connections obtained from any * {@link ConnectionProvider} implementation which respects this setting, * including every built-in implementation except for - * {@link org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl}. + * {@link org.hibernate.engine.jdbc.connections.internal.DataSourceConnectionProvider}. * * @see java.sql.Connection#setAutoCommit(boolean) * @@ -329,7 +329,7 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett * append {@code foo=bar} to the JDBC connection URL. * * @deprecated This setting is only supported by {@code C3P0ConnectionProvider} - * and {@link org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl}. + * and {@link org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider}. */ @Deprecated(since="7") String CONNECTION_PREFIX = "hibernate.connection"; diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/ConnectionProviderInitiator.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/ConnectionProviderInitiator.java index aa7b879477ea..4d9fb06c5fbd 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/ConnectionProviderInitiator.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/ConnectionProviderInitiator.java @@ -140,7 +140,7 @@ private ConnectionProvider instantiateNamedConnectionProvider( private ConnectionProvider instantiateConnectionProvider( Map configurationValues, StrategySelector strategySelector, BeanContainer beanContainer) { if ( configurationValues.containsKey( DATASOURCE ) ) { - return new DatasourceConnectionProviderImpl(); + return new DataSourceConnectionProvider(); } final Class singleRegisteredProvider = @@ -163,7 +163,7 @@ else if ( hasConfiguration( configurationValues, AGROAL_CONFIG_PREFIX ) ) { return instantiateProvider( strategySelector, AGROAL_STRATEGY ); } else if ( configurationValues.containsKey( URL ) ) { - return new DriverManagerConnectionProviderImpl(); + return new DriverManagerConnectionProvider(); } else { if ( beanContainer != null ) { diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DatasourceConnectionProviderImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DataSourceConnectionProvider.java similarity index 94% rename from hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DatasourceConnectionProviderImpl.java rename to hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DataSourceConnectionProvider.java index 6877fa533e94..f9f27ad5e9ef 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DatasourceConnectionProviderImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DataSourceConnectionProvider.java @@ -40,7 +40,7 @@ * @author Gavin King * @author Steve Ebersole */ -public class DatasourceConnectionProviderImpl +public class DataSourceConnectionProvider implements ConnectionProvider, Configurable, Stoppable { private DataSource dataSource; @@ -68,14 +68,14 @@ public void setJndiService(JndiService jndiService) { @Override public boolean isUnwrappableAs(Class unwrapType) { - return unwrapType.isAssignableFrom( DatasourceConnectionProviderImpl.class ) + return unwrapType.isAssignableFrom( DataSourceConnectionProvider.class ) || unwrapType.isAssignableFrom( DataSource.class); } @Override @SuppressWarnings("unchecked") public T unwrap(Class unwrapType) { - if ( unwrapType.isAssignableFrom( DatasourceConnectionProviderImpl.class ) ) { + if ( unwrapType.isAssignableFrom( DataSourceConnectionProvider.class ) ) { return (T) this; } else if ( unwrapType.isAssignableFrom( DataSource.class) ) { @@ -111,11 +111,11 @@ else if ( dataSourceSetting instanceof String jndiName ) { if ( configuration.containsKey( JdbcSettings.AUTOCOMMIT ) ) { ConnectionInfoLogger.INSTANCE.ignoredSetting( JdbcSettings.AUTOCOMMIT, - DatasourceConnectionProviderImpl.class ); + DataSourceConnectionProvider.class ); } if ( configuration.containsKey( JdbcSettings.ISOLATION ) ) { ConnectionInfoLogger.INSTANCE.ignoredSetting( JdbcSettings.ISOLATION, - DatasourceConnectionProviderImpl.class ); + DataSourceConnectionProvider.class ); } user = (String) configuration.get( JdbcSettings.USER ); @@ -156,7 +156,7 @@ public DatabaseConnectionInfo getDatabaseConnectionInfo(Dialect dialect) { @Override public DatabaseConnectionInfo getDatabaseConnectionInfo(Dialect dialect, ExtractedDatabaseMetaData metaData) { return new DatabaseConnectionInfoImpl( - DatasourceConnectionProviderImpl.class, + DataSourceConnectionProvider.class, metaData == null ? null : metaData.getUrl(), metaData == null ? null : metaData.getDriver(), dialect.getClass(), diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProviderImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProvider.java similarity index 98% rename from hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProviderImpl.java rename to hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProvider.java index 2450ccecf331..168e78865dae 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProviderImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProvider.java @@ -57,7 +57,7 @@ * @author Gavin King * @author Steve Ebersole */ -public class DriverManagerConnectionProviderImpl +public class DriverManagerConnectionProvider implements ConnectionProvider, Configurable, Stoppable, ServiceRegistryAwareService, ConnectionValidator { public static final String MIN_SIZE = "hibernate.connection.min_pool_size"; @@ -123,7 +123,7 @@ private PooledConnections buildPool(Map configuration, ServiceReg try ( var connection = connectionCreator.createConnection() ) { dbInfo = new DatabaseConnectionInfoImpl( - DriverManagerConnectionProviderImpl.class, + DriverManagerConnectionProvider.class, url, getDriverName( connection ), null, @@ -299,7 +299,7 @@ public boolean supportsAggressiveRelease() { @Override public DatabaseConnectionInfo getDatabaseConnectionInfo(Dialect dialect) { return new DatabaseConnectionInfoImpl( - DriverManagerConnectionProviderImpl.class, + DriverManagerConnectionProvider.class, dbInfo.getJdbcUrl(), dbInfo.getJdbcDriver(), dialect.getClass(), @@ -318,13 +318,13 @@ public DatabaseConnectionInfo getDatabaseConnectionInfo(Dialect dialect) { @Override public boolean isUnwrappableAs(Class unwrapType) { - return unwrapType.isAssignableFrom( DriverManagerConnectionProviderImpl.class ); + return unwrapType.isAssignableFrom( DriverManagerConnectionProvider.class ); } @Override @SuppressWarnings( {"unchecked"}) public T unwrap(Class unwrapType) { - if ( unwrapType.isAssignableFrom( DriverManagerConnectionProviderImpl.class ) ) { + if ( unwrapType.isAssignableFrom( DriverManagerConnectionProvider.class ) ) { return (T) this; } else { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/jpa/PersistenceUnitInfoTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/jpa/PersistenceUnitInfoTests.java index 5f206c4695ef..4d1133b43ac2 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/jpa/PersistenceUnitInfoTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/jpa/PersistenceUnitInfoTests.java @@ -12,7 +12,7 @@ import org.hibernate.cfg.AvailableSettings; import org.hibernate.dialect.H2Dialect; -import org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DataSourceConnectionProvider; import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.jpa.HibernatePersistenceProvider; @@ -58,8 +58,8 @@ public DataSource getNonJtaDataSource() { final ConnectionProvider connectionProvider = emf.unwrap( SessionFactoryImplementor.class ) .getServiceRegistry() .getService( ConnectionProvider.class ); - assertThat( connectionProvider, instanceOf( DatasourceConnectionProviderImpl.class ) ); - final DatasourceConnectionProviderImpl dsCp = (DatasourceConnectionProviderImpl) connectionProvider; + assertThat( connectionProvider, instanceOf( DataSourceConnectionProvider.class ) ); + final DataSourceConnectionProvider dsCp = (DataSourceConnectionProvider) connectionProvider; assertThat( dsCp.getDataSource(), is( puDataSource ) ); // now let's check that it is exposed via the EMF properties @@ -92,8 +92,8 @@ public DataSource getJtaDataSource() { final ConnectionProvider connectionProvider = emf.unwrap( SessionFactoryImplementor.class ) .getServiceRegistry() .getService( ConnectionProvider.class ); - assertThat( connectionProvider, instanceOf( DatasourceConnectionProviderImpl.class ) ); - final DatasourceConnectionProviderImpl dsCp = (DatasourceConnectionProviderImpl) connectionProvider; + assertThat( connectionProvider, instanceOf( DataSourceConnectionProvider.class ) ); + final DataSourceConnectionProvider dsCp = (DataSourceConnectionProvider) connectionProvider; assertThat( dsCp.getDataSource(), is( puDataSource ) ); // now let's check that it is exposed via the EMF properties diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/jpa/PersistenceUnitOverridesTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/jpa/PersistenceUnitOverridesTests.java index 904404f3bce1..00abd23f5ae4 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/jpa/PersistenceUnitOverridesTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/jpa/PersistenceUnitOverridesTests.java @@ -16,8 +16,8 @@ import org.hibernate.dialect.Dialect; import org.hibernate.dialect.H2Dialect; import org.hibernate.dialect.SimpleDatabaseVersion; -import org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DataSourceConnectionProvider; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.jpa.HibernatePersistenceProvider; @@ -106,8 +106,8 @@ public void testPassingIntegrationJtaDataSourceOverrideForJpaJdbcSettings() { final ConnectionProvider connectionProvider = emf.unwrap( SessionFactoryImplementor.class ) .getServiceRegistry() .getService( ConnectionProvider.class ); - assertThat( connectionProvider, instanceOf( DatasourceConnectionProviderImpl.class ) ); - final DatasourceConnectionProviderImpl dsCp = (DatasourceConnectionProviderImpl) connectionProvider; + assertThat( connectionProvider, instanceOf( DataSourceConnectionProvider.class ) ); + final DataSourceConnectionProvider dsCp = (DataSourceConnectionProvider) connectionProvider; assertThat( dsCp.getDataSource(), is( integrationDataSource ) ); // now let's check that it is exposed via the EMF properties @@ -190,7 +190,7 @@ public Properties getProperties() { final ConnectionProvider connectionProvider = emf.unwrap( SessionFactoryImplementor.class ) .getServiceRegistry() .getService( ConnectionProvider.class ); - assertThat( connectionProvider, instanceOf( DriverManagerConnectionProviderImpl.class ) ); + assertThat( connectionProvider, instanceOf( DriverManagerConnectionProvider.class ) ); } finally { emf.close(); @@ -243,7 +243,7 @@ public DataSource getJtaDataSource() { final ConnectionProvider connectionProvider = emf.unwrap( SessionFactoryImplementor.class ) .getServiceRegistry() .getService( ConnectionProvider.class ); - assertThat( connectionProvider, instanceOf( DriverManagerConnectionProviderImpl.class ) ); + assertThat( connectionProvider, instanceOf( DriverManagerConnectionProvider.class ) ); } finally { emf.close(); @@ -298,9 +298,9 @@ public DataSource getJtaDataSource() { final ConnectionProvider connectionProvider = emf.unwrap( SessionFactoryImplementor.class ) .getServiceRegistry() .getService( ConnectionProvider.class ); - assertThat( connectionProvider, instanceOf( DatasourceConnectionProviderImpl.class ) ); + assertThat( connectionProvider, instanceOf( DataSourceConnectionProvider.class ) ); - final DatasourceConnectionProviderImpl datasourceConnectionProvider = (DatasourceConnectionProviderImpl) connectionProvider; + final DataSourceConnectionProvider datasourceConnectionProvider = (DataSourceConnectionProvider) connectionProvider; assertThat( datasourceConnectionProvider.getDataSource(), is( integrationDataSource ) ); } finally { @@ -345,9 +345,9 @@ public DataSource getNonJtaDataSource() { final SessionFactoryImplementor sessionFactory = emf.unwrap( SessionFactoryImplementor.class ); final ConnectionProvider connectionProvider = sessionFactory.getServiceRegistry().getService( ConnectionProvider.class ); - assertThat( connectionProvider, instanceOf( DatasourceConnectionProviderImpl.class ) ); + assertThat( connectionProvider, instanceOf( DataSourceConnectionProvider.class ) ); - final DatasourceConnectionProviderImpl dsProvider = (DatasourceConnectionProviderImpl) connectionProvider; + final DataSourceConnectionProvider dsProvider = (DataSourceConnectionProvider) connectionProvider; assertThat( dsProvider.getDataSource(), is( override ) ); } finally { @@ -374,7 +374,7 @@ public DataSource getNonJtaDataSource() { integrationSettings.put( AvailableSettings.JPA_JDBC_URL, ConnectionProviderBuilder.URL ); integrationSettings.put( AvailableSettings.JPA_JDBC_USER, ConnectionProviderBuilder.USER ); integrationSettings.put( AvailableSettings.JPA_JDBC_PASSWORD, ConnectionProviderBuilder.PASS ); - integrationSettings.put( DriverManagerConnectionProviderImpl.INIT_SQL, "" ); + integrationSettings.put( DriverManagerConnectionProvider.INIT_SQL, "" ); final PersistenceProvider provider = new HibernatePersistenceProvider(); @@ -387,7 +387,7 @@ public DataSource getNonJtaDataSource() { final SessionFactoryImplementor sessionFactory = emf.unwrap( SessionFactoryImplementor.class ); final ConnectionProvider connectionProvider = sessionFactory.getServiceRegistry().getService( ConnectionProvider.class ); - assertThat( connectionProvider, instanceOf( DriverManagerConnectionProviderImpl.class ) ); + assertThat( connectionProvider, instanceOf( DriverManagerConnectionProvider.class ) ); } finally { emf.close(); @@ -413,7 +413,7 @@ public DataSource getNonJtaDataSource() { integrationSettings.put( AvailableSettings.JAKARTA_JDBC_URL, ConnectionProviderBuilder.URL ); integrationSettings.put( AvailableSettings.JAKARTA_JDBC_USER, ConnectionProviderBuilder.USER ); integrationSettings.put( AvailableSettings.JAKARTA_JDBC_PASSWORD, ConnectionProviderBuilder.PASS ); - integrationSettings.put( DriverManagerConnectionProviderImpl.INIT_SQL, "" ); + integrationSettings.put( DriverManagerConnectionProvider.INIT_SQL, "" ); final PersistenceProvider provider = new HibernatePersistenceProvider(); @@ -426,7 +426,7 @@ public DataSource getNonJtaDataSource() { final SessionFactoryImplementor sessionFactory = emf.unwrap( SessionFactoryImplementor.class ); final ConnectionProvider connectionProvider = sessionFactory.getServiceRegistry().getService( ConnectionProvider.class ); - assertThat( connectionProvider, instanceOf( DriverManagerConnectionProviderImpl.class ) ); + assertThat( connectionProvider, instanceOf( DriverManagerConnectionProvider.class ) ); } finally { emf.close(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cache/SingleRegisteredProviderTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cache/SingleRegisteredProviderTest.java index 1657b083db24..bea4b7d4f332 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cache/SingleRegisteredProviderTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cache/SingleRegisteredProviderTest.java @@ -13,7 +13,7 @@ import org.hibernate.cache.internal.NoCachingRegionFactory; import org.hibernate.cache.spi.RegionFactory; import org.hibernate.cfg.AvailableSettings; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; import org.hibernate.testing.junit4.BaseUnitTestCase; @@ -91,14 +91,14 @@ public void testConnectionsRegistered() { bsr.getService( StrategySelector.class ).registerStrategyImplementor( ConnectionProvider.class, "testing", - DriverManagerConnectionProviderImpl.class + DriverManagerConnectionProvider.class ); final StandardServiceRegistry ssr = ServiceRegistryUtil.serviceRegistryBuilder( bsr ).build(); final ConnectionProvider configuredProvider = ssr.getService( ConnectionProvider.class ); - assertThat( configuredProvider, instanceOf( DriverManagerConnectionProviderImpl.class ) ); + assertThat( configuredProvider, instanceOf( DriverManagerConnectionProvider.class ) ); } } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/connection/DriverManagerConnectionProviderTransactionIsolationConfigTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connection/DriverManagerConnectionProviderTransactionIsolationConfigTest.java index 99f4b7198225..2526bf217593 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/connection/DriverManagerConnectionProviderTransactionIsolationConfigTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connection/DriverManagerConnectionProviderTransactionIsolationConfigTest.java @@ -4,7 +4,7 @@ */ package org.hibernate.orm.test.connection; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; import org.hibernate.testing.common.connections.BaseTransactionIsolationConfigTest; @@ -21,6 +21,6 @@ public class DriverManagerConnectionProviderTransactionIsolationConfigTest extends BaseTransactionIsolationConfigTest { @Override protected ConnectionProvider getConnectionProviderUnderTest() { - return new DriverManagerConnectionProviderImpl(); + return new DriverManagerConnectionProvider(); } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/connection/DriverManagerConnectionProviderValidationConfigTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connection/DriverManagerConnectionProviderValidationConfigTest.java index 89a3c393ce54..df8d7b4d8db5 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/connection/DriverManagerConnectionProviderValidationConfigTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connection/DriverManagerConnectionProviderValidationConfigTest.java @@ -9,7 +9,7 @@ import jakarta.persistence.Id; import org.hibernate.cfg.AvailableSettings; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.testing.orm.junit.EntityManagerFactoryScope; import org.hibernate.testing.orm.junit.Jpa; @@ -27,7 +27,7 @@ integrationSettings = { // Force a non-shared connection provider to avoid re-creation of the shared pool @Setting(name = AvailableSettings.CONNECTION_PROVIDER, value = ""), - @Setting(name = DriverManagerConnectionProviderImpl.VALIDATION_INTERVAL, value = "1") + @Setting(name = DriverManagerConnectionProvider.VALIDATION_INTERVAL, value = "1") } ) public class DriverManagerConnectionProviderValidationConfigTest { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/datasource/TestDataSourceConnectionProvider.java b/hibernate-core/src/test/java/org/hibernate/orm/test/datasource/TestDataSourceConnectionProvider.java index e28d11f7ab47..31c4c59db798 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/datasource/TestDataSourceConnectionProvider.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/datasource/TestDataSourceConnectionProvider.java @@ -4,8 +4,8 @@ */ package org.hibernate.orm.test.datasource; -import org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DataSourceConnectionProvider; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.service.spi.ServiceRegistryAwareService; import org.hibernate.service.spi.ServiceRegistryImplementor; @@ -19,10 +19,10 @@ @SuppressWarnings( "unused" ) // used by DatasourceTest in this package public class TestDataSourceConnectionProvider - extends DatasourceConnectionProviderImpl + extends DataSourceConnectionProvider implements ServiceRegistryAwareService { - final DriverManagerConnectionProviderImpl delegate = new DriverManagerConnectionProviderImpl(); + final DriverManagerConnectionProvider delegate = new DriverManagerConnectionProvider(); @Override public void configure(Map configuration) { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/AnsiNullTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/AnsiNullTest.java index 050dff360e5a..92e03dbb2f7b 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/AnsiNullTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/AnsiNullTest.java @@ -7,7 +7,7 @@ import jakarta.persistence.Entity; import jakarta.persistence.Id; import org.hibernate.dialect.SybaseASEDialect; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.orm.test.length.WithLongStrings; import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.Jira; @@ -65,7 +65,7 @@ void tearDown(SessionFactoryScope scope) { @RequiresDialect(value = SybaseASEDialect.class) @DomainModel(annotatedClasses = { AnsiNullTest.Book.class, WithLongStrings.class }) @SessionFactory - @ServiceRegistry( settings = {@Setting(name = DriverManagerConnectionProviderImpl.INIT_SQL, value = "set ansinull on")} ) + @ServiceRegistry( settings = {@Setting(name = DriverManagerConnectionProvider.INIT_SQL, value = "set ansinull on")} ) public void testWithAnsiNullOn(SessionFactoryScope scope) { scope.inTransaction( session -> { @@ -109,7 +109,7 @@ public void testWithAnsiNullOn(SessionFactoryScope scope) { @RequiresDialect(value = SybaseASEDialect.class) @DomainModel(annotatedClasses = { AnsiNullTest.Book.class, WithLongStrings.class }) @SessionFactory - @ServiceRegistry( settings = {@Setting(name = DriverManagerConnectionProviderImpl.INIT_SQL, value = "set ansinull on")} ) + @ServiceRegistry( settings = {@Setting(name = DriverManagerConnectionProvider.INIT_SQL, value = "set ansinull on")} ) public void testLOBWithAnsiNullOn(SessionFactoryScope scope) { scope.inTransaction( session -> { @@ -152,7 +152,7 @@ public void testLOBWithAnsiNullOn(SessionFactoryScope scope) { @RequiresDialect(value = SybaseASEDialect.class) @DomainModel(annotatedClasses = { AnsiNullTest.Book.class, WithLongStrings.class }) @SessionFactory - @ServiceRegistry( settings = {@Setting(name = DriverManagerConnectionProviderImpl.INIT_SQL, value = "set ansinull off")} ) + @ServiceRegistry( settings = {@Setting(name = DriverManagerConnectionProvider.INIT_SQL, value = "set ansinull off")} ) public void testWithAnsiNullOff(SessionFactoryScope scope) { scope.inTransaction( session -> { @@ -195,7 +195,7 @@ public void testWithAnsiNullOff(SessionFactoryScope scope) { @RequiresDialect(value = SybaseASEDialect.class) @DomainModel(annotatedClasses = { AnsiNullTest.Book.class, WithLongStrings.class }) @SessionFactory - @ServiceRegistry( settings = {@Setting(name = DriverManagerConnectionProviderImpl.INIT_SQL, value = "set ansinull off")} ) + @ServiceRegistry( settings = {@Setting(name = DriverManagerConnectionProvider.INIT_SQL, value = "set ansinull off")} ) public void testLOBWithAnsiNullOff(SessionFactoryScope scope) { scope.inTransaction( session -> { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/SQLServerDialectTempTableCollationTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/SQLServerDialectTempTableCollationTest.java index e66b2b20d251..a351e0d007e7 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/SQLServerDialectTempTableCollationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/SQLServerDialectTempTableCollationTest.java @@ -21,7 +21,7 @@ import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.orm.junit.JiraKey; -import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProviderImpl; +import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProvider; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.transaction.TransactionUtil; import org.junit.Assert; @@ -83,7 +83,7 @@ protected void releaseSessionFactory() { } } // The alter database calls could lead to issues with existing connections, so we reset the shared pool here - SharedDriverManagerConnectionProviderImpl.getInstance().reset(); + SharedDriverManagerConnectionProvider.getInstance().reset(); } @Override diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/SequenceInformationMariaDBTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/SequenceInformationMariaDBTest.java index a4db1dca655c..7a6f4ae7b712 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/SequenceInformationMariaDBTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/SequenceInformationMariaDBTest.java @@ -18,7 +18,7 @@ import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Environment; import org.hibernate.dialect.MariaDBDialect; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.internal.util.PropertiesHelper; import org.hibernate.testing.orm.junit.JiraKey; import org.hibernate.testing.orm.junit.EntityManagerFactoryScope; @@ -48,11 +48,11 @@ ) public class SequenceInformationMariaDBTest { - private DriverManagerConnectionProviderImpl connectionProvider; + private DriverManagerConnectionProvider connectionProvider; @BeforeAll public void init() { - connectionProvider = new DriverManagerConnectionProviderImpl(); + connectionProvider = new DriverManagerConnectionProvider(); connectionProvider.configure( PropertiesHelper.map( Environment.getProperties() ) ); try(Connection connection = connectionProvider.getConnection(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/id/sequence/PooledWithCustomNamingStrategyTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/id/sequence/PooledWithCustomNamingStrategyTest.java index 9fbc0a918c98..c9ecf985863b 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/id/sequence/PooledWithCustomNamingStrategyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/id/sequence/PooledWithCustomNamingStrategyTest.java @@ -17,7 +17,7 @@ import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Environment; import org.hibernate.dialect.H2Dialect; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment; import org.hibernate.engine.spi.SessionFactoryImplementor; @@ -91,7 +91,7 @@ public void testRightIncrementSize() { @BeforeAll public void setUp() { - final DriverManagerConnectionProviderImpl provider = new DriverManagerConnectionProviderImpl(); + final DriverManagerConnectionProvider provider = new DriverManagerConnectionProvider(); provider.configure( PropertiesHelper.map( Environment.getProperties() ) ); connectionProvider = provider; try (final Connection connection = connectionProvider.getConnection(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/jakarta/JakartaSchemaToolingTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/jakarta/JakartaSchemaToolingTests.java index 6d0fa83c5699..d3c64b8f8f41 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/jakarta/JakartaSchemaToolingTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/jakarta/JakartaSchemaToolingTests.java @@ -11,7 +11,7 @@ import org.hibernate.SessionFactoryObserver; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Environment; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.jpa.boot.spi.Bootstrap; import org.hibernate.jpa.boot.spi.EntityManagerFactoryBuilder; @@ -147,10 +147,10 @@ private SessionFactoryImplementor buildSessionFactory(Object... settingPairs) { final Properties settings = new Properties(); settings.setProperty( AvailableSettings.AUTOCOMMIT, "false" ); settings.setProperty( AvailableSettings.POOL_SIZE, "5" ); - settings.setProperty( DriverManagerConnectionProviderImpl.INITIAL_SIZE, "0" ); + settings.setProperty( DriverManagerConnectionProvider.INITIAL_SIZE, "0" ); settings.setProperty( - DriverManagerConnectionProviderImpl.INIT_SQL, - Environment.getProperties().getProperty( DriverManagerConnectionProviderImpl.INIT_SQL ) + DriverManagerConnectionProvider.INIT_SQL, + Environment.getProperties().getProperty( DriverManagerConnectionProvider.INIT_SQL ) ); applyToProperties( settings, settingPairs ); ServiceRegistryUtil.applySettings( settings ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/transaction/TransactionCommitFailureTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/transaction/TransactionCommitFailureTest.java index 810c35d1a8eb..d52f72ab2925 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/transaction/TransactionCommitFailureTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/transaction/TransactionCommitFailureTest.java @@ -19,7 +19,7 @@ import org.hibernate.jpa.boot.spi.Bootstrap; import org.hibernate.testing.jdbc.ConnectionProviderDelegate; -import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProviderImpl; +import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProvider; import org.hibernate.testing.orm.jpa.PersistenceUnitDescriptorAdapter; import org.hibernate.orm.test.jpa.SettingsGenerator; @@ -123,7 +123,7 @@ private Map basicSettings() { public static class ProxyConnectionProvider extends ConnectionProviderDelegate { public ProxyConnectionProvider() { - setConnectionProvider( SharedDriverManagerConnectionProviderImpl.getInstance() ); + setConnectionProvider( SharedDriverManagerConnectionProvider.getInstance() ); } @Override diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/multitenancy/AbstractMultiTenancyTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/multitenancy/AbstractMultiTenancyTest.java index 5c3986492951..1734e80f4660 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/multitenancy/AbstractMultiTenancyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/multitenancy/AbstractMultiTenancyTest.java @@ -23,7 +23,7 @@ import org.hibernate.boot.SessionFactoryBuilder; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Environment; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; import org.hibernate.internal.util.PropertiesHelper; import org.hibernate.query.Query; @@ -102,8 +102,8 @@ protected void registerConnectionProvider(String tenantIdentifier) { properties.put(Environment.URL, tenantUrl(properties.getProperty(Environment.URL), tenantIdentifier)); - DriverManagerConnectionProviderImpl connectionProvider = - new DriverManagerConnectionProviderImpl(); + DriverManagerConnectionProvider connectionProvider = + new DriverManagerConnectionProvider(); connectionProvider.configure( PropertiesHelper.map(properties) ); connectionProviderMap.put(tenantIdentifier, connectionProvider); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/multitenancy/DatabaseTimeZoneMultiTenancyTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/multitenancy/DatabaseTimeZoneMultiTenancyTest.java index 79c8db9e9905..4ecf1303b11f 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/multitenancy/DatabaseTimeZoneMultiTenancyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/multitenancy/DatabaseTimeZoneMultiTenancyTest.java @@ -29,7 +29,7 @@ import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Environment; import org.hibernate.dialect.H2Dialect; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; import org.hibernate.internal.util.PropertiesHelper; import org.hibernate.service.spi.ServiceRegistryImplementor; @@ -104,8 +104,8 @@ protected void registerConnectionProvider(String tenantIdentifier, TimeZone time tenantUrl( properties.getProperty(Environment.URL), tenantIdentifier ) ); - DriverManagerConnectionProviderImpl connectionProvider = - new DriverManagerConnectionProviderImpl(); + DriverManagerConnectionProvider connectionProvider = + new DriverManagerConnectionProvider(); connectionProvider.configure( PropertiesHelper.map(properties) ); connectionProviderMap.put(tenantIdentifier, connectionProvider); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/querycache/QueryCacheTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/querycache/QueryCacheTest.java index a4dc2ab2364b..0e201ca828de 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/querycache/QueryCacheTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/querycache/QueryCacheTest.java @@ -28,7 +28,7 @@ import org.hibernate.type.Type; import org.hibernate.testing.jdbc.ConnectionProviderDelegate; -import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProviderImpl; +import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProvider; import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.JiraKey; import org.hibernate.testing.orm.junit.ServiceRegistry; @@ -805,7 +805,7 @@ public static class ProxyConnectionProvider extends ConnectionProviderDelegate { private static final ThreadLocal CONNECTION_RETRIEVAL_EXCEPTION_TO_THROW = new ThreadLocal<>(); public ProxyConnectionProvider() { - setConnectionProvider( SharedDriverManagerConnectionProviderImpl.getInstance() ); + setConnectionProvider( SharedDriverManagerConnectionProvider.getInstance() ); } static void runWithConnectionRetrievalFailure(SQLException exceptionToThrow, Runnable runnable) { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/schemaupdate/ConnectionsReleaseTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/schemaupdate/ConnectionsReleaseTest.java index f0b1747ee795..3fbde03955f2 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/schemaupdate/ConnectionsReleaseTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/schemaupdate/ConnectionsReleaseTest.java @@ -20,7 +20,7 @@ import org.hibernate.tool.schema.TargetType; import org.hibernate.testing.orm.junit.JiraKey; -import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProviderImpl; +import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProvider; import org.hibernate.testing.junit4.BaseUnitTestCase; import org.hibernate.testing.orm.junit.RequiresDialect; import org.hibernate.testing.util.ServiceRegistryUtil; @@ -40,11 +40,11 @@ public class ConnectionsReleaseTest extends BaseUnitTestCase { private StandardServiceRegistry ssr; private MetadataImplementor metadata; - private SharedDriverManagerConnectionProviderImpl connectionProvider; + private SharedDriverManagerConnectionProvider connectionProvider; @Before public void setUp() { - connectionProvider = SharedDriverManagerConnectionProviderImpl.getInstance(); + connectionProvider = SharedDriverManagerConnectionProvider.getInstance(); ssr = ServiceRegistryUtil.serviceRegistryBuilder() .addService( ConnectionProvider.class, connectionProvider ) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/service/ServiceBootstrappingTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/service/ServiceBootstrappingTest.java index 7f0a8ae19695..693140742dc0 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/service/ServiceBootstrappingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/service/ServiceBootstrappingTest.java @@ -10,7 +10,7 @@ import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl; import org.hibernate.cfg.Environment; import org.hibernate.dialect.H2Dialect; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.engine.jdbc.connections.internal.UserSuppliedConnectionProviderImpl; import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; import org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.ConnectionProviderJdbcConnectionAccess; @@ -50,7 +50,7 @@ public void testBasicBuild() throws Exception{ ConnectionProviderJdbcConnectionAccess.class, jdbcServices.getBootstrapJdbcConnectionAccess() ); - assertTrue( connectionAccess.getConnectionProvider().isUnwrappableAs( DriverManagerConnectionProviderImpl.class ) ); + assertTrue( connectionAccess.getConnectionProvider().isUnwrappableAs( DriverManagerConnectionProvider.class ) ); assertFalse( jdbcServices.getSqlStatementLogger().isLogToStdout() ); } finally { @@ -74,7 +74,7 @@ public void testBuildWithLogging() { ConnectionProviderJdbcConnectionAccess.class, jdbcServices.getBootstrapJdbcConnectionAccess() ); - assertTrue( connectionAccess.getConnectionProvider().isUnwrappableAs( DriverManagerConnectionProviderImpl.class ) ); + assertTrue( connectionAccess.getConnectionProvider().isUnwrappableAs( DriverManagerConnectionProvider.class ) ); assertTrue( jdbcServices.getSqlStatementLogger().isLogToStdout() ); } finally { @@ -93,7 +93,7 @@ public void testBuildWithServiceOverride() { ConnectionProviderJdbcConnectionAccess.class, jdbcServices.getBootstrapJdbcConnectionAccess() ); - assertTrue( connectionAccess.getConnectionProvider().isUnwrappableAs( DriverManagerConnectionProviderImpl.class ) ); + assertTrue( connectionAccess.getConnectionProvider().isUnwrappableAs( DriverManagerConnectionProvider.class ) ); } finally { serviceRegistry.destroy(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/timezones/UTCNormalizedInstantTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/timezones/UTCNormalizedInstantTest.java index 1b1141031781..78f1129bb945 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/timezones/UTCNormalizedInstantTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/timezones/UTCNormalizedInstantTest.java @@ -16,7 +16,7 @@ import org.hibernate.testing.orm.junit.SkipForDialect; import org.hibernate.type.descriptor.DateTimeUtils; -import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProviderImpl; +import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProvider; import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryScope; @@ -71,7 +71,7 @@ else if ( dialect.getDefaultTimestampPrecision() == 6 ) { @Test void testWithSystemTimeZone(SessionFactoryScope scope) { final TimeZone timeZoneBefore = TimeZone.getDefault(); TimeZone.setDefault( TimeZone.getTimeZone( "CET" ) ); - SharedDriverManagerConnectionProviderImpl.getInstance().onDefaultTimeZoneChange(); + SharedDriverManagerConnectionProvider.getInstance().onDefaultTimeZoneChange(); try { final Instant instant; final Dialect dialect = scope.getSessionFactory().getJdbcServices().getDialect(); @@ -109,7 +109,7 @@ else if ( dialect.getDefaultTimestampPrecision() == 6 ) { } finally { TimeZone.setDefault( timeZoneBefore ); - SharedDriverManagerConnectionProviderImpl.getInstance().onDefaultTimeZoneChange(); + SharedDriverManagerConnectionProvider.getInstance().onDefaultTimeZoneChange(); } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/IndividuallySchemaValidatorImplConnectionTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/IndividuallySchemaValidatorImplConnectionTest.java index dcfb39e19fe0..95f389cd3198 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/IndividuallySchemaValidatorImplConnectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/IndividuallySchemaValidatorImplConnectionTest.java @@ -24,7 +24,7 @@ import org.hibernate.cfg.AvailableSettings; import org.hibernate.dialect.H2Dialect; import org.hibernate.engine.config.spi.ConfigurationService; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.internal.CoreMessageLogger; import org.hibernate.internal.util.PropertiesHelper; import org.hibernate.service.spi.ServiceRegistryImplementor; @@ -77,14 +77,14 @@ public class IndividuallySchemaValidatorImplConnectionTest extends BaseUnitTestC private ExecutionOptions executionOptions; - private DriverManagerConnectionProviderImpl connectionProvider; + private DriverManagerConnectionProvider connectionProvider; private Connection connection; @Before public void setUp() throws Exception { connectionProvider = - new DriverManagerConnectionProviderImpl(); + new DriverManagerConnectionProvider(); connectionProvider.configure( PropertiesHelper.map( properties() ) ); connection = connectionProvider.getConnection(); @@ -142,8 +142,8 @@ public void testMissingEntityContainsUnqualifiedEntityName() throws Exception { .applySettings( settings ) .build(); - DriverManagerConnectionProviderImpl connectionProvider = - new DriverManagerConnectionProviderImpl(); + DriverManagerConnectionProvider connectionProvider = + new DriverManagerConnectionProvider(); connectionProvider.configure( PropertiesHelper.map( properties() ) ); final GenerationTargetToDatabase schemaGenerator = new GenerationTargetToDatabase( diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/IndividuallySchemaValidatorImplTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/IndividuallySchemaValidatorImplTest.java index 58f14a0f7d31..e1b09937cb7c 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/IndividuallySchemaValidatorImplTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/IndividuallySchemaValidatorImplTest.java @@ -21,7 +21,7 @@ import org.hibernate.boot.spi.MetadataImplementor; import org.hibernate.dialect.H2Dialect; import org.hibernate.engine.config.spi.ConfigurationService; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.internal.CoreMessageLogger; import org.hibernate.internal.util.PropertiesHelper; import org.hibernate.service.spi.ServiceRegistryImplementor; @@ -157,8 +157,8 @@ public void testMissingColumn() { .applySettings( settings ) .build(); - DriverManagerConnectionProviderImpl connectionProvider = - new DriverManagerConnectionProviderImpl(); + DriverManagerConnectionProvider connectionProvider = + new DriverManagerConnectionProvider(); connectionProvider.configure( PropertiesHelper.map( properties() ) ); final GenerationTargetToDatabase schemaGenerator = new GenerationTargetToDatabase( @@ -214,8 +214,8 @@ public void testMismatchColumnType() { .applySettings( settings ) .build(); - DriverManagerConnectionProviderImpl connectionProvider = - new DriverManagerConnectionProviderImpl(); + DriverManagerConnectionProvider connectionProvider = + new DriverManagerConnectionProvider(); connectionProvider.configure( PropertiesHelper.map( properties() ) ); final GenerationTargetToDatabase schemaGenerator = new GenerationTargetToDatabase( diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/MySQLColumnValidationTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/MySQLColumnValidationTest.java index be6f9b4925b3..c72b38a1a1e9 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/MySQLColumnValidationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/MySQLColumnValidationTest.java @@ -15,7 +15,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.dialect.MySQLDialect; import org.hibernate.engine.config.spi.ConfigurationService; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.internal.util.PropertiesHelper; import org.hibernate.tool.schema.internal.DefaultSchemaFilter; import org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl; @@ -66,11 +66,11 @@ @RequiresDialect( value = MySQLDialect.class, matchSubTypes = false ) public class MySQLColumnValidationTest { - private DriverManagerConnectionProviderImpl connectionProvider; + private DriverManagerConnectionProvider connectionProvider; @BeforeAll public void init() { - connectionProvider = new DriverManagerConnectionProviderImpl(); + connectionProvider = new DriverManagerConnectionProvider(); connectionProvider.configure( PropertiesHelper.map( Environment.getProperties() ) ); try( Connection connection = connectionProvider.getConnection(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/type/AbstractJavaTimeTypeTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/type/AbstractJavaTimeTypeTest.java index 4c5eeb3c4779..690c1aca29b3 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/type/AbstractJavaTimeTypeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/type/AbstractJavaTimeTypeTest.java @@ -28,7 +28,7 @@ import org.hibernate.service.ServiceRegistry; import org.hibernate.testing.orm.junit.JiraKey; -import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProviderImpl; +import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProvider; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.CustomParameterized; import org.hibernate.testing.orm.junit.DialectContext; @@ -194,7 +194,7 @@ public void nativeWriteThenRead() { protected final void withDefaultTimeZone(Runnable runnable) { TimeZone timeZoneBefore = TimeZone.getDefault(); TimeZone.setDefault( toTimeZone( env.defaultJvmTimeZone ) ); - SharedDriverManagerConnectionProviderImpl.getInstance().onDefaultTimeZoneChange(); + SharedDriverManagerConnectionProvider.getInstance().onDefaultTimeZoneChange(); /* * Run the code in a new thread, because some libraries (looking at you, h2 JDBC driver) * cache data dependent on the default timezone in thread local variables, @@ -223,7 +223,7 @@ else if ( cause instanceof Error ) { } finally { TimeZone.setDefault( timeZoneBefore ); - SharedDriverManagerConnectionProviderImpl.getInstance().onDefaultTimeZoneChange(); + SharedDriverManagerConnectionProvider.getInstance().onDefaultTimeZoneChange(); } } diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/env/ConnectionProviderBuilder.java b/hibernate-testing/src/main/java/org/hibernate/testing/env/ConnectionProviderBuilder.java index e0cf1cb42cf2..fd837a44616f 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/env/ConnectionProviderBuilder.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/env/ConnectionProviderBuilder.java @@ -17,8 +17,8 @@ import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Environment; import org.hibernate.dialect.Dialect; -import org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DataSourceConnectionProvider; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; import org.hibernate.internal.util.PropertiesHelper; import org.hibernate.internal.util.ReflectHelper; @@ -59,7 +59,7 @@ public static Properties getConnectionProviderProperties(String dbName, Map PGJDBC_STANDARD_TYPE_NAMES = buildTypeNames( Set.of( "int2", @@ -70,7 +70,7 @@ private static Set buildTypeNames(Set baseTypeNames) { return typeNames; } - public static SharedDriverManagerConnectionProviderImpl getInstance() { + public static SharedDriverManagerConnectionProvider getInstance() { return INSTANCE; } diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/SharedDriverManagerTypeCacheClearingIntegrator.java b/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/SharedDriverManagerTypeCacheClearingIntegrator.java index b8ea1031d74c..6118d2db2796 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/SharedDriverManagerTypeCacheClearingIntegrator.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/SharedDriverManagerTypeCacheClearingIntegrator.java @@ -15,6 +15,6 @@ public void integrate( Metadata metadata, BootstrapContext bootstrapContext, SessionFactoryImplementor sessionFactory) { - SharedDriverManagerConnectionProviderImpl.getInstance().clearTypeCache(); + SharedDriverManagerConnectionProvider.getInstance().clearTypeCache(); } } diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/jta/JtaAwareConnectionProviderImpl.java b/hibernate-testing/src/main/java/org/hibernate/testing/jta/JtaAwareConnectionProviderImpl.java index b2b67aeed2bb..c1cfd49be905 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/jta/JtaAwareConnectionProviderImpl.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/jta/JtaAwareConnectionProviderImpl.java @@ -53,7 +53,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.dialect.Dialect; import org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator; -import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl; +import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvider; import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; import org.hibernate.engine.jdbc.connections.spi.DatabaseConnectionInfo; import org.hibernate.engine.jdbc.env.spi.ExtractedDatabaseMetaData; @@ -62,7 +62,7 @@ import org.hibernate.service.spi.ServiceRegistryAwareService; import org.hibernate.service.spi.ServiceRegistryImplementor; import org.hibernate.service.spi.Stoppable; -import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProviderImpl; +import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProvider; /** * A {@link ConnectionProvider} implementation intended for testing Hibernate/JTA interaction. In that limited scope we @@ -76,7 +76,7 @@ public class JtaAwareConnectionProviderImpl implements ConnectionProvider, Confi ServiceRegistryAwareService { private static final String CONNECTION_KEY = "_database_connection"; - private final DriverManagerConnectionProviderImpl delegate = SharedDriverManagerConnectionProviderImpl.getInstance(); + private final DriverManagerConnectionProvider delegate = SharedDriverManagerConnectionProvider.getInstance(); private final List nonEnlistedConnections = new ArrayList<>(); @@ -102,7 +102,7 @@ public void configure(Map configurationValues) { connectionSettings.put( Environment.AUTOCOMMIT, "false" ); connectionSettings.put( Environment.POOL_SIZE, "5" ); - connectionSettings.put( DriverManagerConnectionProviderImpl.INITIAL_SIZE, "0" ); + connectionSettings.put( DriverManagerConnectionProvider.INITIAL_SIZE, "0" ); delegate.configure( connectionSettings ); } diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/orm/jdbc/PreparedStatementSpyConnectionProvider.java b/hibernate-testing/src/main/java/org/hibernate/testing/orm/jdbc/PreparedStatementSpyConnectionProvider.java index f8a28db2e67f..ff0d73829516 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/orm/jdbc/PreparedStatementSpyConnectionProvider.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/orm/jdbc/PreparedStatementSpyConnectionProvider.java @@ -18,7 +18,7 @@ import org.hibernate.testing.jdbc.ConnectionProviderDelegate; import org.hibernate.testing.jdbc.JdbcSpies; -import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProviderImpl; +import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProvider; /** * This {@link ConnectionProvider} extends any other ConnectionProvider that would be used by default taken the current configuration properties, and it @@ -61,7 +61,7 @@ public PreparedStatementSpyConnectionProvider() { public PreparedStatementSpyConnectionProvider(boolean forceSupportsAggressiveRelease) { super(forceSupportsAggressiveRelease); - setConnectionProvider( SharedDriverManagerConnectionProviderImpl.getInstance() ); + setConnectionProvider( SharedDriverManagerConnectionProvider.getInstance() ); } protected Connection actualConnection() throws SQLException { diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/orm/jdbc/TimeZoneConnectionProvider.java b/hibernate-testing/src/main/java/org/hibernate/testing/orm/jdbc/TimeZoneConnectionProvider.java index 1aafc205fdcd..29aae4c3c5e7 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/orm/jdbc/TimeZoneConnectionProvider.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/orm/jdbc/TimeZoneConnectionProvider.java @@ -9,7 +9,7 @@ import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; import org.hibernate.testing.jdbc.ConnectionProviderDelegate; -import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProviderImpl; +import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProvider; /** * This {@link ConnectionProvider} extends any other ConnectionProvider that would be used by default taken the current configuration properties, and it @@ -28,7 +28,7 @@ public TimeZoneConnectionProvider(String customTimeZone) { this.defaultTimeZone = System.setProperty( "user.timezone", customTimeZone); TimeZone.setDefault(TimeZone.getTimeZone( customTimeZone )); // Clear the connection pool to avoid issues with drivers that initialize the session TZ to the system TZ - SharedDriverManagerConnectionProviderImpl.getInstance().onDefaultTimeZoneChange(); + SharedDriverManagerConnectionProvider.getInstance().onDefaultTimeZoneChange(); } @Override @@ -37,6 +37,6 @@ public void stop() { System.setProperty( "user.timezone", defaultTimeZone); TimeZone.setDefault(TimeZone.getTimeZone( defaultTimeZone )); // Clear the connection pool to avoid issues with drivers that initialize the session TZ to the system TZ - SharedDriverManagerConnectionProviderImpl.getInstance().onDefaultTimeZoneChange(); + SharedDriverManagerConnectionProvider.getInstance().onDefaultTimeZoneChange(); } } diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/util/ServiceRegistryUtil.java b/hibernate-testing/src/main/java/org/hibernate/testing/util/ServiceRegistryUtil.java index 36f8135cd336..417f0da4e9a8 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/util/ServiceRegistryUtil.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/util/ServiceRegistryUtil.java @@ -13,7 +13,7 @@ import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Environment; -import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProviderImpl; +import org.hibernate.testing.jdbc.SharedDriverManagerConnectionProvider; public class ServiceRegistryUtil { @@ -46,7 +46,7 @@ public static StandardServiceRegistryBuilder applySettings(StandardServiceRegist && !builder.getSettings().containsKey( AvailableSettings.CONNECTION_PROVIDER ) ) { builder.applySetting( AvailableSettings.CONNECTION_PROVIDER, - SharedDriverManagerConnectionProviderImpl.getInstance() + SharedDriverManagerConnectionProvider.getInstance() ); builder.applySetting( AvailableSettings.CONNECTION_PROVIDER_DISABLES_AUTOCOMMIT, @@ -62,7 +62,7 @@ public static void applySettings(Map properties) { final Map objectMap = (Map) properties; objectMap.put( AvailableSettings.CONNECTION_PROVIDER, - SharedDriverManagerConnectionProviderImpl.getInstance() + SharedDriverManagerConnectionProvider.getInstance() ); objectMap.put( AvailableSettings.CONNECTION_PROVIDER_DISABLES_AUTOCOMMIT, From 1431d8eabc6456ded55b8f8ce0c0cb37585f9ae7 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Sun, 10 Aug 2025 18:48:56 +1000 Subject: [PATCH 2/2] HHH-19702 leave stub implementations behind Not really necessary, since these classes were internal --- .../internal/DatasourceConnectionProviderImpl.java | 12 ++++++++++++ .../DriverManagerConnectionProviderImpl.java | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DatasourceConnectionProviderImpl.java create mode 100644 hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProviderImpl.java diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DatasourceConnectionProviderImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DatasourceConnectionProviderImpl.java new file mode 100644 index 000000000000..5595eb0b0ebf --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DatasourceConnectionProviderImpl.java @@ -0,0 +1,12 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * Copyright Red Hat Inc. and Hibernate Authors + */ +package org.hibernate.engine.jdbc.connections.internal; + +/** + * @deprecated Use {@link DataSourceConnectionProvider} + */ +@Deprecated(since = "7.1", forRemoval = true) +public class DatasourceConnectionProviderImpl extends DriverManagerConnectionProvider { +} diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProviderImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProviderImpl.java new file mode 100644 index 000000000000..13fa1d73f041 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProviderImpl.java @@ -0,0 +1,12 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * Copyright Red Hat Inc. and Hibernate Authors + */ +package org.hibernate.engine.jdbc.connections.internal; + +/** + * @deprecated Use {@link DriverManagerConnectionProvider} + */ +@Deprecated(since = "7.1", forRemoval = true) +public class DriverManagerConnectionProviderImpl extends DriverManagerConnectionProvider { +}