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

  1. when using select c.id chargeback cc join cc.customer c group c order max(cc.created) work.
  2. 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

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -