I want to have an object model with four classes, two entities (A and B) and two embeddeables (X and Y). A has a list of X, which contains a Y, which refers to a B.
If I set up a Configuration with these classes, and use SchemaExport to produce SQL for it, I expect to get tables for A and B, and a collection table that links the two with any information that X and Y have. Instead, the collection table just has A.
I can workaround by collapsing X and Y, so there's no Embeddable nesting, but I feel like this should work. Indeed, I tried it in another JPA implementation (EclipseLink) and it does work.
I've attached the four classes along with a runnable test case that just runs the described SchemaExport.
Any database, Hibernate4 or 3.
I verified that the example I posted on 08/May/2015 still fails in 5.0.2. Can't seem to edit affected-versions, but 5.0.2 should go on that list.
Awesome. Thanks for verifying!
As part of verifying that this issue affects 5.0, please just set the "Affects version". Leave the "verify-affects-5.0" label and leave the issue in "Awaiting Response" status; these are critical for us to be able to track these verifications and triage them. Thanks.
Let me inform you that this issue is still in 5.1.0 present.
I created a test case in this repository
https://github.com/moodysalem/hibernate-tests/tree/master/src/main/java/model/embeddabletwice
edit: note this repository uses hibernate 5.2.2