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

org.phoenix.basic.paging.SystemContext Maven / Gradle / Ivy

Go to download

对hibernate4的封装。封装了Druid,通过Druid可以轻量级的对其他数据库进行操作

The newest version!
package org.phoenix.basic.paging;

/**
 * 用来传递列表对象的ThreadLocal数据
 * @author Administrator
 *
 */
public class SystemContext {
	/**
	 * 分页大小
	 */
	private static ThreadLocal pageSize = new ThreadLocal();
	/**
	 * 分页的起始页
	 */
	private static ThreadLocal pageOffset = new ThreadLocal();
	/**
	 * 列表的排序字段
	 */
	private static ThreadLocal sort = new ThreadLocal();
	/**
	 * 列表的排序方式
	 */
	private static ThreadLocal order = new ThreadLocal();
	
	private static ThreadLocal realPath = new ThreadLocal();
	
	
	
	public static String getRealPath() {
		return realPath.get();
	}
	public static void setRealPath(String _realPath) {
		SystemContext.realPath.set(_realPath);
	}
	public static Integer getPageSize() {
		return pageSize.get();
	}
	public static void setPageSize(Integer _pageSize) {
		pageSize.set(_pageSize);
	}
	public static Integer getPageOffset() {
		return pageOffset.get();
	}
	public static void setPageOffset(Integer _pageOffset) {
		pageOffset.set(_pageOffset);
	}
	public static String getSort() {
		return sort.get();
	}
	public static void setSort(String _sort) {
		SystemContext.sort.set(_sort);
	}
	public static String getOrder() {
		return order.get();
	}
	public static void setOrder(String _order) {
		SystemContext.order.set(_order);
	}
	
	public static void removePageSize() {
		pageSize.remove();
	}
	
	public static void removePageOffset() {
		pageOffset.remove();
	}
	
	public static void removeSort() {
		sort.remove();
	}
	
	public static void removeOrder() {
		order.remove();
	}
	
	public static void removeRealPath() {
		realPath.remove();
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy