less dependant on hibernate (sessionFactory replaced by entityManager)