NHibernate - mappping composite-id to table with non-composite primary key
- by Dmitry
I have table like this:
ID - PK;
KEY1 - UNIQUE1;
KEY2 - UNIQUE1;
If I don't want to use ID in my mappings, can I tell NHibernate to use KEY1 & KEY2 as a composite id? When I declare composite id like this:
<composite-id>
<key-property name="KEY1"/>
<key-property name="KEY2"/>
</composite-id>
I get FKUnmatchingColumnsException (Foreign key ... must have same number of columns as the referenced primary key ...)