com.jeesuite.mybatis.plugin.pagination.PageExecutor Maven / Gradle / Ivy
package com.jeesuite.mybatis.plugin.pagination;
import java.util.List;
public class PageExecutor {
private static ThreadLocal pageParamsHolder = new ThreadLocal<>();
public static interface PageDataLoader {
List load();
}
@SuppressWarnings("unchecked")
public static Page pagination(PageParams pageParams,PageDataLoader dataLoader ){
pageParamsHolder.set(pageParams);
List list = dataLoader.load();
return (Page) list.get(0);
}
public static PageParams getPageParams(){
return pageParamsHolder.get();
}
public static void clearPageParams(){
pageParamsHolder.remove();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy