public SQLAlterTableStatement foreignKeyToAlterTable() { SQLAlterTableStatement stmt = new SQLAlterTableStatement(); for (int i = this.tableElementList.size() - 1; i >= 0; --i) { SQLTableElement element = this.tableElementList.get(i); if (element instanceof SQLForeignKeyConstraint) { SQLForeignKeyConstraint fk = (SQLForeignKeyConstraint) element; this.tableElementList.remove(i); stmt.addItem(new SQLAlterTableAddConstraint(fk)); } } if (stmt.getItems().size() == 0) { return null; } stmt.setDbType(getDbType()); stmt.setTableSource(this.tableSource.clone()); Collections.reverse(stmt.getItems()); return stmt; }
public void cloneTo(SQLCreateTableStatement x) { x.ifNotExiists = ifNotExiists; x.type = type; if (tableSource != null) { x.setTableSource(tableSource.clone()); } for (SQLTableElement e : tableElementList) { SQLTableElement e2 = e.clone(); e2.setParent(x); x.tableElementList.add(e2); } if (inherits != null) { x.setInherits(inherits.clone()); } if (select != null) { x.setSelect(select.clone()); } if (comment != null) { x.setComment(comment.clone()); } x.onCommitPreserveRows = onCommitPreserveRows; x.onCommitDeleteRows = onCommitDeleteRows; if (tableOptions != null) { for (Map.Entry<String, SQLObject> entry : tableOptions.entrySet()) { SQLObject entryVal = entry.getValue().clone(); x.tableOptions.put(entry.getKey(), entryVal); } } }
public SQLServerOutput clone() { SQLServerOutput x = new SQLServerOutput(); if (into != null) { x.setInto(into.clone()); } for (SQLExpr c : columns) { SQLExpr c2 = c.clone(); c2.setParent(x); x.columns.add(c2); } for (SQLSelectItem item : selectList) { SQLSelectItem item2 = item.clone(); item2.setParent(x); x.selectList.add(item2); } return x; } }
public void cloneTo(SQLInsertInto x) { if (tableSource != null) { x.setTableSource(tableSource.clone()); } for (SQLExpr column : columns) { SQLExpr column2 = column.clone(); column2.setParent(x); x.columns.add(column2); } if (query != null) { x.setQuery(query.clone()); } for (ValuesClause v : valuesList) { ValuesClause v2 = v.clone(); v2.setParent(x); x.valuesList.add(v2); } }
public void cloneTo(SQLForeignKeyImpl x) { super.cloneTo(x); if (referencedTable != null) { x.setReferencedTable(referencedTable.clone()); } for (SQLName column : referencingColumns) { SQLName columnClone = column.clone(); columnClone.setParent(x); x.getReferencingColumns().add(columnClone); } for (SQLName column : referencedColumns) { SQLName columnClone = column.clone(); columnClone.setParent(x); x.getReferencedColumns().add(columnClone); } }
public void cloneTo(MySqlCreateTableStatement x) { super.cloneTo(x); for (Map.Entry<String, SQLObject> entry : tableOptions.entrySet()) { SQLObject obj = entry.getValue().clone(); obj.setParent(x); x.tableOptions.put(entry.getKey(), obj); } if (partitioning != null) { x.setPartitioning(partitioning.clone()); } for (SQLCommentHint hint : hints) { SQLCommentHint h2 = hint.clone(); h2.setParent(x); x.hints.add(h2); } for (SQLCommentHint hint : optionHints) { SQLCommentHint h2 = hint.clone(); h2.setParent(x); x.optionHints.add(h2); } if (like != null) { x.setLike(like.clone()); } if (tableGroup != null) { x.setTableGroup(tableGroup.clone()); } }
x.setTableSource(tableSource.clone());
x.setTableSource(tableSource.clone());
x.setInto(into.clone());
public SQLAlterTableStatement foreignKeyToAlterTable() { SQLAlterTableStatement stmt = new SQLAlterTableStatement(); for (int i = this.tableElementList.size() - 1; i >= 0; --i) { SQLTableElement element = this.tableElementList.get(i); if (element instanceof SQLForeignKeyConstraint) { SQLForeignKeyConstraint fk = (SQLForeignKeyConstraint) element; this.tableElementList.remove(i); stmt.addItem(new SQLAlterTableAddConstraint(fk)); } } if (stmt.getItems().size() == 0) { return null; } stmt.setDbType(getDbType()); stmt.setTableSource(this.tableSource.clone()); Collections.reverse(stmt.getItems()); return stmt; }
public void cloneTo(SQLCreateTableStatement x) { x.ifNotExiists = ifNotExiists; x.type = type; if (tableSource != null) { x.setTableSource(tableSource.clone()); } for (SQLTableElement e : tableElementList) { SQLTableElement e2 = e.clone(); e2.setParent(x); x.tableElementList.add(e2); } if (inherits != null) { x.setInherits(inherits.clone()); } if (select != null) { x.setSelect(select.clone()); } if (comment != null) { x.setComment(comment.clone()); } x.onCommitPreserveRows = onCommitPreserveRows; x.onCommitDeleteRows = onCommitDeleteRows; if (tableOptions != null) { for (Map.Entry<String, SQLObject> entry : tableOptions.entrySet()) { SQLObject entryVal = entry.getValue().clone(); x.tableOptions.put(entry.getKey(), entryVal); } } }
public SQLServerOutput clone() { SQLServerOutput x = new SQLServerOutput(); if (into != null) { x.setInto(into.clone()); } for (SQLExpr c : columns) { SQLExpr c2 = c.clone(); c2.setParent(x); x.columns.add(c2); } for (SQLSelectItem item : selectList) { SQLSelectItem item2 = item.clone(); item2.setParent(x); x.selectList.add(item2); } return x; } }
public void cloneTo(SQLInsertInto x) { if (tableSource != null) { x.setTableSource(tableSource.clone()); } for (SQLExpr column : columns) { SQLExpr column2 = column.clone(); column2.setParent(x); x.columns.add(column2); } if (query != null) { x.setQuery(query.clone()); } for (ValuesClause v : valuesList) { ValuesClause v2 = v.clone(); v2.setParent(x); x.valuesList.add(v2); } }
public void cloneTo(SQLForeignKeyImpl x) { super.cloneTo(x); if (referencedTable != null) { x.setReferencedTable(referencedTable.clone()); } for (SQLName column : referencingColumns) { SQLName columnClone = column.clone(); columnClone.setParent(x); x.getReferencingColumns().add(columnClone); } for (SQLName column : referencedColumns) { SQLName columnClone = column.clone(); columnClone.setParent(x); x.getReferencedColumns().add(columnClone); } }
public void cloneTo(MySqlCreateTableStatement x) { super.cloneTo(x); for (Map.Entry<String, SQLObject> entry : tableOptions.entrySet()) { SQLObject obj = entry.getValue().clone(); obj.setParent(x); x.tableOptions.put(entry.getKey(), obj); } if (partitioning != null) { x.setPartitioning(partitioning.clone()); } for (SQLCommentHint hint : hints) { SQLCommentHint h2 = hint.clone(); h2.setParent(x); x.hints.add(h2); } for (SQLCommentHint hint : optionHints) { SQLCommentHint h2 = hint.clone(); h2.setParent(x); x.optionHints.add(h2); } if (like != null) { x.setLike(like.clone()); } if (tableGroup != null) { x.setTableGroup(tableGroup.clone()); } }
x.setTableSource(tableSource.clone());
x.setTableSource(tableSource.clone());
x.setInto(into.clone());