-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem with associations to one class in different roles
PostPosted: Tue Oct 31, 2006 10:35 am 
Newbie

Joined: Tue Oct 31, 2006 8:43 am
Posts: 1
Location: Germany
Hello,

I would like to associate one class in a one to one or one to many association in differnt roles. Addionally these associations should be navigatable
in both directions!!

Here a concrete example:
class Person{
Address homeAddress
Address workAddress
}

class Address{
Person person
...
}

Person can reference a home and a work address. Form the Address class I want to come back to the Person.

We use Hibernate 3.2.0 and Hibernate Annotations.

Can anyone tell me if and how this can be done :-)
Thanks a lot!
Rudolf


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 1:22 pm 
Senior
Senior

Joined: Tue Aug 23, 2005 8:52 am
Posts: 181
A very similar example is provided in section 23.4.1. "Typed" one-to-one association
of the Hibernate reference docs


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