diff --git a/hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingMetadata.java b/hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingMetadata.java index bcf13d1cf9..cfe3d1e0d9 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingMetadata.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingMetadata.java @@ -48,6 +48,10 @@ public abstract class AbstractDelegatingMetadata implements MetadataImplementor this.delegate = delegate; } + protected MetadataImplementor delegate() { + return delegate; + } + @Override public IdentifierGeneratorFactory getIdentifierGeneratorFactory() { return delegate.getIdentifierGeneratorFactory(); diff --git a/hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingMetadataBuilderImplementor.java b/hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingMetadataBuilderImplementor.java index 31db0365a5..7b9f6e8e20 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingMetadataBuilderImplementor.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingMetadataBuilderImplementor.java @@ -45,10 +45,20 @@ public abstract class AbstractDelegatingMetadataBuilderImplementor return (T) this; } - protected SessionBuilder getDelegate() { + protected SessionBuilder delegate() { return delegate; } diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/AbstractDelegatingSessionBuilderImplementor.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/AbstractDelegatingSessionBuilderImplementor.java index e8875bad6c..689d7ee166 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/AbstractDelegatingSessionBuilderImplementor.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/AbstractDelegatingSessionBuilderImplementor.java @@ -20,14 +20,14 @@ public abstract class AbstractDelegatingSessionBuilderImplementor T execute(Callback callback) { return delegate.execute( callback ); @@ -622,6 +632,10 @@ public class SessionDelegatorBaseImpl implements SessionImplementor { * This is an implementation of EntityManager#getDelegate(). It returns the current session and not the delegate * session as it is what we want. The name of the method is misleading here but, as it is part of JPA, we cannot do * anything about it. + *

+ * To get the underlying delegate, use {@link #delegate()} instead. + * + * @see SessionDelegatorBaseImpl#delegate() */ @Override public Object getDelegate() { diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryDelegatingImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryDelegatingImpl.java index 9f1129a72b..6d072bb4d1 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryDelegatingImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryDelegatingImpl.java @@ -73,7 +73,7 @@ public class SessionFactoryDelegatingImpl implements SessionFactoryImplementor, this.delegate = delegate; } - protected SessionFactoryImplementor getDelegate() { + protected SessionFactoryImplementor delegate() { return delegate; }