title: Search criteria with Result and Count in Hibernate
body: <p>I have search criteria with multiple field in the table. Is it possible to use same hibernate criteria object to get Result (with setFirstResult and setMaxResult) and count for Pagination? I mean the result set for my search criteria with pagination and the total number of result for that specific search criteria.</p>
  
  <p>Steps:</p>
  
  <ol>
  <li>Create criteria with my search parameter.  </li>
  <li>Set first and max result parameter.</li>
  <li>Create row count projection. (This should return total count of my search parameter, not within my first and max result parameter).</li>
  <li>Get current page result set.</li>
  <li>Get total count for search criteria.</li>
  </ol>