-->
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: How to use Airthmetic operator in hibernate Query
PostPosted: Sat Jul 30, 2005 7:51 am 
Newbie

Joined: Sat Jul 30, 2005 7:44 am
Posts: 15
Hi everybody,I am writing a hibernate query that multiply two attributes and takes it sum, but when I use * operator,it gives error "* only allowed inside aggregate function in SELECT " . HQL query is :

****************************************************************
Select
sum(postab.subtotal),
sum(postab.tax),
sum(postab.total),
count(postab.checknum) ,
Sum((postab.subtotal)*(loc.royalty)/100)
From
com.infonox.hibernate.Location as loc,
com.infonox.hibernate.Postables as postab
where loc.restaurantid = postab.restaurantid

****************************************************************

Line which is creating problem is

Sum((postab.subtotal)*(loc.royalty)/100)
Is there any other way to take product of two attributs? your help will be greatly appreciated as it is really stumbling block in my project. Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 30, 2005 10:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use HB3


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 31, 2005 11:22 pm 
Newbie

Joined: Sat Jul 30, 2005 7:44 am
Posts: 15
gavin wrote:
Use HB3


Hi Gavin , Thanks a lot, Is there no way of doing it in HB2.0?


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.