From 35bd8b4b6f0298943d65ff0a7d80ef17d1f38857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Thu, 22 Apr 2021 15:56:45 +0200 Subject: [PATCH] HHH-14571 Always report identifiers as initialized when using enhanced proxies --- .../src/main/java/org/hibernate/Hibernate.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/Hibernate.java b/hibernate-core/src/main/java/org/hibernate/Hibernate.java index ff12828e3e..9f4fea0184 100644 --- a/hibernate-core/src/main/java/org/hibernate/Hibernate.java +++ b/hibernate-core/src/main/java/org/hibernate/Hibernate.java @@ -8,8 +8,8 @@ package org.hibernate; import java.util.Iterator; +import org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor; import org.hibernate.bytecode.enhance.spi.interceptor.EnhancementAsProxyLazinessInterceptor; -import org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor; import org.hibernate.collection.spi.PersistentCollection; import org.hibernate.engine.HibernateIterator; import org.hibernate.engine.jdbc.LobCreator; @@ -202,11 +202,8 @@ public final class Hibernate { if ( entity instanceof PersistentAttributeInterceptable ) { PersistentAttributeInterceptor interceptor = ( (PersistentAttributeInterceptable) entity ).$$_hibernate_getInterceptor(); - if ( interceptor instanceof EnhancementAsProxyLazinessInterceptor ) { - return false; - } - if ( interceptor instanceof LazyAttributeLoadingInterceptor ) { - return ( (LazyAttributeLoadingInterceptor) interceptor ).isAttributeLoaded( propertyName ); + if ( interceptor instanceof BytecodeLazyAttributeInterceptor ) { + return ( (BytecodeLazyAttributeInterceptor) interceptor ).isAttributeLoaded( propertyName ); } }