• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Aggregate function (sum) of a @CollectionOfElements property

 
Alex Ramirez
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone! I'm trying out Hibernate for the first time, and im loving it... but as exepected I've hit a bump.


I have a Quote class defined something like this:


As you see each quote can have many "product"

The Product class has the following properties


Now what i would like to do is get a sum of all the "price" values in all of the Quotes;

im trying this:


But no joy.


Can someone please help me figure this one out? I've really tried googling it but i always get some other kind of aggregate function examples.

Thanks!!


Alejandro
 
Alex Ramirez
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello Again, it seems this might do the trick:



Hope this helps someone else!

Cheers
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic