这个问题解决 后, 我对Hibernate的查询功能更感兴趣了, 现在项目中一个查询是用如下的SQL下的, 想能不能用Criteria来表达呢?
select a.CORP_ID as groupbyScalar,a.aa as referenceScalar,b.bb as resultScalar
from
(select CORP_ID ,count(*) as aa from tableA where CORP_ID in ( 10,36,26,27,39,40,14,41,21,20) and ID not like 'M%' and NODE_TYPE like 'A%' group by CORP_ID ) a,
(select CORP_ID ,count(*) as bb from tableA where CORP_ID in ( 10,36,26,27,39,40,14,41,21,20) and ID not like 'M%' and NODE_TYPE like 'A%' and OVERPROOF>1 and NODE_BUSINESS like '%集团%' group by CORP_ID ) b
where a.CORP_ID = b.CORP_ID(+) order by a.CORP_ID asc
难点如下:
1, 好像Criteria不支持from后跟子查询?
2, 怎么把左外连接跟子查询结合起来?
先谢谢您!