map composite keys in Nhibernate

I have a legacy database where 2 columns are used in all the table create composite keys .

One of he error message which you may see :

must have same number of columns as the referenced primary key nhibernate

Solution :


ProjectID Version Project Name

Table 2

ProjectID Version Table2ID Name1

Table 3

ProjectID Version Table2ID Table3ID Name2

I have a common Composite key Project ID and Version from Table 1.

Mapping will look like this 

that’s it Smile



2 thoughts on “map composite keys in Nhibernate

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s