Please can someone post an example how to use simple SQL native query to return instances of class Person which extends the class Subject and is mapped as joined subclass? I don't know how to tell NHibernate I need columns from two tables to bind to one class.
The only way I found is to hack it by typing query following way:
Code:
SELECT {c.*}
FROM Company c
INNER JOIN Subject c_1_ ON c_1_.id_Subject = c.id_Company
It works because
{c.*} is translated to:
-
c.ColumnName for properties in Company table
-
[c_1_].ColumnName for properties in Subject table
And it really is not the way I want to use? Is there any example somewhere?
Many thanks![/b]