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: "Optional" one-to-one
PostPosted: Tue Jun 03, 2008 11:51 am 
Newbie

Joined: Mon Jan 07, 2008 8:26 pm
Posts: 7
I was trying, without success, to map a database scenario which would be one-to-one, but that the child rows for the parent may be missing from the database.

This changes the nature of the relationship I think, but I'm not really sure how to deal with it using NHibernate. Any thoughts?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 04, 2008 8:42 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
You can map it as a many-to-one with not-found="ignore" and unique="true". Have a look at the end of chapter 5.1.11 in the reference documentation.

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 04, 2008 8:54 am 
Newbie

Joined: Mon Jan 07, 2008 8:26 pm
Posts: 7
I'll look into that. Thanks for the suggestion!


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.