HHH-15750 fix bug in Hibernate.isInitialized()
it didn't work for EnhancementAsProxyLazinessInterceptor
This commit is contained in:
parent
be406f2732
commit
c8ffee43ef
|
@ -113,7 +113,12 @@ public final class Hibernate {
|
|||
}
|
||||
else if ( isPersistentAttributeInterceptable( proxy ) ) {
|
||||
final PersistentAttributeInterceptor interceptor = asPersistentAttributeInterceptable( proxy ).$$_hibernate_getInterceptor();
|
||||
return !(interceptor instanceof EnhancementAsProxyLazinessInterceptor);
|
||||
if (interceptor instanceof EnhancementAsProxyLazinessInterceptor) {
|
||||
return ( (EnhancementAsProxyLazinessInterceptor) interceptor ).isInitialized();
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( proxy instanceof LazyInitializable ) {
|
||||
return ( (LazyInitializable) proxy ).wasInitialized();
|
||||
|
|
Loading…
Reference in New Issue