-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to map a jointable
PostPosted: Thu Jul 02, 2009 3:01 pm 
Newbie

Joined: Thu Aug 07, 2008 3:41 pm
Posts: 14
Hi,

I've got three classes.
One is person, one is phone, the other personphone.

So each person has many phones. I want to make a one-to-many unidirectional mapping.
I can understand the person mapping and the phone mapping.
But how do i map the personphone table?
I could find any info in the documentation...


Top
 Profile  
 
 Post subject: Re: How to map a jointable
PostPosted: Thu Jul 02, 2009 8:16 pm 
Regular
Regular

Joined: Fri Jan 30, 2009 10:10 am
Posts: 74
Location: London
Hi,

Do you really need the personphone class?

If you are just trying to allow each person to be associated with multiple phone entities, then you should store the phones as a collection in the person and let Hibernate take care of the relationship mapping.

See:

http://docs.jboss.org/hibernate/stable/ ... ional-join


--
Stephen Souness


Top
 Profile  
 
 Post subject: Re: How to map a jointable
PostPosted: Fri Jul 03, 2009 1:35 am 
Newbie

Joined: Thu Aug 07, 2008 3:41 pm
Posts: 14
Thats true, I dont really need it...
I was just trying ti query the table to check everything is populated correctly.
But I need to use the person table for that.

Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.