是否可以使用 NHibernate 的条件 API 获取以下 SQL 查询?
SELECT a.someColumn FROM aTable a LEFT OUTER JOIN (SELECT * FROM bTable WHERE xyz = 'something') b on a.Id = b.Id
是否可以使用 NHibernate 的条件 API 获取以下 SQL 查询?
SELECT a.someColumn FROM aTable a LEFT OUTER JOIN (SELECT * FROM bTable WHERE xyz = 'something') b on a.Id = b.Id
You can perform a SQL sub-select using NHibernate DetachedCriteria like explained here. For the query you provided, why not just do:
SELECT a.someColumn FROM aTable a LEFT OUTER JOIN bTable b on a.Id = b.Id WHERE b.xyz = 'something'