01: package auction.dao.hibernate;
02:
03: import org.hibernate.*;
04: import auction.dao.UserDAO;
05: import auction.model.*;
06: import static org.hibernate.criterion.Expression.*;
07:
08: public class UserDAOHibernate extends GenericHibernateDAO<User, Long>
09: implements UserDAO {
10:
11: public User validateLogin(User user) {
12: Criteria crit = getSession().createCriteria(
13: getPersistentClass());
14: crit.add(eq("username", user.getUsername()));
15: crit.add(eq("password", user.getPassword()));
16: return (User) crit.uniqueResult();
17: }
18:
19: }
|