Can't model nested Embeddables with a ManyToOne

Description

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.

Environment

Any database, Hibernate4 or 3.

Assignee

Unassigned

Reporter

ChrisL

Fix versions

backPortable

None

Suitable for new contributors

None

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure