|Implementing aggregate boolean functions in JPQL? [message #533496]
||Fri, 14 May 2010 05:28
| Dean Ashby
Registered: July 2009
I'm trying to implement the equivalent of an aggregate boolean AND function. The following query is based on pure SQL ideas taken from this article and although it shows what I'm trying to achieve, it's not valid JPQL:
NEW BookingSummaryDto( b.id, b.bookingReference, SUM(i.price), MIN(CASE WHEN i.paid THEN 1 ELSE 0 END) )
Booking AS b JOIN b.items AS i
The other methods described in the article don't appear to be possible with JPQL either as they involve sub-queries in the from clause.
Can anyone suggest a way to achieve this in JPQL?
Powered by FUDForum
. Page generated in 0.02213 seconds