protected function validateIdentifier(ClassMetadata $class) : void
    {
        if (! $class->identifier && ! $class->isMappedSuperclass && ! $class->isEmbeddedDocument && ! $class->isQueryResultDocument) {
            throw MappingException::identifierRequired($class->name);
        }
    }