-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Complex collection structure
PostPosted: Thu Oct 12, 2006 3:08 pm 
Beginner
Beginner

Joined: Fri May 12, 2006 9:58 am
Posts: 32
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


Top
 Profile  
 
 Post subject: Re: Complex collection structure
PostPosted: Wed May 20, 2009 5:21 pm 
Newbie

Joined: Thu Feb 19, 2009 11:37 pm
Posts: 10
Hi,
Did you get an answer to this question? I have a similar situation!

Thanks,
Mahesh


Top
 Profile  
 
 Post subject: Re: Complex collection structure
PostPosted: Wed May 20, 2009 8:46 pm 
Beginner
Beginner

Joined: Fri May 12, 2006 9:58 am
Posts: 32
I think the Performance object is the recommended way.


Top
 Profile  
 
 Post subject: Re: Complex collection structure
PostPosted: Thu May 21, 2009 9:26 am 
Newbie

Joined: Thu Feb 19, 2009 11:37 pm
Posts: 10
Thanks... I will go with that.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.