Dear visitor - I'm new to NHibernate and came across the following problem:
I've one base class for all my entities. In my entities I use list of this base class for references. For example:
class A : BaseClass { IList<BaseClass> myList; }
class B : BaseClass { }
class C : BaseClass { }
At runtime it's decided which conrete class - B or C - is filled in myList.
To use NHibernate I wrote a map class for each entity A,B,C - but not for the base class (Is there a way to do that - I've some redundant code for the attributes of the base class??)
class AMap : ClassMap<A> { ...... HasMany(x => x.myList).Inverse().Cascade.All().KeyColumn("xyz"); ..... }
I end up with the error "Association references unmapped class: BaseClass" which is truly right - I don't have a map class for my BaseClass.
I tried it with SubClassMap but that did not solve the problem. How can I solve the problem?? Any help is urgently needed ...
|