This needs to be EntityManager independent.