Session.load enhanced entity with eager collection loading mapping failded with PropertyAccessException

Description

In case when entity has collection with eager loading mapping like

and entities are enhanced with configuration

there is error with loading entity by session.load( Parent2.class, parentID ):
...
Caused by: org.hibernate.PropertyAccessException: Exception occurred inside setter of org.hibernate.test.bytecode.enhancement.lazy.Parent2.children
at org.hibernate.property.access.spi.EnhancedSetterMethodImpl.set(EnhancedSetterMethodImpl.java:81)
...
Caused by: java.lang.reflect.InvocationTargetException
...
org.hibernate.property.access.spi.EnhancedSetterMethodImpl.set(EnhancedSetterMethodImpl.java:49)
...
Caused by: java.lang.NullPointerException
at org.hibernate.engine.internal.StatefulPersistenceContext.getLoadedCollectionOwnerOrNull(StatefulPersistenceContext.java:747)
...

In attachment is junit test case to reproduce it.

Environment

None

Activity

Show:
LAdO
June 5, 2020, 11:10 AM

The issue is already fixed in the meantime, so it can be closed. Test unit is in pull request

Assignee

Unassigned

Reporter

LAdO

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure