title: How to fetch join in Doctrine without a "real" foreign key?
body: <p>I need to "connet" an instance of <code>HolidayPackage</code> to <code>Discount</code> (one-to-one) and be able to fetch join when getting data from the repository. I.e:</p>
  
  <pre><code> // Inside a method of HolidayPackageRepository repository class
   $qb = $this-&gt;createQueryBuilder($alias = 'hp');
   $qb-&gt;leftJoin("$alias.discount", 'd')
      -&gt;addSelect('d'); // fetch join
  </code></pre>
  
  <p>The <strong>problem</strong> is that <code>discount</code> <strong>table is deleted and filled again every couple of hour</strong>, so <code>discount_id</code> cannot be a real foreign key. However identifiers may stay the same:</p>
  
  <pre><code>/**
   * @ORM\Entity()
   * @ORM\Table("holiday_package")
   */
  class HolidayPackage
  {
      /**
       * @ORM\Column(name="discount_id", type="integer", nullable=true)
       *
       * @var null|Discount
       */
      private $discount;
  }
  </code></pre>
  
  <p>How can I fetch join without a real foreign key?</p>