HHH-16794 With Bytecode enhancement a lazy ManyToOne association targeting an Entity annotated with @Proxy(lazy = false) is eagerly loaded

This commit is contained in:
Andrea Boriero 2023-06-14 13:15:49 +02:00 committed by Andrea Boriero
parent d71a0f77e1
commit c9baeb5c68
1 changed files with 3 additions and 3 deletions

View File

@ -401,9 +401,9 @@ public class EntityMetamodel implements Serializable {
lazy = persistentClass.isLazy() && (
// TODO: this disables laziness even in non-pojo entity modes:
!persistentClass.hasPojoRepresentation() ||
!isFinalClass( persistentClass.getProxyInterface() )
);
!persistentClass.hasPojoRepresentation() || !isFinalClass( persistentClass.getProxyInterface() ) )
|| bytecodeEnhancementMetadata.isEnhancedForLazyLoading();
mutable = persistentClass.isMutable();
if ( persistentClass.isAbstract() == null ) {
// legacy behavior (with no abstract attribute specified)