HHH-10922 - Call on bytecode enhanced method trigger load of proxy
(cherry picked from commit 92c1e63577
)
This commit is contained in:
parent
e66ec8f77e
commit
0f8fa7a12b
|
@ -57,6 +57,11 @@ public class JavassistLazyInitializer extends BasicLazyInitializer implements Me
|
|||
final Method proceed,
|
||||
final Object[] args) throws Throwable {
|
||||
if ( this.constructed ) {
|
||||
// HHH-10922 - Internal calls to bytecode enhanced methods cause proxy to be initialized
|
||||
if ( thisMethod.getName().startsWith( "$$_hibernate_" ) ) {
|
||||
return proceed.invoke( proxy, args );
|
||||
}
|
||||
|
||||
Object result;
|
||||
try {
|
||||
result = this.invoke( thisMethod, args, proxy );
|
||||
|
@ -84,7 +89,7 @@ public class JavassistLazyInitializer extends BasicLazyInitializer implements Me
|
|||
}
|
||||
|
||||
if ( returnValue == target ) {
|
||||
if ( returnValue.getClass().isInstance(proxy) ) {
|
||||
if ( returnValue.getClass().isInstance( proxy ) ) {
|
||||
return proxy;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue