} else {
buildModifyBindColumns(key, binder, clusteringKeyAttributes);
}
}
BoundStatement bStmt = buildModifyInitial(session, persistOptions, PreparedStatements.StatementType.DELETE, binder);
int idx = binder.bindColumns(0, bStmt);
bindUsingOptions(bStmt, persistOptions, idx);
statementOptions.applyWrite(bStmt, writeConsistencyLevel, serialConsistencyLevel, persistOptions);
if (prePersist != null) {
prePersist.invoke(instance, this, type, bStmt);
}
batch.add(bStmt);
}
// UPDATE keyspace_name.table_name
// USING option AND option
// SET assignment , assignment, ...
// WHERE row_specification
// IF column_name = literal AND column_name = literal . . .
int protocolVersion = persistenceSession.persistenceManager.protocolVersion;
CqlColumn[] columns = PersistOption.ColumnRestrictionOption.filter(persistOptions, writeDataColumns);
Binder binder = new Binder(columns, true, primaryKeyColumns, PersistMode.UPDATE, true);
for (Map.Entry entry : instance.getCluster().entrySet()) {
binder.reset();
buildModifyBindColumns(instance, binder, partitionAttributes);
if (clusteringColumn != null) {
binder.setBytesUnsafe(clusteringColumn, clusteringPrimitive.serialize(entry.getKey(), protocolVersion));
} else {
buildModifyBindColumns(entry.getKey(), binder, clusteringKeyAttributes);
}
if (valueColumn != null) {
binder.setBytesUnsafe(valueColumn, valuePrimitive.serialize(entry.getValue(), protocolVersion));
} else {
buildModifyBindColumns(entry.getValue(), binder, valueAttributes);
}
BoundStatement bStmt = buildModifyInitial(session, persistOptions, PreparedStatements.StatementType.UPDATE, binder);
int idx = bindUsingOptions(bStmt, persistOptions, 0);
idx = binder.bindColumns(idx, bStmt);
bindIfOptions(binder, bStmt, persistOptions, idx);
statementOptions.applyWrite(bStmt, writeConsistencyLevel, serialConsistencyLevel, persistOptions);