private StringBuilder changesCql(StringBuilder cql) { boolean first = true; boolean lastChangeWasRename = false; for (ColumnChangeSpecification change : spec().getChanges()) { if (!first) { cql.append(' '); } getCqlGeneratorFor(change, lastChangeWasRename).toCql(cql); lastChangeWasRename = change instanceof RenameColumnSpecification; first = false; } return cql; }
@Override public StringBuilder toCql(StringBuilder cql) { Assert.notNull(getSpecification().getName(), "User type name must not be null"); Assert.isTrue(!getSpecification().getChanges().isEmpty(), String.format("User type [%s] does not contain fields", getSpecification().getName())); return changesCql(preambleCql(cql)).append(";"); }