HHH-18437 - Remove deprecations from JdbcSessionContext
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
parent
dfb268ae2a
commit
e3fd3fad17
|
@ -32,7 +32,6 @@ import org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl;
|
|||
import org.hibernate.engine.jdbc.internal.JdbcServicesImpl;
|
||||
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
||||
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
import org.hibernate.event.internal.EmptyEventManager;
|
||||
import org.hibernate.event.spi.EventManager;
|
||||
import org.hibernate.internal.CoreMessageLogger;
|
||||
|
@ -47,7 +46,6 @@ import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
|
|||
import org.hibernate.resource.jdbc.spi.StatementInspector;
|
||||
import org.hibernate.resource.transaction.spi.TransactionCoordinator;
|
||||
import org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder;
|
||||
import org.hibernate.service.ServiceRegistry;
|
||||
import org.hibernate.service.spi.ServiceRegistryImplementor;
|
||||
import org.hibernate.stat.spi.StatisticsImplementor;
|
||||
|
||||
|
@ -613,7 +611,6 @@ public class JdbcEnvironmentInitiator implements StandardServiceInitiator<JdbcEn
|
|||
|
||||
private final JdbcConnectionAccess jdbcConnectionAccess;
|
||||
private final JdbcServices jdbcServices;
|
||||
private final ServiceRegistryImplementor serviceRegistry;
|
||||
private final boolean jtaTrackByThread;
|
||||
private final boolean preferUserTransaction;
|
||||
private final boolean connectionProviderDisablesAutoCommit;
|
||||
|
@ -631,7 +628,6 @@ public class JdbcEnvironmentInitiator implements StandardServiceInitiator<JdbcEn
|
|||
this.jdbcConnectionAccess = jdbcConnectionAccess;
|
||||
this.jdbcServices = jdbcServices;
|
||||
this.sqlExceptionHelper = sqlExceptionHelper;
|
||||
this.serviceRegistry = serviceRegistry;
|
||||
final ConfigurationService configuration = serviceRegistry.requireService( ConfigurationService.class );
|
||||
this.jtaTrackByThread = configuration.getSetting( JTA_TRACK_BY_THREAD, BOOLEAN, true );
|
||||
this.preferUserTransaction = getBoolean( PREFER_USER_TRANSACTION, configuration.getSettings() );
|
||||
|
@ -754,16 +750,6 @@ public class JdbcEnvironmentInitiator implements StandardServiceInitiator<JdbcEn
|
|||
return EMPTY_JDBC_EVENT_HANDLER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SessionFactoryImplementor getSessionFactory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServiceRegistry getServiceRegistry() {
|
||||
return serviceRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JdbcServices getJdbcServices() {
|
||||
return jdbcServices;
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.hibernate.resource.jdbc.spi.JdbcEventHandler;
|
|||
import org.hibernate.resource.jdbc.spi.JdbcSessionContext;
|
||||
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
|
||||
import org.hibernate.resource.jdbc.spi.StatementInspector;
|
||||
import org.hibernate.service.ServiceRegistry;
|
||||
import org.hibernate.stat.spi.StatisticsImplementor;
|
||||
|
||||
/**
|
||||
|
@ -99,16 +98,6 @@ public class JdbcSessionContextImpl implements JdbcSessionContext {
|
|||
return jdbcEventHandler;
|
||||
}
|
||||
|
||||
@Override @Deprecated
|
||||
public SessionFactoryImplementor getSessionFactory() {
|
||||
return sessionFactory;
|
||||
}
|
||||
|
||||
@Override @Deprecated
|
||||
public ServiceRegistry getServiceRegistry() {
|
||||
return sessionFactory.getServiceRegistry();
|
||||
}
|
||||
|
||||
private SessionFactoryOptions settings() {
|
||||
return sessionFactory.getSessionFactoryOptions();
|
||||
}
|
||||
|
|
|
@ -8,9 +8,7 @@ package org.hibernate.resource.jdbc.spi;
|
|||
|
||||
import org.hibernate.engine.jdbc.batch.spi.BatchBuilder;
|
||||
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
import org.hibernate.jpa.spi.JpaCompliance;
|
||||
import org.hibernate.service.ServiceRegistry;
|
||||
import org.hibernate.stat.spi.StatisticsImplementor;
|
||||
|
||||
/**
|
||||
|
@ -59,23 +57,6 @@ public interface JdbcSessionContext {
|
|||
|
||||
JdbcEventHandler getEventHandler();
|
||||
|
||||
/**
|
||||
* Retrieve the session factory for this environment.
|
||||
*
|
||||
* @deprecated exposing this here seems to kinda defeat the purpose of this SPI
|
||||
*/
|
||||
@Deprecated(since = "6.2")
|
||||
SessionFactoryImplementor getSessionFactory();
|
||||
|
||||
/**
|
||||
* Retrieve the service registry.
|
||||
*
|
||||
* @deprecated this is no longer called, and unnecessary, since the needed
|
||||
* services are now available via {@link #getJdbcServices()}
|
||||
*/
|
||||
@Deprecated(since = "6.2")
|
||||
ServiceRegistry getServiceRegistry();
|
||||
|
||||
JdbcServices getJdbcServices();
|
||||
|
||||
BatchBuilder getBatchBuilder();
|
||||
|
|
|
@ -61,7 +61,6 @@ public class JdbcCoordinatorTest {
|
|||
jdbcConnectionAccess );
|
||||
|
||||
ServiceRegistry serviceRegistry = Mockito.mock( ServiceRegistry.class );
|
||||
when( sessionContext.getServiceRegistry() ).thenReturn( serviceRegistry );
|
||||
when( sessionContext.getPhysicalConnectionHandlingMode() ).thenReturn(
|
||||
PhysicalConnectionHandlingMode.IMMEDIATE_ACQUISITION_AND_HOLD );
|
||||
|
||||
|
|
Loading…
Reference in New Issue