• Post Reply Bookmark Topic Watch Topic
  • New Topic

What's the correct way of writing HQL for ResultTransformer?  RSS feed

 
Jason Linkon
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mapping file:



What is the correct HQL to allow ResultTranformer to create an entity if I need to aggregate the value in field1 and field2?

I've tried


and



but they don't work, any suggestions?
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aggregate queries require that all properties that are not being aggregated must be in the Group by, so you need both the t.id and t.category in it.

Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!