unless you have the identifier mapped on your class, the metadata->getIdentifierValue method will not be able to return you something.

isn't uow getDocumentId populated as soon as persist was called?