HHH-11944 The getDelegate() method here is the method from EntityManager

It should not return the delegate but the current Session impl proper.

The name is a bit misleading but it comes from JPA so we cannot do
anything about it.
This commit is contained in:
Guillaume Smet 2017-08-25 17:59:20 +02:00
parent 626c8abc71
commit 3620e1e47e
1 changed files with 8 additions and 3 deletions

View File

@ -618,9 +618,14 @@ public class SessionDelegatorBaseImpl implements SessionImplementor {
return delegate.unwrap( cls );
}
/**
* 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.
*/
@Override
public Object getDelegate() {
return delegate;
return this;
}
@Override