title: How to get sum(boolean) as integer in hibernate's criteria query?
body: <p>In a simple 'vote up / vote down' scenario , I want to sum the total 'up' count . </p>
  
  <pre><code>criteria.add(Restrictions.eq("vote" , Boolean.TRUE));
  criteria.setProjection(Projections.rowCount());
  </code></pre>
  
  <p>The generated SQL is <code>sum(this_.vote) as y1_</code>  and generates correct sum value , but hibernate parsed it as 'boolean' value , all become 'true' ...</p>
  
  <p>How to solve it ? ( if I don't need to change the 'vote' from boolean to integer )</p>
  
  <p>environment : hibernate-3.6.0 , jpa2</p>
  
  <p>Thanks a lot !</p>