protected function getFieldForToOneAssociation($sourceAssociation)
    {
        $targetClassMetadata = $this->getClassMetadata($sourceAssociation['targetEntity']);
        $joinedColumn = reset($sourceAssociation['joinColumns']);

        if (!$joinedColumn) {
            // One-to-One referenced only in foreign table => do not create field
            return null;
        }

        $type = $this->getTypeForAssociation($sourceAssociation);

        $fieldName = $sourceAssociation['fieldName'];

        $inverseOf = $sourceAssociation['inversedBy'];

        $foreignTableName = $targetClassMetadata->getTableName();
        $foreignIdentifier = $targetClassMetadata->getIdentifier();
        //if(count($foreignIdentifier) > 1) die(__METHOD__.'::'.__LINE__.': '.$foreignTableName.' has more than one identifier : '.json_encode($foreignIdentifier));
        $foreignIdentifier = reset($foreignIdentifier);
        $reference = $foreignTableName . '.' . $foreignIdentifier;

        // $pivot is just the foreign key in current table
        $pivot = new Pivot($joinedColumn['name']);

        return new ForestField($fieldName, $type, $reference, $inverseOf, $pivot);
    }