title: Hibernate Criteria paging
body: <p>Is there a way in JAVA hibernate to execute a criteria query and projections count on that same query in a single trip to the DB?</p>
  
  <p>The reason for wanting this is getting the most efficient way to page results, i was hoping to do the following</p>
  
  <pre><code>start transaction 
     start db call
       do query()
       do count()
     end db call
  end transaction
  </code></pre>
  
  <p>what i'm currently doing is </p>
  
  <pre><code>start transaction 
     start db call
       do query()
     end db call
     start db call
       do count()
     end db call
  end transaction
  </code></pre>