Hi,
I am using Hibernate 3.1.3 with Hibernate Annotations 3.1-beta8 and don't seem to have an option to upgrade now.
What I am trying to model is a
Code:
class C {
java.util.Map<Foo, Bar> map;
}
where neither Foo not Bar have a reference back to C or to each other. Is that possible somehow?
I mean, wouldn't that just require a table {id, map_id, foo_id, Bar_id} to map that to the database?
All examples I have found need Foo as an attribute in Bar (
@MapKey(name="foo")) and a reference to C in Bar (
@OneToMany(mappedBy="c")).
The worst thing about this, it seems that the reference to C in Bar must be a unique key or at least non null.
It would be very nice if somebody could help me with this issue.
Thanks in advance,
Philipp