Hibernate查询左外连接。

时间:2013-05-08 17:42:47

标签: hibernate hql

SELECT Table1.name,Table1.url,Table1.address,Table1.city,Table1.state,Table1.ErrorMsg as Msg,
sum(Table2.id IS NOT NULL) as QE,Table4.tp as PT FROM Table1
LEFT OUTER JOIN Table2 ON Table2.Table1Id=Table1.id
LEFT OUTER JOIN Table3 ON Table3 .id=Table1.pdId
LEFT OUTER JOIN Table4 ON Table4.venueId=Table3 .id
WHERE Table1.visible = 1 GROUP BY Table1.id ORDER BY Table1.name,Table1.city,Table1.state,QE,PT;

我是新手,hql已根据对象转换了所有内容,但基于如何在hql中构建左外连接,我是无能为力的。尝试使用 Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: 和聚合函数抛出: 线程“main”中的异常org.hibernate.hql.ast.QuerySyntaxException:期待CLOSE,在第1行附近找到'IS',请帮忙

0 个答案:

没有答案