return (SecUser) DataAccessUtils.uniqueResult(getHibernateTemplate().findByCriteria(criteria));
}
@SuppressWarnings("unchecked")
public SecUser getUserByNameAndPassword(final String userName, final String userPassword) {
DetachedCriteria criteria = DetachedCriteria.forClass(SecUser.class);
criteria.add(Restrictions.eq("usrLoginname", userName));
criteria.add(Restrictions.eq("usrPassword", userPassword));
return (SecUser) DataAccessUtils.uniqueResult(getHibernateTemplate().findByCriteria(criteria));
}