hibernate - uniqueResult silently fails
Posted
by robinmag
on Stack Overflow
See other posts from Stack Overflow
or by robinmag
Published on 2010-01-10T12:18:55Z
Indexed on
2010/05/20
10:10 UTC
Read the original article
Hit count: 224
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!
© Stack Overflow or respective owner