title: Doctrine: Cannot select entity through identification variables without choosing at least one root entity alias
body: <p>I'm using the following code in the <strong>query builder</strong>, to select an average of score values, and the category entity to which that average belongs:</p>
  
  <pre><code>$queryBuilder = $this-&gt;createQueryBuilder('s')
      -&gt;resetDQLPart('select')
      -&gt;select('AVG(s.score) as score, partial c.{reviewCategoryID} as cat')
      -&gt;setParameter('status', ReviewStatusType::ACCEPTED)
      -&gt;join('s.review', 'r')
      -&gt;join('s.category', 'c')
      -&gt;where('r.campsite = :campsite')
      -&gt;andWhere('r.status = :status')
      -&gt;setParameter('campsite', $campsite)
      -&gt;groupBy('c.reviewCategoryID');
  </code></pre>
  
  <p><code>$campsite</code> is an entity to which a review belongs, while scores belong to a review, and scores have a category.</p>
  
  <p>But when I try to execute this, i get the error</p>
  
  <pre><code>Error: Cannot select entity through identification variables without choosing at least one root entity alias.
  </code></pre>
  
  <p>When I debug and I check the root aliases, I see that 's' is defined, which is  should be the root entity (Score).</p>
  
  <p>Any idea what could be wrong?</p>