views:

59

answers:

0

I'm using Fluent NHibernate's automapper to map the following domain model (via AutoMap.AssemblyOf<Ticket>()), but it's throwing an exception when creating a SessionFactory.

class Ticket {
    Owner TicketOwner { get; set; }
    Owner CreatedBy { get; set; }
}
abstract class Owner {
    ICollection<Ticket> OwnedTickets { get; set; }
    ICollection<Ticket> CreatedTickets { get; set; }
    string Name { get; set; }
}
class Person : Owner {
    Department EmployeeDepartment { get; set; }
    // ...
}
class Department : Owner {
    ICollection<Person> People { get; set; }
    // ...
}

NHibernate.MappingException: An association from the table Ticket refers to an unmapped class: Owner

The documentation says that this should work as-is. Am I forgetting something?