Given
- a class hierarchy where all of them are concrete classes and mapped in a single table with discriminator,
- 2 of them maps the same ManyToOne reference to the concrete parent class
- Batch size should be enabled
When
- Loading entities from database
Then
- Hibernate batch loading is failing calling the wrong field setter for one of the child classes
This case works fine in hibernate 5.x (including the latest 5) I simplified the mapping to have only enough to reproduce the bug. Moving the attribute mapping to a super class is not an option in my case due to some complex mapping hierarchy. I’m using a workaround creating my own PropertyAccessStrategy I’ll attach a test case as soon I get a Jira issue number |