CassandraTableName tableName,
EntityId entityId,
CassandraColumnName column,
Long version
) {
final Delete delete = delete()
.all()
.from(tableName.getKeyspace(), tableName.getTable());
for (Map.Entry<String, Object> component
: getEntityIdColumnValues(layout, entityId).entrySet()) {
delete.where(eq(component.getKey(), component.getValue()));
}
if (column != null) {
delete.where(eq(FAMILY_COL, column.getFamilyBuffer()));
if (column.containsQualifier()) {
delete.where(eq(QUALIFIER_COL, column.getQualifierBuffer()));
if (version != null) {
delete.where(eq(VERSION_COL, version));
}
}
}
return delete;