pagination - Select records by first row and page size -


i'm trying implement lazy loading , pagination in front end. i've been supplied following 2 variables front end:

  • firstrow - index of first record return in results of select query.
  • pagesize - total size of records select query must return, starting @ firstrow.

how can use them in select query in mybatis in order return desired subset of records?

there not magic pagination in mybatis write query subset using row number. pagination syntax vary depending on database, here oracle example.

select * (   select r.*, rownum rnum,   (# base query goes here #) r ) rnum >= (#{firstrow})  , rnum < #{firstrow} + #{pagesize} 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -