public function guessChoiceLabelFromClass($entity)
    {
        $metadata = $this->metadataFactory->getClassMetadata($entity)->getMetadata();
        foreach ($metadata[0]->fieldMappings as $fieldName => $field) {
            if ($field['type'] == 'string') {
                return $fieldName;
            }
        }
        //if no string field found, return id
        return 'id';
    }