Class PageMethod

java.lang.Object
org.aoju.bus.pager.proxy.PageMethod
Direct Known Subclasses:
PageContext

public abstract class PageMethod extends Object
基础分页方法
Since:
Java 17+
Author:
Kimi Liu
  • Field Details

    • LOCAL_PAGE

      protected static final ThreadLocal<Page> LOCAL_PAGE
    • DEFAULT_COUNT

      protected static boolean DEFAULT_COUNT
  • Constructor Details

    • PageMethod

      public PageMethod()
  • Method Details

    • getLocalPage

      public static <T> Page<T> getLocalPage()
      Type Parameters:
      T - 对象
      Returns:
      结果
    • setLocalPage

      protected static void setLocalPage(Page page)
      设置 Page 参数
      Parameters:
      page - 分页对象
    • clearPage

      public static void clearPage()
      移除本地变量
    • count

      public static long count(Querying select)
      获取任意查询方法的count总数
      Parameters:
      select - 查询对象
      Returns:
      the long
    • startPage

      public static <E> Page<E> startPage(Object params)
      开始分页
      Type Parameters:
      E - 对象
      Parameters:
      params - 参数
      Returns:
      结果
    • startPage

      public static <E> Page<E> startPage(int pageNo, int pageSize)
      开始分页
      Type Parameters:
      E - 对象
      Parameters:
      pageNo - 页码
      pageSize - 每页显示数量
      Returns:
      结果
    • startPage

      public static <E> Page<E> startPage(int pageNo, int pageSize, boolean count)
      开始分页
      Type Parameters:
      E - 对象
      Parameters:
      pageNo - 页码
      pageSize - 每页显示数量
      count - 是否进行count查询
      Returns:
      结果
    • startPage

      public static <E> Page<E> startPage(int pageNo, int pageSize, String orderBy)
      开始分页
      Type Parameters:
      E - 对象
      Parameters:
      pageNo - 页码
      pageSize - 每页显示数量
      orderBy - 排序
      Returns:
      结果
    • startPage

      public static <E> Page<E> startPage(int pageNo, int pageSize, boolean count, Boolean reasonable, Boolean pageSizeZero)
      开始分页
      Type Parameters:
      E - 对象
      Parameters:
      pageNo - 页码
      pageSize - 每页显示数量
      count - 是否进行count查询
      reasonable - 分页合理化,null时用默认配置
      pageSizeZero - true且pageSize=0时返回全部结果,false时分页,null时用默认配置
      Returns:
      结果
    • offsetPage

      public static <E> Page<E> offsetPage(int offset, int limit)
      开始分页
      Type Parameters:
      E - 对象
      Parameters:
      offset - 起始位置,偏移位置
      limit - 每页显示数量
      Returns:
      结果
    • offsetPage

      public static <E> Page<E> offsetPage(int offset, int limit, boolean count)
      开始分页
      Type Parameters:
      E - 对象
      Parameters:
      offset - 起始位置,偏移位置
      limit - 每页显示数量
      count - 是否进行count查询
      Returns:
      结果
    • orderBy

      public static void orderBy(String orderBy)
      排序
      Parameters:
      orderBy - 排序
    • setStaticProperties

      protected static void setStaticProperties(Properties properties)
      设置参数
      Parameters:
      properties - 插件属性