title: Select count() in Doctrine DQL with left join manyToMany unidirectional relation where user does NOT have relation specific group
body: <h3>Situaction: I am trying to select count() in DQL for users NOT in specific group.</h3>
  
  <p>Standard ManyToMany unidirectional relation between <code>User</code> and <code>Group</code> entities from <code>FOSUserBundle</code> (and <code>SonataUserBundle</code>). System: Symfony 2.5, Doctrine 2.4.</p>
  
  <h3>Entity User</h3>
  
  <p><em>P.S. this is not real code copied. It is not possible because there are several layers extending with different config files in different formats and places, so if you spot mistype, this is not the problem.</em></p>
  
  <pre><code>namespace RAZ\UserBundle\Entity;
  /**
   * @ORM\Table(name="fos_user_user")
   */
  class User
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      protected $id;
  
      /**
       * @var Collection
       *
       * @ORM\ManyToMany(targetEntity="Group")
       * @ORM\JoinTable(name="fos_user_user_group")
       */
      protected $groups;
  }
  </code></pre>
  
  <h3>Entity Group</h3>
  
  <pre><code>namespace RAZ\UserBundle\Entity;
  /**
   * @ORM\Table(name="fos_user_group")
   */
  class Group
  {
  /**
       * @var integer
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      protected $id;
  }
  </code></pre>
  
  <h3>Question: can this even be done in DQL?</h3>
  
  <p>Question very similar to:  <a href="https://stackoverflow.com/questions/14417315/how-to-get-entities-in-a-many-to-many-relationship-that-do-not-have-a-correspond">How to get entities in a many-to-many relationship that do NOT have a corresponding linked entity with DQL and Doctrine?</a> The difference is I need to check for only one specific group.</p>
  
  <p>Working SQL (returns 1423):</p>
  
  <pre><code>SELECT COUNT(*) cnt
  FROM fos_user_user u
  LEFT JOIN fos_user_user_group dug ON u.id = dug.user_id AND dug.group_id = 70
  WHERE dug.user_id IS NULL
  </code></pre>
  
  <p>Incorrectly working DQL (returns 3208):</p>
  
  <pre><code>SELECT COUNT(u)
  FROM RAZUserBundle:User u
  LEFT JOIN u.groups dug WITH dug.id = 70
  WHERE dug IS NULL
  </code></pre>
  
  <p>Problem is DQL generates different SQL:</p>
  
  <pre><code>SELECT COUNT(u.id)
  FROM fos_user_user u
  LEFT JOIN fos_user_user_group ug ON u.id = ug.user_id
  LEFT JOIN fos_user_group g ON g.id = ug.group_id AND (g.id = 70)
  WHERE g.id IS NULL
  </code></pre>
  
  <p>Any suggestions?</p>