MD5 and Hibernate Query
Posted
by
theJava
on Stack Overflow
See other posts from Stack Overflow
or by theJava
Published on 2011-01-10T15:21:52Z
Indexed on
2011/01/10
16:53 UTC
Read the original article
Hit count: 189
public Login authenticate(Login login) {
String query = "SELECT L FROM Login AS L WHERE L.email=? AND L.password=?";
Object[] parameters = { login.getEmail(), login.getPassword() };
List<Login> resultsList = (getHibernateTemplate().find(query,parameters));
if (resultsList.isEmpty()) {
//error dude
}
else if (resultsList.size() > 1) {
//throw expections
}
else {
Login login1 = (Login) resultsList.get(0);
return login1;
}
return null;
}
I have my DB tables password col set as MD5, now how to retrieve it back here.
© Stack Overflow or respective owner