@SuppressWarnings("unchecked") protected T mutateTo(ChangeTable<?> ct) { if (this.getSyntax() != ct.getSyntax()) throw new IllegalArgumentException( "not same syntax: " + this.getSyntax() + " != " + ct.getSyntax()); this.setName(ct.getName()); for (final Entry<ClauseType, Collection<String>> e : ct.clauses.entrySet()) { for (final String s : e.getValue()) this.addClause(s, e.getKey()); } for (final DeferredClause c : ct.inClauses.values()) { this.addClause(c); } for (final DeferredClause c : ct.outClauses.values()) { this.addOutsideClause(c); } for (final Object[] fk : ct.fks) { // don't create index, it is already added in outside clause this.addForeignConstraint((List<String>) fk[0], (SQLName) fk[1], false, (List<String>) fk[2]); } return thisAsT(); }