HHH-15750 fix bug in Hibernate.isInitialized()

it didn't work for EnhancementAsProxyLazinessInterceptor
This commit is contained in:
Gavin 2022-11-24 13:23:21 +01:00 committed by Gavin King
parent be406f2732
commit c8ffee43ef
1 changed files with 6 additions and 1 deletions

View File

@ -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();