// this should happen at DAO creation
// begin Hibernate transaction
//HibernateUtil.beginTransaction();
// create DAO instance
AdministratorDAO dao = new AdministratorDAO();
if (dao == null){
throw new AuthenticationException ("Error initializing dao");
}
// create example object for query
Administrator loginAdministrator = new Administrator();
loginAdministrator.setUsername(username);
// find member object by example
Collection matchingAdministrators = dao.findByExample(loginAdministrator);
Iterator memberIter = matchingAdministrators.iterator();
if (memberIter.hasNext()) {
loginAdministrator = (Administrator) memberIter.next();
} else loginAdministrator = null;