-->
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: One-to-one mapping with Hibernate 2.0.3
PostPosted: Mon Oct 20, 2003 2:45 pm 
Newbie

Joined: Mon Oct 20, 2003 2:27 pm
Posts: 1
Location: Germany
Hi everybody,

I would like to map a one-to-one relation using an unique key, not the primary key. As I read in some other posts in this forum, Hibernate 2.1 introduces foreign key mapping.

Is there any appropriate way to implement such a mapping in Hibernate 2.0.3? or do I better wait and move on to Hibernate 2.1.

Thanks.
Pei


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 21, 2003 8:56 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
It depends on which direction. You can use many-to-one for one direction but you cannot do the other directly. I supose you could also setup a one-to-many and another method (one-to-one signature not mapped) which uses the one-to-many to provide the persistence hook. When you go to 2.1 you drop the one-to-many mapping for the one-to-one with property-ref value.


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.