Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 HQL,您如何加入非 PK/FK 的列(或对象属性)?
我正在阅读文档,它似乎隐含地要加入 PK 列,对吗?
https://www.hibernate.org/hib_docs/nhibernate/html/queryhql.html
HQL 在外键上“隐式”连接。如果您没有(映射)关系,只需制作笛卡尔积并加入 where 子句。
select order.id from Order as o, Product as p where o.productKey = p.Key
从 Order as o 中选择 order.id,Product as p 其中 o.productKey = p.Key
那将是一个内连接,有没有办法可以使用隐式连接来做一个左外连接。