I am using fluent nhibernate 3.1 to map to a legacy database. I have two classes and would like to join B to A. The database structure does not have foreign keys.
AModel.OccurrenceNumber and BModel.OccurrenceNumber have same data(i.e. claim # 1234 in one and the other), just different column names. Is it possible to join during the mapping stage? If need be I can write a linq statement to join them, but would like to know if it can be done here. Thanks in advance.
public class AMap : ClassMap<AModel>
{
public AMap()
{
Table("ATable");
Id(x => x.Id).GeneratedBy.Increment();
Map(x => x.OccurrenceNumber).Column("OCCUR"); //Same Data
}
}
public class BMap : ClassMap<BModel>
{
public BMap()
{
Table("BTable");
Id(x => x.Id).GeneratedBy.Increment();
Map(x => x.OccurrenceNumber).Column("B69_CLAIM_OCCUR"); // Same Data
}
}