Hibernate version: 3.1.3
Hello
I have 3 pojos. Song, Artist and Instrument.
A Song has a java.util.Map which maps an Artist to a java.util.Set of Instruments (that is because an artist might have played more than one instruments in a song).
Is this mapping possible with hibernate? I've managed to get a Song to have a map mapping an Artist to a single Instrument, but not to a set of Instruments.
I can overcome this issue by introducing a 4th pojo called Performance which will contain an Artist and a set of Instruments. So a Song will now have a set of Performances and my domain model is complete.
But can I skip that Performance object and stick to my initial design?
thanks,
Ioannis
|