How to implement "select sum ()" in Grails
I have a connection like this:
class E {
string name
hasMany = [me:ME]
}
class M {
float price
}
class ME {
E e
M m
int quantity
}
And I wouldn't like to iterate to achieve this: "get the sum of the quantity in ME times when the price is the corresponding M for a given E".
Any hints on how to implement it with GORM / HQL?
Thanks in advance
+2
a source to share