cleaning up identifier mapping validation
recommend to use documentManager->getUnitOfWork()->getDocumentId(document) instead of classMetadata->getIdentifierValue(document)
do not rely on id being mapped, where possible