hibernate - JPQL: why 'group by' does not work properly -
executing jpql using hibernate 4.2.5:
select c chargeback cc join cc.customer c group c order max(cc.created)
usecase: show customers latest chargbacks.
produces org.hibernate.exception.sqlgrammarexception: not extract resultset
- when using
select c.id chargeback cc join cc.customer c group c order max(cc.created)
work. - when using
select c chargeback cc join cc.customer c group c.id, c......all columns order max(cc.created)
is bug? why jpql not include *? (from usecase necessary)
no need - native sql of course solve it. assume jpql mature.
there feature request this: hhh-1615.
however, keep in mind grouping columns may not best option performance-wise.
Comments
Post a Comment