title: Invalid PathExpression. StateFieldPathExpression or SingleValuedAssociationField expected
body: <p>I have the following query:</p>
  
  <pre><code>$query = $em-&gt;createQueryBuilder()-&gt;select('s', 'COUNT(pictures) AS HIDDEN items')
                    -&gt;from("MainBundle:InstagramShop", 's')
                    -&gt;innerJoin('s.userPictures', 'pictures')
                    ;
  
        $query-&gt;andWhere('s.id &gt; :shopId');
        $query-&gt;andWhere('pictures.style = :style');
        $query-&gt;andHaving('items &gt;= 4');
  </code></pre>
  
  <p>and for some reason it gives me the following error:</p>
  
  <pre><code>[Semantical Error] line 0, col 151 near 'style = :style': Error: Invalid PathExpression. StateFieldPathExpression or SingleValuedAssociationField expected.
  </code></pre>
  
  <p>I have an InstagramShop which has a many to one relationship with InstagramShopPictures:</p>
  
  <p>Here's the entity:</p>
  
  <pre><code>    class InstagramShopPicture
      {
  
            /**
           * @Exclude()
           * @ORM\OneToMany(targetEntity="App\MainBundle\Entity\InstagramPictureStyle",         
             mappedBy="picture", cascade={"persist","remove"})
           */
           protected $style; 
  
  
          /**
           * @Exclude()
           * @ORM\ManyToOne(targetEntity="InstagramShop", inversedBy="userPictures")
           * @ORM\JoinColumn(name="shop_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
           */
          protected $shop;
      }
  </code></pre>
  
  <p>and here's InstagramShop</p>
  
  <pre><code>class InstagramShop
  {
       /**
       * @Exclude()
       * @ORM\OneToMany(targetEntity="InstagramShopPicture", mappedBy="shop", cascade={"persist"})
       * @ORM\OrderBy({"created" = "DESC"})
       */
      protected $userPictures;
  }
  </code></pre>
  
  <p>any idea why?</p>