Hi everyone.
My problem is as follow:
When I query the database by using this ....
//This is to perform range search public List<User> searchIdRange(String userid_from, String userid_to) { List<User> userInfo = new ArrayList<User>();
userInfo = currentSession().createQuery("from User usertable where usertable.userid >= ? AND usertable.userid <= ?").setParameter(0, userid_from).setParameter(1, userid_to).list();
return userInfo ; }
At database, userid username 1 NameA 2 NameB 4 NameC 5 NameD
If I pass 1 as userid_from and 2 as the userid_to, hibernate return successfully the the list with 2 records.
However, if I pass 1 as userid_from and 5 as the userid_to, hibernate return empty list to me.
It should return 4 records of list, what is the reason of it?
This problem almost ruin my life!! Does anyone know the answer!!!?
|