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.  [ 1 post ] 
Author Message
 Post subject: Help with ambiguous polymorphic bidirectional mapping
PostPosted: Tue Aug 15, 2006 12:23 pm 
Newbie

Joined: Tue Aug 01, 2006 9:42 pm
Posts: 6
What's the rule for mapping in a situation where a concrete base class (ClassA) is simultaneously on the one side of a bidirectional one-to-one relationship with ClassX and a class derived from ClassA (lets say ClassB) is on the many side of a many-to-one relationship with ClassX. Both ClassA and ClassB navigate the relationship using the same property.
How is that property mapped? Do you map that property as one-to-one in the base class and many-to-one in the derived class (with the same mapping name?). Or do you map the property using many-to-one in the base class even though it doesn't fit? The former approach assumes NHibernate is smart enough to *override* the base class mapping in favor of the derived class mapping. I've actually tried both ways and have had issues both ways - just not sure what I should be expecting from NHibernate. Anyone?


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

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.