Fix usage of deprecated entity.manager