是否可以使用NHibernate的条件API获取以下SQL查询?
SELECT a.someColumn FROM aTable a LEFT OUTER JOIN (SELECT * FROM bTable WHERE xyz = 'something') b on a.Id = b.Id
答案 0 :(得分:0)
您可以使用NHibernate DetachedCriteria执行SQL子选择,如解释here。对于您提供的查询,为什么不这样做:
SELECT a.someColumn FROM aTable a LEFT OUTER JOIN bTable b on a.Id = b.Id WHERE b.xyz = 'something'