-->
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: How to Subtract Two Column From Criteria or Restrictions ?
PostPosted: Thu Jun 14, 2012 4:55 am 
Newbie

Joined: Thu Jun 14, 2012 4:46 am
Posts: 1
How to Subtract Two Column From Criteria or Restrictions ?
e.g. I need Like this query :
Where tolMarks != (firstMarks - secondMarks)


Top
 Profile  
 
 Post subject: Re: How to Subtract Two Column From Criteria or Restrictions ?
PostPosted: Tue Jun 19, 2012 3:26 pm 
Expert
Expert

Joined: Sat Jan 17, 2004 2:57 pm
Posts: 329
Location: In the basement in my underwear
As an example...

criteria.add(Restrictions.sqlRestriction("{alias}.net_total + {alias}.tax_total >=?", new Object[]{minAmt}, new Type[]{StandardBasicTypes.BIG_DECIMAL}));

_________________
Some people are like Slinkies - not really good for anything, but you still can't help but smile when you see one tumble down the stairs.


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.