-->
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: Mapping Compsite-ID
PostPosted: Mon Nov 14, 2005 10:00 am 
I have a table that has copound key Say:

Table :- Department pk (DeptID,LocID)
Table :- Employee pk (EID)

i need to use NHibernate to map the two table using "Many-To-One" relation in Employee.hbm.xml.

please Help,

with regards

Amr


Top
  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 12:53 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
http://nhibernate.sourceforge.net/nh-docs/html/mapping.html#mapping-declaration-compositeid

You might also want to look at the unit tests which relate to composite ids. Most people will tell you that composite natural keys are not a good idea but if you have to work in a legacy schema which you cannot change, then this is how to do it.

Hope that helps


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.