How to join PK / FK columns using HQL?

Using HQL, how do you join columns (or object properties) that are not PK / FK?

I am reading the docs and it seems like it is implicitly going to join the PK columns correctly?

https://www.hibernate.org/hib_docs/nhibernate/html/queryhql.html

+1


a source to share


2 answers


HQL is attached "implicitly" to foreign keys. If you don't have a (mapped) relationship, just make a Cartesian product and join the where clause.



select order.id
from Order as o, Product as p
where o.productKey = p.Key

      

+2


a source


select order.id from Order as o, Product as p where o.productKey = p.Key



This will be an inner join, is there a way I can make the left outer using an implicit join.

+1


a source







All Articles