I try to do a case sensitive equals on username with Hibernate (3.6.9) but it seems that the restriction is case insensitive. For example: \"AdMin\" or \"admin\
username
A simple workaround:
Login login = (Login) getHibernateTemplate().get(Login.class, username); if(login != null && !login.getUsername().equals(username)){ return null; } return login;