public String getSchema() { if (expr == null) { return null; } if (expr instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) expr).getOwnernName(); } return null; }
public String getSchema() { SQLName name = getName(); if (name == null) { return null; } if (name instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) name).getOwnernName(); } return null; }
public String getSchema() { SQLName name = getName(); if (name == null) { return null; } if (name instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) name).getOwnernName(); } return null; }
public String getSchema() { SQLName name = getName(); if (name == null) { return null; } if (name instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) name).getOwnernName(); } return null; } }
public String getSchema() { SQLName name = getName(); if (name == null) { return null; } if (name instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) name).getOwnernName(); } return null; }
public String getSchema() { SQLName name = getName(); if (name == null) { return null; } if (name instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) name).getOwnernName(); } return null; }
public String getSchema() { SQLName name = getName(); if (name == null) { return null; } if (name instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) name).getOwnernName(); } return null; } }
public String getSchema() { SQLName name = getName(); if (name == null) { return null; } if (name instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) name).getOwnernName(); } return null; }
public String getSchema() { SQLName name = getName(); if (name == null) { return null; } if (name instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) name).getOwnernName(); } return null; }
public String getSchema() { SQLName name = getName(); if (name == null) { return null; } if (name instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) name).getOwnernName(); } return null; }
public String getSchema() { SQLName name = null; if (table instanceof SQLExprTableSource) { SQLExpr expr = ((SQLExprTableSource) table).getExpr(); if (expr instanceof SQLName) { name = (SQLName) expr; } } if (name == null) { return null; } if (name instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) name).getOwnernName(); } return null; }
public boolean visit(SQLPropertyExpr x) { String ownerName = x.getOwnernName(); if (ownerName == null) { return super.visit(x); } for (SQLObject parent = x.getParent(); parent != null; parent = parent.getParent()) { if (parent instanceof SQLSelectQueryBlock) { SQLSelectQueryBlock queryBlock = (SQLSelectQueryBlock) parent; SQLTableSource tableSource = queryBlock.findTableSource(ownerName); if (tableSource == null) { continue; } String alias = tableSource.computeAlias(); if (tableSource != null && ownerName.equalsIgnoreCase(alias) && !ownerName.equals(alias)) { x.setOwner(alias); } break; } } return super.visit(x); } }
public SchemaObject findTable(SQLName name) { if (name instanceof SQLIdentifierExpr) { return findTable(((SQLIdentifierExpr) name).getName()); } if (name instanceof SQLPropertyExpr) { SQLPropertyExpr propertyExpr = (SQLPropertyExpr) name; String schema = propertyExpr.getOwnernName(); long tableHashCode64 = propertyExpr.nameHashCode64(); Schema schemaObj = findSchema(schema); if (schemaObj == null) { return null; } return schemaObj.findTable(tableHashCode64); } return null; }
private boolean renameTable(SQLName name, SQLName to) { Schema schema; if (name instanceof SQLPropertyExpr) { String schemaName = ((SQLPropertyExpr) name).getOwnernName(); schema = findSchema(schemaName); } else { schema = getDefaultSchema(); } if (schema == null) { return false; } long nameHashCode64 = name.nameHashCode64(); SchemaObject schemaObject = schema.findTable(nameHashCode64); if (schemaObject != null) { MySqlCreateTableStatement createTableStmt = (MySqlCreateTableStatement) schemaObject.getStatement(); if (createTableStmt != null) { createTableStmt.setName(to.clone()); } schema.objects.put(to.hashCode64(), schemaObject); schema.objects.remove(nameHashCode64); } return true; }
public SchemaObject findTable(SQLTableSource tableSource, SQLExpr expr) { if (expr instanceof SQLAggregateExpr) { SQLAggregateExpr aggregateExpr = (SQLAggregateExpr) expr; String function = aggregateExpr.getMethodName(); if ("min".equalsIgnoreCase(function) || "max".equalsIgnoreCase(function)) { SQLExpr arg = aggregateExpr.getArguments().get(0); return findTable(tableSource, arg); } } if (expr instanceof SQLPropertyExpr) { String ownerName = ((SQLPropertyExpr) expr).getOwnernName(); return findTable(tableSource, ownerName); } if (expr instanceof SQLAllColumnExpr || expr instanceof SQLIdentifierExpr) { if (tableSource instanceof SQLExprTableSource) { return findTable(tableSource, tableSource.computeAlias()); } if (tableSource instanceof SQLJoinTableSource) { SQLJoinTableSource join = (SQLJoinTableSource) tableSource; SchemaObject table = findTable(join.getLeft(), expr); if (table == null) { table = findTable(join.getRight(), expr); } return table; } return null; } return null; }
if (on_ab_binaryOpExpr.getLeft() instanceof SQLPropertyExpr && on_ab_binaryOpExpr.getRight() instanceof SQLPropertyExpr) { String leftOwnerName = ((SQLPropertyExpr) on_ab_binaryOpExpr.getLeft()).getOwnernName(); String rightOwnerName = ((SQLPropertyExpr) on_ab_binaryOpExpr.getRight()).getOwnernName();
if (tableExpr instanceof SQLPropertyExpr && ((SQLPropertyExpr) tableExpr).getName().equals("*")) { String alias = ((SQLPropertyExpr) tableExpr).getOwnernName(); SQLTableSource refTableSource = from.findTableSource(alias); if (refTableSource != null) {
public String getSchema() { SQLName name = getName(); if (name == null) { return null; } if (name instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) name).getOwnernName(); } return null; } }
public String getSchema() { SQLName name = getName(); if (name == null) { return null; } if (name instanceof SQLPropertyExpr) { return ((SQLPropertyExpr) name).getOwnernName(); } return null; }
visitor.visit(propertyExpr); String ownerName = propertyExpr.getOwnernName(); if (propertyExpr.getName().equals("*")) { if (visitor.isEnabled(SchemaResolveVisitor.Option.ResolveAllColumn)) { continue; SQLTableSource tableSource = x.findTableSource(propertyExpr.getOwnernName()); if (tableSource != null) { column = tableSource.findColumn(propertyExpr.nameHashCode64());