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; }
public SQLDataType computeDataType() { if (resolvedColumn != null) { return resolvedColumn.getDataType(); } if (resolvedOwnerObject != null && resolvedOwnerObject instanceof SQLSubqueryTableSource) { SQLSelect select = ((SQLSubqueryTableSource) resolvedOwnerObject).getSelect(); SQLSelectQueryBlock queryBlock = select.getFirstQueryBlock(); if (queryBlock == null) { return null; } SQLSelectItem selectItem = queryBlock.findSelectItem(nameHashCode64()); if (selectItem != null) { return selectItem.computeDataType(); } } return null; }
public boolean match(long alias_hash) { long hash = alias_hash(); if (hash == alias_hash) { return true; } if (expr instanceof SQLAllColumnExpr) { SQLTableSource resolvedTableSource = ((SQLAllColumnExpr) expr).getResolvedTableSource(); if (resolvedTableSource != null && resolvedTableSource.findColumn(alias_hash) != null) { return true; } return false; } if (expr instanceof SQLIdentifierExpr) { return ((SQLIdentifierExpr) expr).nameHashCode64() == alias_hash; } if (expr instanceof SQLPropertyExpr) { String ident = ((SQLPropertyExpr) expr).getName(); if ("*".equals(ident)) { SQLTableSource resolvedTableSource = ((SQLPropertyExpr) expr).getResolvedTableSource(); if (resolvedTableSource != null && resolvedTableSource.findColumn(alias_hash) != null) { return true; } return false; } return ((SQLPropertyExpr) expr).nameHashCode64() == alias_hash; } return false; }
long tableNameHashCode64 = ((SQLPropertyExpr) expr).nameHashCode64();
public boolean apply(SQLCommentStatement x) { SQLName on = x.getOn().getName(); SQLExpr comment = x.getComment(); if (comment == null) { return false; } SQLCommentStatement.Type type = x.getType(); if (type == SQLCommentStatement.Type.TABLE) { if (!SQLUtils.nameEquals(getName(), on)) { return false; } setComment(comment.clone()); return true; } else if (type == SQLCommentStatement.Type.COLUMN) { SQLPropertyExpr propertyExpr = (SQLPropertyExpr) on; if (!SQLUtils.nameEquals(getName(), (SQLName) propertyExpr.getOwner())) { return false; } SQLColumnDefinition column = this.findColumn( propertyExpr.nameHashCode64()); if (column != null) { column.setComment(comment.clone()); } return true; } return false; }
.nameHashCode64()); if (selectItem != null) { expr = selectItem.getExpr();
column = tableSource.findColumn(propertyExpr.nameHashCode64()); if (column != null) { propertyExpr.setResolvedColumn(column);
SQLColumnDefinition column = tableSource.findColumn(x.nameHashCode64()); if (column != null) { x.setResolvedColumn(column);
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; }
public SQLDataType computeDataType() { if (resolvedColumn != null) { return resolvedColumn.getDataType(); } if (resolvedOwnerObject != null && resolvedOwnerObject instanceof SQLSubqueryTableSource) { SQLSelect select = ((SQLSubqueryTableSource) resolvedOwnerObject).getSelect(); SQLSelectQueryBlock queryBlock = select.getFirstQueryBlock(); if (queryBlock == null) { return null; } SQLSelectItem selectItem = queryBlock.findSelectItem(nameHashCode64()); if (selectItem != null) { return selectItem.computeDataType(); } } return null; }
public boolean match(long alias_hash) { long hash = alias_hash(); if (hash == alias_hash) { return true; } if (expr instanceof SQLAllColumnExpr) { SQLTableSource resolvedTableSource = ((SQLAllColumnExpr) expr).getResolvedTableSource(); if (resolvedTableSource != null && resolvedTableSource.findColumn(alias_hash) != null) { return true; } return false; } if (expr instanceof SQLIdentifierExpr) { return ((SQLIdentifierExpr) expr).nameHashCode64() == alias_hash; } if (expr instanceof SQLPropertyExpr) { String ident = ((SQLPropertyExpr) expr).getName(); if ("*".equals(ident)) { SQLTableSource resolvedTableSource = ((SQLPropertyExpr) expr).getResolvedTableSource(); if (resolvedTableSource != null && resolvedTableSource.findColumn(alias_hash) != null) { return true; } return false; } return ((SQLPropertyExpr) expr).nameHashCode64() == alias_hash; } return false; }
long tableNameHashCode64 = ((SQLPropertyExpr) expr).nameHashCode64();
public boolean apply(SQLCommentStatement x) { SQLName on = x.getOn().getName(); SQLExpr comment = x.getComment(); if (comment == null) { return false; } SQLCommentStatement.Type type = x.getType(); if (type == SQLCommentStatement.Type.TABLE) { if (!SQLUtils.nameEquals(getName(), on)) { return false; } setComment(comment.clone()); return true; } else if (type == SQLCommentStatement.Type.COLUMN) { SQLPropertyExpr propertyExpr = (SQLPropertyExpr) on; if (!SQLUtils.nameEquals(getName(), (SQLName) propertyExpr.getOwner())) { return false; } SQLColumnDefinition column = this.findColumn( propertyExpr.nameHashCode64()); if (column != null) { column.setComment(comment.clone()); } return true; } return false; }
.nameHashCode64()); if (selectItem != null) { expr = selectItem.getExpr();
column = tableSource.findColumn(propertyExpr.nameHashCode64()); if (column != null) { propertyExpr.setResolvedColumn(column);
SQLColumnDefinition column = tableSource.findColumn(x.nameHashCode64()); if (column != null) { x.setResolvedColumn(column);