cn.vonce.sql.provider.DynSchemaContextHolder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vonce-sqlbean-core Show documentation
Show all versions of vonce-sqlbean-core Show documentation
This is the core project of Sqlbean.
The newest version!
package cn.vonce.sql.provider;
/**
* 动态Schema持有者
*
* @author Jovi
* @version 1.0
* @email [email protected]
* @date 2021/6/19 00:23
*/
public class DynSchemaContextHolder {
private static final ThreadLocal contextHolder = new ThreadLocal<>();
/**
* 设置当前Schema
*
* @param schema
*/
public static void setSchema(String schema) {
contextHolder.set(schema);
}
/**
* 获取Schema
*
* @return
*/
public static String getSchema() {
return contextHolder.get();
}
/**
* 清除Schema
*/
public static void clearSchema() {
contextHolder.remove();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy