that calls the getList method that actually executes the SQL.
list = mappedStatement.executeQueryForList(connection, parameterObject, (idx) * pageSize, pageSize);
What if you could optimize these two calls into one SQL call. You could manually split the resultlist into two lists and put the sublist into: currentlist and nextlist.
Also the nextPage() and previousPage() could be changed to always one execute one SQL call as the constructor.
/Claus
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey, that's a very cool idea! I went with the most direct approach, but this almost seems more obvious....guess I should limit my late-night programming... ;-)
Thanks for sharing your great ideas Claus.
Cheers,
Clinton
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Clinton
The constructor of the paginatedList calls the:
pageTo(0);
that will execute two queries:
- one for the current list
- one for the next list
currentPageList = getList (index);
nextPageList = getList (index + 1);
that calls the getList method that actually executes the SQL.
list = mappedStatement.executeQueryForList(connection, parameterObject, (idx) * pageSize, pageSize);
What if you could optimize these two calls into one SQL call. You could manually split the resultlist into two lists and put the sublist into: currentlist and nextlist.
Also the nextPage() and previousPage() could be changed to always one execute one SQL call as the constructor.
/Claus
Hey, that's a very cool idea! I went with the most direct approach, but this almost seems more obvious....guess I should limit my late-night programming... ;-)
Thanks for sharing your great ideas Claus.
Cheers,
Clinton