title: setFirstResult and setMaxResults doesnt work as expected
body: <p>I have a problem with paging in my application. I wanna use setFirstResult and setMaxResults methods, but it gave me wrong output:</p>
  
  <p>(My database: SQLite)</p>
  
  <p>Example:</p>
  
  <pre><code>    Session session = HibernateUtil.getSessionFactory().openSession();
  
      int page = 0;
      int maxRows = 20;
  
      while (page &lt; 5) {
  
          Criteria criteria = session.createCriteria(Book.class);
          criteria.setFirstResult(page * maxRows).setMaxResults(maxRows);
          criteria.addOrder(Order.asc("id"));
          List&lt;Book&gt; list = criteria.list();
  
          System.out.println("FirstRow: " + page * maxRows + " - RowsLimit: " + maxRows);
          for (Book b : list) {
              System.out.println(b.getId());
          }
          page++;
      }
      session.close();
  </code></pre>
  
  <p>The output gave me:</p>
  
  <pre><code>FirstRow: 0 - RowsLimit: 20
  1
  .
  .
  .
  20
  FirstRow: 20 - RowsLimit: 20
  21
  .
  .
  .
  40
  FirstRow: 40 - RowsLimit: 20
  21
  .
  .
  .
  40
  FirstRow: 60 - RowsLimit: 20
  21
  .
  .
  .
  40
  </code></pre>
  
  <p>I have no idea why only first two "pages" are working correctly and after them it gave me the same range of rows.</p>
  
  <p>Thx for any advice</p>