Please find below the issue I have encountered during the migration from hibernate 5 to hibernante 6.1.7. My sample project is using Lombok / Spring Data; its datamodel is composed of :
- Buckets having Lines
- Items having Lines
- The Line class
- The simplified Pk classes - they are all identical, as PkBucket here below
My test is creating and updating some data :
The issue below occurs when tying to hydrate Item.lines:
Few remarks:
- As you can see in the stack attached, the Line property id is accessed through PkBucket id instead of PkLine id.
- If I remove nullable = false from Bucket lines JoinColums the result is OK
- If I use unique Pk class the issue persists : IllegalArgumentException: Can not set java.lang.Long field com.example.demo.domain.issue2.Pk.id to com.example.demo.domain.issue2.Line
- If I force the Line class to extend the expected id class the result is OK but this is not nice 🙂
I have attached the full log; if needed, I can also share my sample project. |