views:

32

answers:

1
+1  A: 

Hibernate has @Any and @ManyToAny annotations for the cases when target entity is identified by type and non-unique id.

I think in your case, since both parent and child are identified this way, you need to create Relation entity with relations to parent and child annotated with @Any.

axtavt
This could be the solution, but how to use it? Any attempts to use Any or ManyToAny results in "java.lang.UnsupportedOperationException: any not supported yet"
LubosD
@LubosD: It turns out to be broken since Hibernate 3.5 when used via JPA, though it still works via `SessionFactory`.
axtavt