PropertyAccessException when deleting entities with Embeddables with child collections

Description

When using an @Embedded value object that has a collection with orphan removal, trying to delete the root entity throws a PropertyAccessException. The same scenario used to work without issue in Hibernate 5.

I have prepared an example test project to demonstrate the issue.

Model:

 

Test case:

 

 

 

Of particular interest is this message:

 

Apparently, for some reason, AbstractEntityPersister is trying to reflectively access the id property of the Parent entity but applies the getter to the embeddable child value type, which makes no sense.

Activity

Show:

Marco Belladelli January 27, 2023 at 1:04 PM

I have double checked and this issue will indeed be resolved by the next release of 6.1 (6.1.7) and by version 6.2.0 which will be available in the near future.

Thanks for reporting the issue and providing an example!

Daniel Becker January 26, 2023 at 5:29 PM

We are having the exact same issue with the current stable release 6.1.6

Tom B January 26, 2023 at 9:34 AM

We are experiencing the same error with embeddables that contains a oneToMany associations

Christoph Watzl January 19, 2023 at 12:10 PM
Edited

Also not reproducible on the current head of the 6.1 maintenance branch. I guess we’ll just have to wait for 6.1.7 then.

Christoph Watzl January 18, 2023 at 4:41 PM
Edited

Huh, apparently no longer reproducible in current main branch, so seems to be fixed already. Still reproducible in 6.2.0-CR1, though.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created January 9, 2023 at 3:15 PM
Updated February 7, 2023 at 11:20 AM
Resolved January 27, 2023 at 1:03 PM