title: Query builder ManyToMany relationship
body: <p>I'm facing some troubles with query builder in many to many relationship.</p>
  
  <p>I have an entity Company which have subcompanies as well, so I have:</p>
  
  <pre><code>class Company {
  
  private $id;
  
  /**
  * @var ArrayCollection
  * 
  * @ORM\ManyToMany(targetEntity="Company")
  * @ORM\JoinTable(name="company_relation", 
  *   joinColumns={ 
  *     @ORM\JoinColumn(name="id", referencedColumnName="id")
  *   },
  *   inverseJoinColumns={ 
  *     @ORM\JoinColumn(name="subcompany", referencedColumnName="id")
  *   }
  * )
  */    
  private $ChildrenCompany;
  
  [...]
  
  }
  </code></pre>
  
  <p>Then I'm trying to make a query builder which returns companies which have determinated subcompanies (for example subcompany with id 5). I tried in two ways:</p>
  
  <p>method A)</p>
  
  <pre><code>$query-&gt;select ('c');
  $query-&gt;from(MyBundle:Company, 'c');
  $query-&gt;leftJoin('c.ChildrenCompany','j');
  $query-&gt;where('j.subcompany = 5'); 
  </code></pre>
  
  <p>It doesn't work and give me the error: Class Application\Sademer\CoreBundle\Entity\Company has no field or association named subcompany</p>
  
  <p>method B)</p>
  
  <pre><code>$query-&gt;select ('c');
  $query-&gt;from(MyBundle:Company, 'c');
  $query-&gt;where('j.ChildrenCompany = 5'); 
  </code></pre>
  
  <p>It doesn't work and give me the error: Invalid PathExpression. StateFieldPathExpression or SingleValuedAssociationField expected.</p>