Why do you need to fetch the class metadata here for comparison? Isn't it enough to compare the class names of both entities because without knowing any better I would assume two calls to `$this->em->getClassMetadata()` with the same class name to return the exact same result, no?