title: doctrine create query with 2 association
body: <p>i have this entity</p>
  
  <p>Post</p>
  
  <pre><code> /**
   * @ORM\ManyToOne(targetEntity="SottoCategoria")
   * @ORM\JoinColumn(name="sottocategoria_id", referencedColumnName="id", nullable=false)
   */
  public $sottocategoria;
  </code></pre>
  
  <p>SottoCategoria</p>
  
  <pre><code> /**
   * @ORM\ManyToOne(targetEntity="Categoria")
   * @ORM\JoinColumn(name="categoria_id", referencedColumnName="id", nullable=false)
   */
  public $categoria;
  </code></pre>
  
  <p>Categoria</p>
  
  <pre><code>/**
   * @ORM\OneToMany(targetEntity="SottoCategoria", mappedBy="categoria")
   */
  protected $sottocategorie;
  </code></pre>
  
  <p>how can I make this query? i need to find all post from categoria</p>
  
  <p>post.sottocategoria.categoria</p>
  
  <pre><code> $query = $repository-&gt;createQueryBuilder('p')
                      -&gt;where('p.enabled = :enabled AND p.sottocategoria.categoria = :categoria')
                      -&gt;setParameters(array(
                          'enabled' =&gt; true,
                          'categoria' =&gt; $idCat,
                      ))
  </code></pre>
  
  <p>i can't use p.categoria because i not have relation with post</p>
  
  <p>my relation is  post  ->  sottocategoria -> categoria
  so my question is how i get all post from categoria? i have to use innerjoin?</p>