public class PageQuery extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_PAGE_SIZE
默认分页大小
|
static String[] |
PAGE_NO |
static String[] |
PAGE_SIZE |
static String[] |
START |
| 构造器和说明 |
|---|
PageQuery() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
autoDetectPageWay(javax.servlet.http.HttpServletRequest req)
Detect which type to page by request parameters.
|
static Integer |
getParameter(javax.servlet.http.HttpServletRequest req,
String[] maybe,
int defaultValue)
根据 HttpServletRequest 和字符串数组返回一个整数。
|
static <T> PageResult<T> |
page(Query query,
Class<T> beanClz,
Integer start,
Integer limit)
Do the pagination.
|
static int |
pageNo2start(int pageNo,
int limit)
将页码和每页数量转换为起始位置
pageSize 转换为 MySQL 的 start 分页
|
static void |
setParams(PageResult<?> result,
int totalCount,
int start)
Calculate the parameters of pagination related, like total page.
|
public static final String[] START
public static final String[] PAGE_NO
public static final String[] PAGE_SIZE
public static final int DEFAULT_PAGE_SIZE
public static <T> PageResult<T> page(Query query, Class<T> beanClz, Integer start, Integer limit)
T - The type of result objectquery - Query objectbeanClz - The type of result object, null for Mapstart - The start positionlimit - The limit of records, equals to page sizepublic static void setParams(PageResult<?> result, int totalCount, int start)
result - The result objecttotalCount - The total count of recordsstart - The start positionpublic static int pageNo2start(int pageNo,
int limit)
pageNo - 页码limit - 每页数量public static Integer getParameter(javax.servlet.http.HttpServletRequest req, String[] maybe, int defaultValue)
req - 请求对象maybe - 字符串数组,包含可能的参数名public static boolean autoDetectPageWay(javax.servlet.http.HttpServletRequest req)
req - The request objectCopyright © 2016–2026 AJAXJS. All rights reserved.