mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
@@ -207,6 +207,14 @@ public interface PagedList<T> {
|
||||
*/
|
||||
int getPageSize();
|
||||
|
||||
/**
|
||||
* Return the index position of this page (Zero based).
|
||||
* <p>
|
||||
* This is a calculated value based on firstRow/maxRows.
|
||||
* </p>
|
||||
*/
|
||||
int getPageIndex();
|
||||
|
||||
/**
|
||||
* Return true if there is a next page.
|
||||
* <p>
|
||||
|
||||
@@ -73,6 +73,14 @@ public class LimitOffsetPagedList<T> implements PagedList<T> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPageIndex() {
|
||||
if (firstRow == 0) {
|
||||
return 0;
|
||||
}
|
||||
return ((firstRow - 1) / maxRows) + 1;
|
||||
}
|
||||
|
||||
public int getTotalPageCount() {
|
||||
|
||||
int rowCount = getTotalCount();
|
||||
|
||||
Reference in New Issue
Block a user