A while ago. net enterprise-level training. When talking about the optimization of paging components, the teacher gave a three-page cache policy, so that the previous page does not need to be connected to the database, for the moment, I will not comment on the advantages and disadvantages of this method. First, let's take a look at the effect.
The definition of the object class is not mentioned. The difference may be that I set three objects, prepage, curpage, and nextpage, in the Oracle database, you only need to pay attention to rownum usage for SQL statements. I copy the SQL statements in reverse order ):
Select *
From (select rownum DD, F .*
From (select *
From Table1
Where id =: ID
And date> =: startdate
And date <: enddate
Order by date DESC) f
Where rownum <=: nextindex)
Where DD> lastindex
: The nextindex variable is the next index on the user-requested page: The lastindex variable is the previous index on the user-requested page. For example, if you want to view the data on the fourth page, nextindex = 50, lastindex = 20.