gu.sql2java.parser.SqlSyntaxNormalizer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sql2java-manager Show documentation
Show all versions of sql2java-manager Show documentation
sql2java manager class package for accessing database
package gu.sql2java.parser;
import net.sf.jsqlparser.util.TablesNamesFinder;
/**
* SQL语句分析转换器基类
* 基于SQL语法对象实现对SQL的修改
* @author guyadong
* @since 3.17.0
*
*/
public class SqlSyntaxNormalizer extends TablesNamesFinder{
protected static final ThreadLocal changed = new ThreadLocal<>();
public SqlSyntaxNormalizer() {
super();
init(true);
}
/**
* 语句改变返回{@code true},否则返回{@code false}
*/
public boolean changed(){
return Boolean.TRUE.equals(changed.get());
}
/**
* 复位线程局部变量{@link #changed}状态
*/
public SqlSyntaxNormalizer resetChanged(){
changed.remove();
return this;
}
}