-->
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.  [ 3 posts ] 
Author Message
 Post subject: Criteria API
PostPosted: Thu Sep 28, 2006 3:12 am 
Newbie

Joined: Sun Jun 25, 2006 12:27 pm
Posts: 5
Sorry, for my, may be newbie, question.

How can i get this select by Criteria API?

SELECT sum(p.sum*c.percent) FROM PAYMENT p, Commission c WHERE p.id = c.payment_id

Or this select can't be implemented by Criteria?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 28, 2006 7:43 am 
Regular
Regular

Joined: Thu Sep 22, 2005 1:53 pm
Posts: 88
Location: Rio de Janeiro
Hi ,

I think it should be possible using projections take a look at
chapter 15.7. Projections, aggregation and grouping

Good luck

_________________
DonĀ“t forget to rate!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 28, 2006 1:47 pm 
Newbie

Joined: Sun Jun 25, 2006 12:27 pm
Posts: 5
Yes now i can fetch p.sum and c.percent fields values. But how can i fetch p.sum*c.percent or sum(p.sum*c.percent).

How can i multiply p.sum and c.percent ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.