-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Using aggregate functions on collections (bag)
PostPosted: Mon Apr 05, 2004 5:47 am 
Beginner
Beginner

Joined: Fri Apr 02, 2004 1:20 pm
Posts: 23
Hi

I have defined the following query but it does not parse:

select
sum(lifeAssured.benefits.sumInsured)
from
LifeAssured lifeAssured
where
lifeAssured.client.clientNumber = '12345678';

LifeAssured.benefits is a bag of type Benefit, Benefit has a property sumInsured of type BigDecimal. I have tried various combinations of the select clause including

select sum(elements(lifeAssured.benefits).sumInsured)

and

select sum(elements(lifeAssured.benefits.sumInsured))

but none of these parse -- can anyone help out with the syntax here? Do I need to make an inner join?

Thanks

Niall


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 06, 2004 9:20 am 
Beginner
Beginner

Joined: Fri Apr 02, 2004 1:20 pm
Posts: 23
Any hints?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.