Skip to content

Commit

Permalink
HHH-14571 Always report identifiers as initialized when using enhance…
Browse files Browse the repository at this point in the history
…d proxies
  • Loading branch information
yrodiere committed Apr 22, 2021
1 parent 622babf commit 35bd8b4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions hibernate-core/src/main/java/org/hibernate/Hibernate.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

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;
Expand Down Expand Up @@ -202,11 +202,8 @@ public static boolean isPropertyInitialized(Object proxy, String propertyName) {

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 );
}
}

Expand Down

0 comments on commit 35bd8b4

Please sign in to comment.