How do you join two tables in NHibernate?

I need to do a join of two tables using NHibernate and HQL. I have found very little help on the Internet, and I want to know if this is possible, and if so, how?

+5
source share
3 answers

Found my answer:

http://www.hibernate.org/117.html#A21

It currently does not support union or intersection.

+2
source

You can use a named SQL query and do the join in raw SQL. NHibernate will be able to populate entity instances from the sql query and return them as the result of the query. See here and here .

+1
source

I do not believe that HQL supports joins, but you can write your own write transformer and create the sql file manually.

0
source

Source: https://habr.com/ru/post/953198/


All Articles