title: Doctrine 2 DQL - how to select inverse side of unidirectional many-to-many query?
body: <p>I have two classes - Page and SiteVersion, which have a many to many relationship. Only SiteVersion is aware of the relationship (because the site is modular and I want to be able to take away and drop in the module that SiteVersion belongs to).</p>
  
  <p>How would I therefore select pages based on criteria of SiteVersion?</p>
  
  <p>For example, this doesn't work:</p>
  
  <pre><code>SELECT p FROM SiteVersion v JOIN v.pages p WHERE v.id = 5 AND p.slug='index'
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>[Doctrine\ORM\Query\QueryException]
  [Semantical Error] line 0, col -1 near 'SELECT p FROM': Error: Cannot select entity through identification variables without choosing at least one root entity alias.
  </code></pre>
  
  <p>Even though I can select "v" with this query.</p>
  
  <p>I think I could possibly resolve this by introducing a class for the relationship (a PageToVersion class) but is there any way without doing that, or making it bidirectional?</p>