title: Doctrine QueryBuilder : Uncaught exception
body: <pre><code>$qb = $this-&gt;doctrine-&gt;em-&gt;createQueryBuilder()                
              -&gt;from('User','u')
              -&gt;select('count(u.name)')
              -&gt;where('u.name = :name')
              -&gt;setParameter('name', $user-&gt;getUsername());
  </code></pre>
  
  <p>When I execute <code>$qb-&gt;getQuery()-&gt;getResult()</code>,
   I get this error: </p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'Doctrine\ORM\Query\QueryException' with message 'SELECT count(u.name) FROM User u WHERE u.name = :name' in /var/www/darkfrog/application/libraries/Doctrine/ORM/Query/QueryException.php:39Stack trace:</p>
    
    <p><code>#0</code> /var/www/darkfrog/application/libraries/Doctrine/ORM/Query/Parser.php(429): Doctrine\ORM\Query\QueryException::dqlError('SELECT count(u....')</p>
    
    <p><code>#1</code> /var/www/darkfrog/application/libraries/Doctrine/ORM/Query/Parser.php(854): Doctrine\ORM\Query\Parser->semanticalError('Class 'User' is...', Array)</p>
    
    <p><code>#2</code> /var/www/darkfrog/application/libraries/Doctrine/ORM/Query/Parser.php(1529): Doctrine\ORM\Query\Parser->AbstractSchemaName()</p>
    
    <p><code>#3</code> /var/www/darkfrog/application/libraries/Doctrine/ORM/Query/Parser.php(1426): Doctrine\ORM\Query\Parser->RangeVariableDeclaration()</p>
    
    <p><code>#4</code> /var/www/darkfrog/application/libraries/Doctrine/ORM/Query/Parser.php(1168): Doctrine\ORM\Query\Parser->IdentificationVariableDeclaration()</p>
    
    <p><code>#5</code> /var/www/darkfrog/application/libraries/Doctrine/ORM/Query/Parser.php(757): Doctrine\ORM\Query\Pars in /var/www/darkfrog/application/libraries/Doctrine/ORM/Query/QueryException.php on line 49</p>
  </blockquote>