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?
|