I have following hierarchy:
ClassA->ClassB->ClassC->ClassD
ClassB has PropertyA. All classes are mapped as joined subclasses with table per-class.
Mapping is parsed with no errors but I get an error when I try to run a query:
ICriteria crit =session.CreateCriteria(typeof(ClassB));
crit.Add(Expression.Eq("PropertyA", value));
crit.List<ClassB>();
Error is as follows:
NHibernate.QueryException: could not resolve property: PropertyA of: ClassC
I seem to get another related error when persisting instances of ClassD but I'd rather fix this one first.
Why does it happen?