Hibernate version: 3.0rc1
Is it possible to create a ternary association entity and have it mapped
on one side of the association (the collection side) as a map element
keyed on the element on the other side of the association?
The model of what I'm trying to map is:
Code:
class A
{
Map<B, AssocEntity> collection;
}
class B
{
... some business domain fields
}
class AssocEntity
{
private A owner;
private B ref;
//... Association fields like price, qty, count, whatever
}
Note that the association between A and B is 1:n and not many to many,
if it makes things easier
I have read the section about component mapping and ternary association
and certainly, AssocEntity can be realised using composite elements etc.
However, the collection side of the association is always a set, whereas
in my model I need it to be a map keyed on the referred entity so I can
look up the association and manipulate it.
Can someone shed some light on this and point me in the right direction?
I'm sure I'm just missing something obvious or have not read the right section in the manual.
Any help would be appreciated.