本文整理汇总了Java中com.alibaba.druid.sql.ast.SQLName.toString方法的典型用法代码示例。如果您正苦于以下问题:Java SQLName.toString方法的具体用法?Java SQLName.toString怎么用?Java SQLName.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.druid.sql.ast.SQLName
的用法示例。
在下文中一共展示了SQLName.toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import com.alibaba.druid.sql.ast.SQLName; //导入方法依赖的package包/类
public boolean visit(MySqlDeleteStatement x) {
setAliasMap();
setMode(x, Mode.Delete);
accept(x.getFrom());
accept(x.getUsing());
x.getTableSource().accept(this);
if (x.getTableSource() instanceof SQLExprTableSource) {
SQLName tableName = (SQLName) ((SQLExprTableSource) x.getTableSource()).getExpr();
String ident = tableName.toString();
setCurrentTable(x, ident);
TableStat stat = this.getTableStat(ident,ident);
stat.incrementDeleteCount();
}
accept(x.getWhere());
accept(x.getOrderBy());
accept(x.getLimit());
return false;
}
示例2: visit
import com.alibaba.druid.sql.ast.SQLName; //导入方法依赖的package包/类
@Override
public boolean visit(MySqlDeleteStatement x) {
setAliasMap();
accept(x.getFrom());
accept(x.getUsing());
x.getTableSource().accept(this);
if (x.getTableSource() instanceof SQLExprTableSource) {
SQLName tableName = (SQLName) ((SQLExprTableSource) x.getTableSource()).getExpr();
String ident = tableName.toString();
setCurrentTable(x, ident);
}
accept(x.getWhere());
accept(x.getOrderBy());
accept(x.getLimit());
return false;
}
示例3: influenceKeyColumn
import com.alibaba.druid.sql.ast.SQLName; //导入方法依赖的package包/类
/**
* this function is check if the name is the important column in any tables
* true -- the column influence some important column
* false -- safe
*/
private boolean influenceKeyColumn(SQLName name, SchemaConfig schema, String tableName) {
String columnName = name.toString();
Map<String, TableConfig> tableConfig = schema.getTables();
TableConfig changedTable = tableConfig.get(tableName);
if (changedTable == null) {
return false;
}
if (columnName.equalsIgnoreCase(changedTable.getPartitionColumn()) ||
columnName.equalsIgnoreCase(changedTable.getJoinKey())) {
return true;
}
// Traversal all the table node to find if some table is the child table of the changedTale
for (Map.Entry<String, TableConfig> entry : tableConfig.entrySet()) {
TableConfig tb = entry.getValue();
if (tb.getParentTC() != null &&
tableName.equalsIgnoreCase(tb.getParentTC().getName()) &&
columnName.equalsIgnoreCase(tb.getParentKey())) {
return true;
}
}
return false;
}