-->
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: Mapping on primary key with two table having same comlumn PK
PostPosted: Wed Dec 30, 2009 4:54 am 
Newbie

Joined: Thu Dec 24, 2009 1:53 am
Posts: 1
I have VS 2008, SQL server 2008, NHibernate 2.0

I am Having Two tables say X1 and X2, with same column XID as PK. In X1 XID having identity with increment 1, and in X2 XID is PK but not identity column, the value from XID of X1 should come while updating. Both tables inserted on one click event.

I will place my mapping here:
X1 mapping:
<class name="X1" table="X1">
<id name="XID" type="int">
<generator class="identity" />
</id>
<property name="XY" />
</class>

X2 Mapping:
<class name="X2" table="X2">
<id name="XID">
<generator class="foreign">
<param name="property">XY</param>
</generator>
</id>
<one-to-one name="XID" class="X1" constrained="true" />
</class>

Error is that Could not load type 'assembly name.X2.hbm.xml' from'Assembly Name'

before, with same mapping, is is loading , but session.save is not working so i changed the property of hbm.xml page - build action: Embedded Resource.

What could be the solution? whether mapping is wrong or the anything else?


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.