Hi all,
I'm having an issue with the "table-per-concrete-class" inheritance mapping strategy used with a criteria query. The problem is that when I set the order and paging limitations on the criteria, I get back a separate set of results for each concrete class "glued" together.
For example, I have two classes Customer and Employee that both inherit from Person, mapped using the "table-per-concrete-class" strategy. I use a criteria query as follows:
Code:
public IList<Person> Foo()
{
ICriteria criteria = Session.CreateCriteria(typeof(Person));
criteria.SetFirstResult(0);
criteria.SetMaxResults(50);
criteria.AddOrder(new Order("LastName", true));
return criteria.List<Person>();
}
What Foo() actually returns is a list of 100 Person objects where the first 50 are Customer objects and the last 50 are Employee objects, each set of 50 ordered by the LastName property. Is this a limitation of the "table-per-concrete-class" strategy?
Thanks,
Matt
p.s. I'm using NHibernate 1.2.0 GA