public function __construct(Connection $connection, DbalMapper $targetMapper, PropertyMetadata $metadata)
{
$this->connection = $connection;
$this->targetMapper = $targetMapper;
$this->targetRepository = $targetMapper->getRepository();
$this->metadata = $metadata;
$this->joinStorageKey = $targetMapper->getStorageReflection()->convertEntityToStorageKey($this->metadata->relationship->property);
}