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.  [ 1 post ] 
Author Message
 Post subject: Criteria API versus HQL Expression Support differences?
PostPosted: Wed Nov 14, 2007 8:42 pm 
Newbie

Joined: Wed Nov 14, 2007 8:19 pm
Posts: 5
Hibernate version:3.30GA

It appears that HQL expression support is more expansive than exression support under the Criteria API. Are there Criteria Query class functions that support any of the following, and if so where?:

1. stardard math operators such as: * / + -

2. EJB-QL 3.0: substring(), trim(), lower(), upper(), length(),
locate(), abs(), sqrt(), bit_length(), mod()

3. database-supported SQL scalar function like sign(), trunc(), rtrim(), sin()

I can't seem to find any Restrictions or Projections that support these constructs. IOW, I'd like to do the following SQL with the Criteria API without resorting to direct SQL usage, such as Restrictions.sqlRestriction(). For example, if I just want to add two fields together in the where clause (f1 +f2) > 100, do I have to use Restrictions.sqlRestriction() or is there an some kind of alternative alternative?


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

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.