I'm trying to map two classes together via a N:N relationship, and that's working fine as is. However, there's a field in my join table that I'd like to also map to a property on the child object, and I haven't an inkling on how to do that.
Basically, I have my map done something like:
CompanyMap : ClassMap<Company> {
public CompanyMap() {
HasManyToMany<Employee>(x => x.Employees)
.Table("COMPANY_EMPLOYEE")
.ParentKeyColumn("COMPANY_ID")
.ChildKeyColumn("EMPLOYEE_ID")
;
}
}
with my Employee class having a .Tenure
property.
The value of that tenure is specified in my COMPANY_EMPLOYEE
join table, with the following schema:
COMPANY_ID | EMPLOYEE_ID | TENURE
I don't know if this is something embarassingly simple, or something downright impossible to do, but if someone can point me in the right direction, I'd really appreciate it.
Thanks!