-->
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: Join Table Properties
PostPosted: Wed Sep 09, 2009 7:29 pm 
Newbie

Joined: Wed Sep 09, 2009 7:19 pm
Posts: 1
Hi there,

Still new and still learning nHibernate as well as proper Domain Model pattern.

I'm struggling with a concept here. I know how to design the database but no sure how to map the classes to it, or even how to make the correct classes for nHibernate OR the terminology with which to search for solutions for my problem!

I could do it by hand but not using nHibernate.

The situation is as follows:

I have a many-to-many realtionship between a Horse entity and a Race entity, and they are both mapped properly with many-to-many relationships in both classes. The problem is that for each entry in the HorseRaces table (join table) there are specific fields, ie: the jockey and the position the horse came and the time etc. that can't be held in either of the classes, but can only be determined by the combination of the two!

How would I map this to classes with nHibernate? The only way I could think of is to create a new object to hold these fields?

Please, any advice or best practices would be much appreciated. Would hate to give up on nHibernate for this project now. I'm SURE there's a 'PROPER' way to do this?

Thank you in advance!


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.