title: "Invalid PathExpression. Must be a StateFieldPathExpression" in query builder with non related entities
body: <p>I have four entities: <code>OfficialDocument</code>, <code>Media</code>, <code>NMediaStatus</code> and <code>NMediaType</code>. I'm trying to translate this SQL:</p>
  
  <pre><code>SELECT od.media, od.type, od.status, md.url, nms.name 
      FROM official_document od 
      LEFT JOIN media md ON od.media = md.id 
      LEFT JOIN n_media_status nms ON od.status = nms.id
      WHERE od.company = 9 
  </code></pre>
  
  <p>to Doctrine Query Builder and this is the result:</p>
  
  <pre><code>public function findOfficialDocument($company_id) {
      $qb = $this-&gt;getEntityManager()-&gt;createQueryBuilder();
  
      $qb-&gt;select('od.media', 'od.type', 'od.status', 'md.url', 'nms.name', 'nmt.name');
      $qb-&gt;from('Company\RegisterCompanyBundle\Entity\OfficialDocument', 'od');
      $qb-&gt;leftJoin('Common\MediaBundle\Entity\Media', 'md', \Doctrine\ORM\Query\Expr\Join::WITH, 'od.media = md.id');
      $qb-&gt;leftJoin('Common\MediaBundle\Entity\NMediaStatus', 'nms', \Doctrine\ORM\Query\Expr\Join::WITH, 'od.status = nms.id');
      $qb-&gt;leftJoin('Common\MediaBundle\Entity\NMediaType', 'nmt', \Doctrine\ORM\Query\Expr\Join::WITH, 'od.type = nmt.id');
  
      $qb-&gt;where('od.company = ?1');
      $qb-&gt;setParameter(1, $company_id);
  
      return $qb-&gt;getQuery()-&gt;getResult();
  }
  </code></pre>
  
  <p>But any time I call the function from my controller I get this error:</p>
  
  <blockquote>
    <p>[Semantical Error] line 0, col 10 near 'media, od.type,': Error:
    Invalid PathExpression. Must be a StateFieldPathExpression.</p>
    
    <p>[1/2] QueryException: SELECT od.media, od.type, od.status, md.url,
    nms.name, nmt.name FROM
    Company\RegisterCompanyBundle\Entity\OfficialDocument od LEFT JOIN
    Common\MediaBundle\Entity\Media md WITH od.media = md.id LEFT JOIN
    Common\MediaBundle\Entity\NMediaStatus nms WITH od.status = nms.id
    LEFT JOIN Common\MediaBundle\Entity\NMediaType nmt WITH od.type =
    nmt.id WHERE od.company = ?1</p>
  </blockquote>
  
  <p><code>OfficialDocument</code> is related to the other three entities, but since I don't need the <code>reversedBy</code> in those entities then I tough this is causing the error, or maybe not, not sure about it. Anyway, any advice or help to fix this issue?</p>
  
  <p>PS: I'm using latest Symfony2 and Doctrine2 if you need to take a look to my entities here they are: <a href="https://gist.github.com/paquitodev/9786689">OfficialDocument</a>, <a href="https://gist.github.com/paquitodev/9786734">Media</a>, <a href="https://gist.github.com/paquitodev/9786755">NMediaStatus</a>, <a href="https://gist.github.com/paquitodev/9786772">NMediaType</a></p>