-->
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: Greater Than AND Less Than Sort for a VARCHAR column
PostPosted: Thu Feb 07, 2013 6:17 pm 
Newbie

Joined: Thu Feb 07, 2013 4:54 pm
Posts: 1
Hello everyone!

I am new to the hibernate world and I am trying to pull records out of a db (oracle 10) with user input.

Essentially -- SELECT * FROM table WHERE userinput is < rangeOne AND > rangeTwo

The rows for comparison are VARCHAR2. As this is a rather large db, I really do not wish to hit it three times per record to make every compare.

I have tried using:

Code:
criteria.add(Restrictions.ge("rangeOne", userInput);
criteria.add(Restrictions.le("rangeTwo",userInput);


Those however did not yield the results I expected. I expect it is because the fields are alphnumeric.

Do the hibernate criterias offer an easy way to do this?

Any thoughts or suggestions on how this could be done would be great.


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.