Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 1999-2017 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.shulie.druid.sql.visitor;
import com.shulie.druid.DbType;
import com.shulie.druid.sql.SQLUtils;
import com.shulie.druid.sql.ast.SQLExpr;
import com.shulie.druid.sql.ast.SQLStatement;
import com.shulie.druid.sql.ast.expr.SQLExprUtils;
import com.shulie.druid.sql.ast.expr.SQLVariantRefExpr;
import com.shulie.druid.sql.ast.statement.SQLDDLStatement;
import com.shulie.druid.sql.ast.statement.SQLSelectQueryBlock;
import com.shulie.druid.sql.ast.statement.SQLSelectStatement;
import com.shulie.druid.sql.dialect.db2.visitor.DB2OutputVisitor;
import com.shulie.druid.sql.dialect.h2.visitor.H2OutputVisitor;
import com.shulie.druid.sql.dialect.mysql.ast.statement.MySqlInsertStatement;
import com.shulie.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;
import com.shulie.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor;
import com.shulie.druid.sql.dialect.mysql.visitor.MySqlParameterizedVisitor;
import com.shulie.druid.sql.dialect.oracle.visitor.OracleASTParameterizedVisitor;
import com.shulie.druid.sql.dialect.oracle.visitor.OracleParameterizedOutputVisitor;
import com.shulie.druid.sql.dialect.phoenix.visitor.PhoenixOutputVisitor;
import com.shulie.druid.sql.dialect.postgresql.visitor.PGOutputVisitor;
import com.shulie.druid.sql.dialect.sqlserver.visitor.SQLServerOutputVisitor;
import com.shulie.druid.sql.parser.SQLParserFeature;
import com.shulie.druid.sql.parser.SQLParserUtils;
import com.shulie.druid.sql.parser.SQLSelectListCache;
import com.shulie.druid.sql.parser.SQLStatementParser;
import com.shulie.druid.util.FnvHash;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
public class ParameterizedOutputVisitorUtils {
private final static SQLParserFeature[] defaultFeatures = {
SQLParserFeature.EnableSQLBinaryOpExprGroup,
SQLParserFeature.UseInsertColumnsCache,
SQLParserFeature.OptimizedForParameterized,
};
private final static SQLParserFeature[] defaultFeatures2 = {
SQLParserFeature.EnableSQLBinaryOpExprGroup,
SQLParserFeature.UseInsertColumnsCache,
SQLParserFeature.OptimizedForParameterized,
SQLParserFeature.OptimizedForForParameterizedSkipValue,
};
private final static SQLParserFeature[] defaultFeatures_tddl = {
SQLParserFeature.EnableSQLBinaryOpExprGroup,
SQLParserFeature.UseInsertColumnsCache,
SQLParserFeature.OptimizedForParameterized,
SQLParserFeature.TDDLHint,
};
private final static SQLParserFeature[] defaultFeatures2_tddl = {
SQLParserFeature.EnableSQLBinaryOpExprGroup,
SQLParserFeature.UseInsertColumnsCache,
SQLParserFeature.OptimizedForParameterized,
SQLParserFeature.OptimizedForForParameterizedSkipValue,
SQLParserFeature.TDDLHint,
};
public static String parameterize(String sql, DbType dbType) {
return parameterize(sql, dbType, null, null);
}
public static String parameterize(String sql, DbType dbType, VisitorFeature ...features) {
return parameterize(sql, dbType, null, features);
}
public static String parameterize(String sql
, DbType dbType
, SQLSelectListCache selectListCache) {
return parameterize(sql, dbType, selectListCache, null);
}
public static String parameterize(String sql
, DbType dbType
, List