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.