Use getManager() instead of getEntityManager()