HHH-15481 NaturalId and Lazy cause a class cast Exception

This commit is contained in:
Andrea Boriero 2022-09-09 13:04:15 +02:00 committed by Andrea Boriero
parent 84c4a57099
commit 6904a19835
1 changed files with 2 additions and 2 deletions

View File

@ -133,7 +133,7 @@ public class EntityDelayedFetchInitializer extends AbstractFetchParentAccess imp
final PersistenceContext persistenceContext = session.getPersistenceContextInternal(); final PersistenceContext persistenceContext = session.getPersistenceContextInternal();
entityInstance = persistenceContext.getEntity( euk ); entityInstance = persistenceContext.getEntity( euk );
if ( entityInstance == null ) { if ( entityInstance == null ) {
if ( ((AbstractEntityInitializer) this.parentAccess).getEntityDescriptor() if ( ( (AbstractEntityInitializer) this.parentAccess.findFirstEntityDescriptorAccess() ).getEntityDescriptor()
.getBytecodeEnhancementMetadata() .getBytecodeEnhancementMetadata()
.isEnhancedForLazyLoading() ) { .isEnhancedForLazyLoading() ) {
return; return;