0

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?

Nikolay R
  • 957
  • 2
  • 11
  • 22

1 Answers1

0

Disregard this. My mapping was not valid - I should use multiple level joined-subclass hierarchy mapping:

<class
 <joined-subclass
  <joined-subclass
...

not linear mapping with extends attribute.

Nikolay R
  • 957
  • 2
  • 11
  • 22