title: DQL joined relationship doesn't populate
body: <p>I have 2 entities: <code>User</code> and <code>Metadata</code>. They have a bi-directional one-to-many relationship (a user can have many metadata records).</p>
  <p>In a context decorator I'm using for <a href="https://github.com/bestit/flagception-bundle" rel="nofollow noreferrer">flagception</a>, I query the user and some of the user's relationships that may be needed using DQL:</p>
  <pre class="lang-php prettyprint-override"><code>$dql = &quot;
      SELECT user
      FROM
          \meQ\Entity\User user
          JOIN user.profile profile
          JOIN profile.client client
          JOIN user.metadata metadata
      WHERE user.uid = :user_id
  &quot;;
  
  $this-&gt;user = $em-&gt;createQuery($dql)
      -&gt;setParameter('user_id', $session_user-&gt;getId())
      -&gt;useQueryCache(true)
      -&gt;getOneOrNullResult();
  
  // for debug
  dump($this-&gt;user);
  exit();
  </code></pre>
  <p>This query returns the user, complete with the <code>user-&gt;profile</code> and <code>user-&gt;profile-&gt;client</code> fields populated correctly. However, it does not have its metadata field populated.</p>
  <p>The user in question has 18 metadata records, but performing <code>dump($this-&gt;user)</code> shows me an empty ArrayCollection:</p>
  <p><a href="https://i.stack.imgur.com/xoNgk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xoNgk.png" alt="metadata is an empty ArrayCollection" /></a></p>
  <p>Here is my Doctrine mapping for this relationship:</p>
  <pre class="lang-yaml prettyprint-override"><code>AppBundle\Entity\User:
      # ...
      oneToMany:
          metadata:
              fetch: EXTRA_LAZY
              targetEntity: AppBundle\Entity\UserMetadata
              mappedBy: user
              cascade: [all]
              orphanRemoval: true
              indexBy: name
  </code></pre>
  <p>and the other side of the relationship:</p>
  <pre class="lang-yaml prettyprint-override"><code>AppBundle\Entity\UserMetadata:
      # ...
      manyToOne:
          user:
              targetEntity: AppBundle\Entity\User
              inversedBy: metadata
              joinColumn:
                  name: user_id
                  referencedColumnName: uid
  
  </code></pre>
  <p>Does this not work because User isn't the owning side?</p>