Removed call to deprecated getEntityManager