Added test for DAOs, avoided deprecated method buildSessionFactory().