/**
* @see SystemDao#loginVerify(String, String)
*/
@SuppressWarnings("unchecked")
public OperatorEntity loginVerify(final String username,
final String password) {
// TODO Auto-generated method stub
final String hql = "from OperatorEntity as user where user.username=:username and user.password =:password";
List<OperatorEntity> list = getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Query query = session.createQuery(hql);
query.setParameter("username", username);
query.setParameter("password", ResStringTools
.encryptWithMD5(password));
return (List<OperatorEntity>) query.list();
}
});
OperatorEntity entity = null;
if (list.size() > 0) {
entity = list.get(0);
} else {
System.out.println("未找到记录!");
}
return entity;
}