【发布时间】:2016-11-01 18:30:13
【问题描述】:
我正在尝试在运行时创建的表上使用左外连接创建 HQL 查询。
下面的代码是简化的HQL查询,基本一样。。 左外连接子句中的任何内容都是在运行时创建的,并且不受联合中选择的数量的限制
select distinct r.Param1, r.Param2, r.Param3
from Classpath.Classname r
left outer join (
select something1, something2 from somewhere where something1 in (1,2,3)
union all
select something1, something2 from somewhere where something1 not in (5,8,9)
union all
select something1, something2 from somewhere where something1 = 10
) tblName on tblName.something = r.Param1
where other conditions
我怎样才能做到这一点?
【问题讨论】:
标签: sql nhibernate hql