title: Hibernate Projection with aggregate function
body: <p>I am trying to run a query which is built using Hibernate Criteria api</p>
  
  <pre><code> List results = session.createCriteria(Person.class)
  .setProjection( Projections.projectionList()
      .add( Projections.rowCount())
      .add( Projections.property("name"))
      .add( Projections.property("age"))
  ).list();
  </code></pre>
  
  <p>But when i am running this query i am getting an error </p>
  
  <pre><code> "ORA-00937: not a single-group group function"
  </code></pre>
  
  <p>What is the reason behind this error.</p>