Skip to content

Commit

Permalink
HHH-11944 Add missing methods to AbstractDelegatingSessionFactoryBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Sep 1, 2017
1 parent e8441e5 commit 626c8ab
Showing 1 changed file with 26 additions and 1 deletion.
Expand Up @@ -15,6 +15,7 @@
import org.hibernate.Interceptor;
import org.hibernate.MultiTenancyStrategy;
import org.hibernate.NullPrecedence;
import org.hibernate.SessionFactory;
import org.hibernate.SessionFactoryObserver;
import org.hibernate.boot.SessionFactoryBuilder;
import org.hibernate.boot.TempTableDdlTransactionHandling;
Expand All @@ -24,6 +25,7 @@
import org.hibernate.hql.spi.id.MultiTableBulkIdStrategy;
import org.hibernate.loader.BatchFetchStyle;
import org.hibernate.proxy.EntityNotFoundDelegate;
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
import org.hibernate.resource.jdbc.spi.StatementInspector;
import org.hibernate.tuple.entity.EntityTuplizer;
import org.hibernate.tuple.entity.EntityTuplizerFactory;
Expand All @@ -33,6 +35,7 @@
*
* @author Steve Ebersole
* @author Gunnar Morling
* @author Guillaume Smet
* @param <T> The type of a specific sub-class; Allows sub-classes to narrow down the return-type of the contract methods
* to a specialization of {@link SessionFactoryBuilder}
*/
Expand All @@ -50,6 +53,10 @@ public AbstractDelegatingSessionFactoryBuilder(SessionFactoryBuilder delegate) {
*/
protected abstract T getThis();

protected SessionFactoryBuilder getDelegate() {
return delegate;
}

@Override
public T applyValidatorFactory(Object validatorFactory) {
delegate.applyValidatorFactory( validatorFactory );
Expand Down Expand Up @@ -342,6 +349,7 @@ public T applyJdbcFetchSize(int size) {
return getThis();
}

@SuppressWarnings("deprecation")
@Override
public T applyConnectionReleaseMode(ConnectionReleaseMode connectionReleaseMode) {
delegate.applyConnectionReleaseMode( connectionReleaseMode );
Expand Down Expand Up @@ -375,7 +383,7 @@ public T allowOutOfTransactionUpdateOperations(boolean allow) {
}

@Override
public SessionFactoryBuilder enableReleaseResourcesOnCloseEnabled(boolean enable) {
public T enableReleaseResourcesOnCloseEnabled(boolean enable) {
delegate.enableReleaseResourcesOnCloseEnabled( enable );
return getThis();
}
Expand All @@ -385,4 +393,21 @@ public SessionFactoryBuilder enableReleaseResourcesOnCloseEnabled(boolean enable
public <S extends SessionFactoryBuilder> S unwrap(Class<S> type) {
return (S) this;
}

@Override
public T applyStatelessInterceptor(Class<? extends Interceptor> statelessInterceptorClass) {
delegate.applyStatelessInterceptor( statelessInterceptorClass );
return getThis();
}

@Override
public T applyConnectionHandlingMode(PhysicalConnectionHandlingMode connectionHandlingMode) {
delegate.applyConnectionHandlingMode( connectionHandlingMode );
return getThis();
}

@Override
public SessionFactory build() {
return delegate.build();
}
}

0 comments on commit 626c8ab

Please sign in to comment.