HHH-17220 Avoid runtime lookups of JdbcService from TableGenerator and TableStructure
This commit is contained in:
parent
0ecd5d8a45
commit
07fe08774f
|
@ -31,7 +31,6 @@ import org.hibernate.engine.config.spi.StandardConverters;
|
||||||
import org.hibernate.engine.jdbc.Size;
|
import org.hibernate.engine.jdbc.Size;
|
||||||
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
|
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
|
||||||
import org.hibernate.engine.jdbc.internal.FormatStyle;
|
import org.hibernate.engine.jdbc.internal.FormatStyle;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
|
||||||
import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
|
import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
|
||||||
import org.hibernate.engine.spi.SessionEventListenerManager;
|
import org.hibernate.engine.spi.SessionEventListenerManager;
|
||||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||||
|
@ -555,8 +554,8 @@ public class TableGenerator implements PersistentIdentifierGenerator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object generate(final SharedSessionContractImplementor session, final Object obj) {
|
public Object generate(final SharedSessionContractImplementor session, final Object obj) {
|
||||||
final SqlStatementLogger statementLogger = session.getFactory().getServiceRegistry()
|
final SqlStatementLogger statementLogger = session.
|
||||||
.getService( JdbcServices.class )
|
getFactory().getJdbcServices()
|
||||||
.getSqlStatementLogger();
|
.getSqlStatementLogger();
|
||||||
final SessionEventListenerManager statsCollector = session.getEventListenerManager();
|
final SessionEventListenerManager statsCollector = session.getEventListenerManager();
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.hibernate.boot.model.relational.SqlStringGenerationContext;
|
||||||
import org.hibernate.dialect.Dialect;
|
import org.hibernate.dialect.Dialect;
|
||||||
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
|
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
|
||||||
import org.hibernate.engine.jdbc.internal.FormatStyle;
|
import org.hibernate.engine.jdbc.internal.FormatStyle;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
|
||||||
import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
|
import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
|
||||||
import org.hibernate.engine.spi.SessionEventListenerManager;
|
import org.hibernate.engine.spi.SessionEventListenerManager;
|
||||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||||
|
@ -120,8 +119,7 @@ public class TableStructure implements DatabaseStructure {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AccessCallback buildCallback(final SharedSessionContractImplementor session) {
|
public AccessCallback buildCallback(final SharedSessionContractImplementor session) {
|
||||||
final SqlStatementLogger statementLogger = session.getFactory().getServiceRegistry()
|
final SqlStatementLogger statementLogger = session.getFactory().getJdbcServices()
|
||||||
.getService( JdbcServices.class )
|
|
||||||
.getSqlStatementLogger();
|
.getSqlStatementLogger();
|
||||||
if ( selectQuery == null || updateQuery == null ) {
|
if ( selectQuery == null || updateQuery == null ) {
|
||||||
throw new AssertionFailure( "SequenceStyleGenerator's TableStructure was not properly initialized" );
|
throw new AssertionFailure( "SequenceStyleGenerator's TableStructure was not properly initialized" );
|
||||||
|
|
Loading…
Reference in New Issue