I have a class whose primary key is a single column, which is a reference to another object's single column primary key. The only way I can see to map this in NHibernate is to pretend it's a composite key (even though it's a single column key) and use the key-reference mapping. Is there a more appropriate way?
Snippet below:
class CompanyExportCriteria
public Company Company { get; set; }
class Company
public string Id { get; set; }
Company maps to a COMPANY table (ID as PK)
CompanyExportCriteria maps to a COMPANY_EXPORT_CRITERIA table (COMPANY_ID) as key.
PS - I am using Fluent NHibernate for mapping.