views:

57

answers:

0

Hi, I am pretty new to S#harp architecture and fluent nhibernate. I was trying to build a sample solution using the template. MappingIntegrationTest fails for me when I try to run it for the following domains

public class Component
{
  public virtual string comp { get; set; }
}

public class Parent : Entity
{
   public virtual string Type { get; set; }
}

public class Child1: Parent
{
   public virtual Component Blah { get; set }
}

The ParentMap looks like following:

public class ParentMap : IAutoMappingOverride<Parent>
{
    public void Override(AutoMapping<Parent> mapping)
    {
        mapping.DiscriminateSubClassesOnColumn("Type")
            .SubClass<Child1>(m =>
                            {
                               m.Component(c => c.Blah, c =>
                                    {
                                        c.Map(x => x.comp , "comp");
                                    }
                            }
    }
}

The mapping integration tests fail for me * Database was not configured through Database method.

----> NHibernate.MappingException : An association from the table Parent refers to an unmapped class: Component

Do I need to remove these classes from AutoMapper?

related questions