hibernate - uniqueResult silently fails
- by robinmag
I have a login controller that use the hibernate uniqueResult method. Everything works fine when i test it in eclipse's tomcat server. But when i deploy my webapps to tomcat server (on the same machine) it fails: it always returns null even i use the correct credential.
Here is my hibernate code:
session.createCriteria(User.class)
.add(Restrictions.eq(User.USERNAME_FIELD, userName))
.add(Restrictions.eq(User.PASSWORD_FIELD, password)).uniqueResult();
Thank you!