title: Error in doctrine query : Binding an entity with a composite primary key to a query
body: <p>Hello i have an entity with two primary keys .</p>
  
  <pre><code>class UsefulnessEvaluation
  {
    /**
      * @ORM\Id
      * @ORM\ManyToOne(targetEntity="App\EvaluationBundle\Entity\Evaluation", cascade={"persist","remove"})
      */
      private $evaluation;
  
      /**
      * @ORM\Id
      * @ORM\ManyToOne(targetEntity="App\UserBundle\Entity\User", cascade={"persist","remove"})
      */
      private $user;
  
       /**
       *
       * @ORM\Column(type="string", nullable=false)
       */
      private $type;
  
       /**
       * @ORM\Column(type="datetime", nullable=false)
       */
      private $createdAt;
  //etc
  }
  </code></pre>
  
  <p>I want , in repository , count the number of an evaluation: </p>
  
  <pre><code>class UsefulnessEvaluationRepository extends EntityRepository
  {
  
    public function countEvaluationLikes($evaluation_id)
    {   
          $query = $this-&gt;getEntityManager()-&gt;createQuery(
           'SELECT count(p.evaluation) as nbre
            FROM AppEvaluationBundle:UsefulnessEvaluation p
            WHERE p.evaluation = :id
  
           )-&gt;setParameter('id', $evaluation_id);
        return $query-&gt;getSingleScalarResult();
    }
  
  }
  </code></pre>
  
  <p>this is the error :</p>
  
  <blockquote>
    <p>Binding an entity with a composite primary key to a query is not
    supported. You should split the parameter into the explicit fields and
    bind them separately.</p>
  </blockquote>