public DDLColumn(DDLTable table, SQLColumnDefinition column, int index) { this.table = table; this.column = column; this.name = column.getName().getSimpleName(); this.index = index; }
@Override public boolean visit(SQLForeignKeyImpl x) { for (SQLName column : x.getReferencingColumns()) { column.accept(this); } String table = x.getReferencedTableName().getSimpleName(); TableStat stat = getTableStat(x.getReferencedTableName()); stat.incrementReferencedCount(); for (SQLName column : x.getReferencedColumns()) { String columnName = column.getSimpleName(); addColumn(table, columnName); } return false; }
SQLPropertyExpr name = new SQLPropertyExpr(alias, column.getName().getSimpleName()); name.setResolvedColumn(column); columns.add(new SQLSelectItem(name)); } else { SQLIdentifierExpr name = (SQLIdentifierExpr) column.getName().clone(); name.setResolvedColumn(column); columns.add(new SQLSelectItem(name));
public void cloneTo(SQLConstraint x) { if (name != null) { x.setName(name.clone()); } }
public void cloneTo(SQLConstraintImpl x) { if (name != null) { x.setName(name.clone()); } x.enable = enable; x.validate = validate; x.rely = rely; }
public boolean isReferenced(SQLName tableName) { if (tableName == null) { return false; } return isReferenced(tableName.getSimpleName()); }
@Override public boolean visit(SQLAlterTableDropKey x) { print0(ucase ? "DROP KEY " : "drop key "); x.getKeyName().accept(this); return false; }
public void cloneTo(SQLExprTableSource x) { x.alias = alias; if (expr != null) { x.expr = expr.clone(); } if (partitions != null) { for (SQLName p : partitions) { SQLName p1 = p.clone(); x.addPartition(p1); } } }
protected int columnIndexOf(SQLName column) { if (column == null) { return -1; } String columnName = column.getSimpleName(); for (int i = tableElementList.size() - 1; i >= 0; --i) { SQLTableElement e = tableElementList.get(i); if (e instanceof SQLColumnDefinition) { if (SQLUtils.nameEquals(columnName, ((SQLColumnDefinition) e).getName().getSimpleName())) { return i; } } } return -1; }
public boolean visit(SQLAlterTableDisableConstraint x) { print0(ucase ? "DISABLE CONSTRAINT " : "disable constraint "); x.getConstraintName().accept(this); return false; }
public SQLCurrentOfCursorExpr clone() { SQLCurrentOfCursorExpr x = new SQLCurrentOfCursorExpr(); if (cursorName != null) { x.setCursorName(cursorName.clone()); } return x; }
protected void printPartitions(List<SQLName> partitions) { if (partitions.size() == 1 && "ALL".equalsIgnoreCase(partitions.get(0).getSimpleName())) { print0(ucase ? "ALL" : "all"); } else { printAndAccept(partitions, ", "); } }
public boolean visit(SQLAlterTableEnableConstraint x) { print0(ucase ? "ENABLE CONSTRAINT " : "enable constraint "); x.getConstraintName().accept(this); return false; }
public PartitionExtensionClause clone() { PartitionExtensionClause x = new PartitionExtensionClause(); x.subPartition = subPartition; if (partition != null) { x.setPartition(partition.clone()); } for (SQLName item : target) { SQLName item1 = item.clone(); item1.setParent(x); x.target.add(item1); } return x; } }
public SQLSequenceExpr clone() { SQLSequenceExpr x = new SQLSequenceExpr(); if (sequence != null) { x.setSequence(sequence.clone()); } x.function = function; return x; }
public DDLTable(SQLCreateTableStatement stmt) { this.stmt = stmt; for (SQLTableElement e : stmt.getTableElementList()) { if (e instanceof SQLColumnDefinition) { SQLColumnDefinition column = (SQLColumnDefinition) e; String fieldName = column.getName().getSimpleName(); fieldNames.add(fieldName); columns.add(column); DDLColumn field = new DDLColumn(this, column, fields.size()); this.fields.add(field); } } }