DATACASS-712 - Adapt to query builder API for set at list index.
This commit is contained in:
@@ -793,8 +793,9 @@ public class StatementFactory {
|
||||
private static Assignment getAssignment(SetOp updateOp, TermFactory termFactory) {
|
||||
|
||||
if (updateOp instanceof SetAtIndexOp) {
|
||||
// return Assignment.setE(op.getColumnName().toCql(), op.getIndex(), op.getValue());
|
||||
throw new UnsupportedOperationException("Set at index currently not supported");
|
||||
|
||||
return Assignment.setListValue(updateOp.toCqlIdentifier(),
|
||||
termFactory.create(((SetAtIndexOp) updateOp).getIndex()), termFactory.create(updateOp.getValue()));
|
||||
}
|
||||
|
||||
if (updateOp instanceof SetAtKeyOp) {
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
@@ -306,8 +305,7 @@ public class StatementFactoryUnitTests {
|
||||
.isEqualTo("UPDATE person USING TIMESTAMP 1234 SET first_name='baz' WHERE foo='bar'");
|
||||
}
|
||||
|
||||
@Test // DATACASS-343
|
||||
@Ignore("No operator for set at index yet")
|
||||
@Test // DATACASS-343, DATACASS-712
|
||||
public void shouldCreateSetAtIndexUpdate() {
|
||||
|
||||
StatementBuilder<com.datastax.oss.driver.api.querybuilder.update.Update> update = statementFactory
|
||||
|
||||
Reference in New Issue
Block a user