All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jeesuite.mybatis.plugin.pagination.PageExecutor Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
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