Id with Foreign Generator
I have a set of classes similar to the following:
class Company
public string Id;
class CompanyCriteria
public Company Company;
CompanyCriteria is mapped to COMPANY_CRITERIA with the key column being COMPANY_ID, which comes from CompanyCriteria.Company.Id. I managed to get this to map via the following:
Id("COMPANY_ID")
.GeneratedBy.Foreign("Company");
This doesn't seem like ideal syntax. Couldn't the parameter to Foreign be exposed as an expression instead?
Support Staff 2 Posted by Paul Batum on 18 May, 2010 11:54 AM
I think an overload that took an expression is a great idea. Patches welcome :)
http://wiki.fluentnhibernate.org/Contributing