title: Hibernate criteria with projection doesn't return the entity on which criteria is implemented
body: <p>I'm using spring-hibernate and using HibernateDAOSupport class.
  I have two tables mapped to each other in one-to-many fashion.
  I'm implementing the below criteria </p>
  
  <pre><code> DetachedCriteria criteria = getCriteria( "a" )
          .setProjection( Projections.projectionList()
                  .add( Projections.groupProperty("a.id" ) )
                  .add( Projections.count( "a.id" ), "count" )
                  )
          .createCriteria( "huApps", "hu")
          .addOrder( Order.desc( "count" ) )
          ;
  </code></pre>
  
  <p>this works well and create the below query</p>
  
  <pre><code>select
          this_.id as y0_,
          count(this_.id) as y1_ 
      from
          apps this_ 
      inner join
          huapps huapp1_ 
              on this_.id=huapp1_.appid 
      group by
          this_.id 
      order by
          y1_ desc
  </code></pre>
  
  <p>In result, it returns a list of <code>object[]</code>. But I want that it should return <code>List&lt;App&gt;</code>(App is the class on which I implemented/created the criteria).
  I want that it would create the query </p>
  
  <pre><code>select
   this_
      from
          apps this_ 
      inner join
          huapps huapp1_ 
              on this_.id=huapp1_.appid 
      group by
          this_.id 
      order by
          y1_ desc
  </code></pre>
  
  <p>Please help me in writing the correct criteria.
  I also tried with <code>sqlProjection()</code> but even that didn't work.
  Is there any way I can achieve this?</p>