Problem is simple I have two classes mapped with fluent nhibernate :
public class A: EntityBase {}
public class B: EntityBase
{
public virtual A A_Something {get;set;}
}
with EntityBase class providing only Key property. Now i want to map them and configure my db. So here are mappings
public class AMap : DomainEntityBase<A>
{
public AMap(){}
}
public class BMap : DomainEntityBase<B>
{
public BMap()
{
References(p=>p.A_Something).Column("A_ID");
}
}
and db configuration
Fluently.Configure().Database(...).Mappings(m =>
m.FluentMappings.Add<BMap>()).
ExposeConfiguration(BuildSchema).BuildSessionFactory();
Configuration is done only with BMap as unfortunately table A already exists inside database and it's data can't be changed (it's because this application is using parts of bigger database and those parts are not to be modified). So this schema generates standard exception
An association from the table [B] refers to an unmapped class: A
Is there any possibility somehow specify inside my configuration that A already exists in the db? If not what are your suggestions to solve this issue in a gentle way? Of course I can prepare *.sql files to manually create table B but this is not a solution (just pushing away problem as it will surely come back during further development). Also creating separate db and importing data from the first one could work but unfortunately there is a requirement to store data inside one (and only one) db.