public SQLIdentifierExpr clone() { SQLIdentifierExpr x = new SQLIdentifierExpr(this.name, hashCode64); x.resolvedColumn = resolvedColumn; x.resolvedOwnerObject = resolvedOwnerObject; return x; }
public SQLPropertyExpr(String owner, String name){ this(new SQLIdentifierExpr(owner), name); }
public void setLeft(String tableName) { SQLExprTableSource tableSource; if (tableName == null || tableName.length() == 0) { tableSource = null; } else { tableSource = new OracleSelectTableReference(new SQLIdentifierExpr(tableName)); } this.setLeft(tableSource); }
public boolean renameColumn(String colummName, String newColumnName) { if (colummName == null || newColumnName == null || newColumnName.length() == 0) { return false; } int columnIndex = columnIndexOf(new SQLIdentifierExpr(colummName)); if (columnIndex == -1) { return false; } SQLColumnDefinition column = (SQLColumnDefinition) tableElementList.get(columnIndex); column.setName(new SQLIdentifierExpr(newColumnName)); return true; }
public void setRight(String tableName) { SQLExprTableSource tableSource; if (tableName == null || tableName.length() == 0) { tableSource = null; } else { tableSource = new OracleSelectTableReference(new SQLIdentifierExpr(tableName)); } this.setRight(tableSource); }
public void setLeft(String tableName, String alias) { SQLExprTableSource tableSource; if (tableName == null || tableName.length() == 0) { tableSource = null; } else { tableSource = new SQLExprTableSource(new SQLIdentifierExpr(tableName), alias); } this.setLeft(tableSource); }
public void setRight(String tableName, String alias) { SQLExprTableSource tableSource; if (tableName == null || tableName.length() == 0) { tableSource = null; } else { tableSource = new SQLExprTableSource(new SQLIdentifierExpr(tableName), alias); } this.setRight(tableSource); }
public void setFrom(String tableName) { SQLExprTableSource from; if (tableName == null || tableName.length() == 0) { from = null; } else { from = new OracleSelectTableReference(new SQLIdentifierExpr(tableName)); } this.setFrom(from); } }
public void setFrom(String tableName, String alias) { SQLExprTableSource from; if (tableName == null || tableName.length() == 0) { from = null; } else { from = new SQLExprTableSource(new SQLIdentifierExpr(tableName), alias); } this.setFrom(from); }
public SQLIdentifierExpr simplify() { String normalized = SQLUtils.normalize(name); if (normalized != name) { return new SQLIdentifierExpr(normalized, hashCode64); } return this; }
public void setTo(String to) { this.setTo(new SQLIdentifierExpr(to)); }
@Override public SQLSelectBuilderImpl from(String table, String alias) { SQLSelectQueryBlock queryBlock = getQueryBlock(); SQLExprTableSource from = new SQLExprTableSource(new SQLIdentifierExpr(table), alias); queryBlock.setFrom(from); return this; }
@Override public SQLUpdateBuilderImpl from(String table, String alias) { SQLUpdateStatement update = getSQLUpdateStatement(); SQLExprTableSource from = new SQLExprTableSource(new SQLIdentifierExpr(table), alias); update.setTableSource(from); return this; }
@Override public SQLDeleteBuilder from(String table, String alias) { SQLDeleteStatement delete = getSQLDeleteStatement(); SQLExprTableSource from = new SQLExprTableSource(new SQLIdentifierExpr(table), alias); delete.setTableSource(from); return this; }
@Deprecated private static SQLBinaryOpExpr createTenantCondition(WallVisitor visitor, String alias, StatementType statementType, String tableName) { SQLExpr left, right; if (alias != null) { left = new SQLPropertyExpr(new SQLIdentifierExpr(alias), visitor.getConfig().getTenantColumn()); } else { left = new SQLIdentifierExpr(visitor.getConfig().getTenantColumn()); } right = generateTenantValue(visitor, alias, statementType, tableName); SQLBinaryOpExpr tenantCondition = new SQLBinaryOpExpr(left, SQLBinaryOperator.Equality, right); return tenantCondition; }
public boolean visit(SQLExprTableSource x) { SQLExpr expr = x.getExpr(); if (expr instanceof SQLIdentifierExpr) { SQLIdentifierExpr identifierExpr = (SQLIdentifierExpr) expr; String ident = identifierExpr.getName(); String mappingIdent = mappings.get(ident); if (mappingIdent != null) { x.setExpr(new SQLIdentifierExpr(mappingIdent)); } } return false; }
public void setTable(SQLName table) { if (table instanceof SQLPropertyExpr) { SQLPropertyExpr propExpr = (SQLPropertyExpr) table; this.setDatabase((SQLName) propExpr.getOwner()); this.table = new SQLIdentifierExpr(propExpr.getName()); return; } this.table = table; }
public void setTable(SQLName table) { if (table instanceof SQLPropertyExpr) { SQLPropertyExpr propExpr = (SQLPropertyExpr) table; this.setDatabase((SQLName) propExpr.getOwner()); this.table = new SQLIdentifierExpr(propExpr.getName()); return; } this.table = table; }
public void setTable(SQLName table) { if (table instanceof SQLPropertyExpr) { SQLPropertyExpr propExpr = (SQLPropertyExpr) table; this.setDatabase((SQLName) propExpr.getOwner()); this.table = new SQLIdentifierExpr(propExpr.getName()); return; } this.table = table; }
@Override protected SQLExpr parseInterval() { accept(Token.INTERVAL); SQLIntervalExpr intervalExpr = new SQLIntervalExpr(); if (lexer.token() != Token.LITERAL_CHARS) { return new SQLIdentifierExpr("INTERVAL"); } intervalExpr.setValue(new SQLCharExpr(lexer.stringVal())); lexer.nextToken(); return intervalExpr; }