NHibernate and Composite Key References
- by Rich
I have a weird situation. I have three entities, Company, Employee, Plan and Participation (in retirement plan).
Company PK: Company ID
Plan PK: Company ID, Plan ID
Employee PK: Company ID, SSN, Employee ID
Participation PK: Company ID, SSN, Plan ID
The problem is in linking the employee to the participation. From a DB perspective, participation should have Employee ID in the PK (it's not even in table). But it doesn't. NHibernate won't let me map the "has many" because the link expects 3 columns (since Employee PK has 3 columns), but I'd only provide 2.
Any ideas on how to do this?