fix deprecated getEntityManager()