Switch from hibernate session to EntityManager