com.jn.sqlhelper.jsqlparser.instrument.JSqlParserInstrumentation Maven / Gradle / Ivy
package com.jn.sqlhelper.jsqlparser.instrument;
import com.jn.langx.annotation.Name;
import com.jn.langx.lifecycle.InitializationException;
import com.jn.sqlhelper.dialect.instrument.Instrumentation;
import com.jn.sqlhelper.dialect.instrument.orderby.OrderByTransformer;
import com.jn.sqlhelper.dialect.sqlparser.SqlParser;
import com.jn.sqlhelper.jsqlparser.sqlparser.JSqlParser;
import com.jn.sqlhelper.jsqlparser.sqlparser.JSqlParserStatementWrapper;
import net.sf.jsqlparser.statement.Statement;
@Name("jsqlparser")
public class JSqlParserInstrumentation implements Instrumentation {
private boolean enabled = false;
private boolean inited = false;
private SqlParser sqlParser;
private OrderByTransformer orderByTransformer;
@Override
public void init() throws InitializationException {
if (!inited) {
inited = true;
this.sqlParser = new JSqlParser();
// whereTransformer = new JSqlParserWhereTransformer();
// whereTransformer.init();
orderByTransformer = new JSqlParserOrderByTransformer();
orderByTransformer.init();
// groupByTransformer = new JSqlParserGroupByTransformer();
// groupByTransformer.init();
}
}
@Override
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
@Override
public boolean isEnabled() {
return this.enabled;
}
@Override
public SqlParser getSqlParser() {
return this.sqlParser;
}
@Override
public OrderByTransformer getOrderByTransformer() {
return this.orderByTransformer;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy