title: MyBatis RowBounds doesn't limit query results
body: <p>I am developing an stateless API that needs to support pagination. </p>
  
  <p>I use an Oracle database. 
  I use Spring with MyBatis for database access.</p>
  
  <p>From the documentation, I understand that I can use the RowBounds class to limit the number of rows returned by the query.</p>
  
  <p>However, it seems that there's no special optimization done to the query to support pagination. </p>
  
  <p>For example, if I set RowBounds to offset 100 with 50 records, I'd expect the query to have the following added:</p>
  
  <pre><code>(original query with the where clause...)
  and ROWNUM &lt; 150
  and ROWNUM &gt;= 100
  </code></pre>
  
  <p>But there's nothing there, it's just the query that I defined manually. </p>
  
  <p>This is terrible for performance, since I might have several thousand results.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Thanks.</p>