使用hibernate 4.2.5执行JPQL:
select c from Chargeback as cc join cc.customer as c group by c order by max(cc.created)
用例:向客户展示最新的反馈。
生成org.hibernate.exception.SQLGrammarException:无法提取ResultSet
select c.id from Chargeback as cc join cc.customer as c group by c order by max(cc.created)
它会起作用。select c from Chargeback as cc join cc.customer as c group by c.id, c......all columns order by max(cc.created)
这是一个错误吗?为什么JPQL不包含*? (从这个用例来看,这是非常必要的)
无需 - 本机sql当然可以解决它。我们假设JPQL已经成熟。