I need to do a union of two tables using NHibernate and HQL. I have found very little help online, and I want to know if it is possible and if so how?
+2
A:
Found my answer:
http://www.hibernate.org/117.html#A21
It doesn't currently support union or intersect.
Nick Berardi
2008-10-29 15:13:05
as of 07.Apr 2010 the link http://www.hibernate.org/117.html#A21 is dead
Chris
2010-04-07 10:49:02
A:
I don't believe HQL supports unions, but you can write your own record transformer and author the sql by hand.
jonnii
2008-10-29 15:14:18
A:
You could use a named sql-query and do the union in raw SQL. NHibernate will be able to populate entity instances from the sql-query and return those as the query result. See here and here.
Sean Carpenter
2008-11-04 00:55:41