/** * Adds an option to the UPDATE statement this WHERE clause is part of. * * @param using the using clause to add. * @return the options of the UPDATE statement this WHERE clause is part of. */ public Options using(Using using) { return statement.using(using); }
/** * Adds an option to the UPDATE statement these conditions are part of. * * @param using the using clause to add. * @return the options of the UPDATE statement these conditions are part of. */ public Options using(Using using) { return statement.using(using); } }
/** * Adds an option to the UPDATE statement those assignments are part of. * * @param using the using clause to add. * @return the options of the UPDATE statement those assignments are part of. */ public Options using(Using using) { return statement.using(using); }
/** * Adds an option to the UPDATE statement those assignments are part of. * * @param using the using clause to add. * @return the options of the UPDATE statement those assignments are part of. */ public Options using(Using using) { return statement.using(using); }
/** * Adds an option to the UPDATE statement this WHERE clause is part of. * * @param using the using clause to add. * @return the options of the UPDATE statement this WHERE clause is part of. */ public Options using(Using using) { return statement.using(using); }
/** * Adds an option to the UPDATE statement these conditions are part of. * * @param using the using clause to add. * @return the options of the UPDATE statement these conditions are part of. */ public Options using(Using using) { return statement.using(using); }
/** * Adds an option to the UPDATE statement those assignments are part of. * * @param using the using clause to add. * @return the options of the UPDATE statement those assignments are part of. */ public Options using(Using using) { return statement.using(using); }
/** * Adds an option to the UPDATE statement these conditions are part of. * * @param using the using clause to add. * @return the options of the UPDATE statement these conditions are part of. */ public Options using(Using using) { return statement.using(using); } }
/** * Adds an option to the UPDATE statement these conditions are part of. * * @param using the using clause to add. * @return the options of the UPDATE statement these conditions are part of. */ public Options using(Using using) { return statement.using(using); }
/** * Adds an option to the UPDATE statement this WHERE clause is part of. * * @param using the using clause to add. * @return the options of the UPDATE statement this WHERE clause is part of. */ public Options using(Using using) { return statement.using(using); }
/** * Adds an option to the UPDATE statement this WHERE clause is part of. * * @param using the using clause to add. * @return the options of the UPDATE statement this WHERE clause is part of. */ public Options using(Using using) { return statement.using(using); }
/** * Adds an option to the UPDATE statement this WHERE clause is part of. * * @param using the using clause to add. * @return the options of the UPDATE statement this WHERE clause is part of. */ public Options using(Using using) { return statement.using(using); }
/** * Adds an option to the UPDATE statement those assignments are part of. * * @param using the using clause to add. * @return the options of the UPDATE statement those assignments are part of. */ public Options using(Using using) { return statement.using(using); }
/** * Adds an option to the UPDATE statement those assignments are part of. * * @param using the using clause to add. * @return the options of the UPDATE statement those assignments are part of. */ public Options using(Using using) { return statement.using(using); }
@Test(groups = "unit") public void statementForwardingTest() throws Exception { Update upd = update("foo"); upd.setConsistencyLevel(ConsistencyLevel.QUORUM); upd.enableTracing(); Statement query = upd.using(timestamp(42)).with(set("a", 12)).and(incr("c", 3)).where(eq("k", 2)); assertEquals(query.getConsistencyLevel(), ConsistencyLevel.QUORUM); assertTrue(query.isTracing()); }
@Test(groups = "unit") public void updateInjectionTest() throws Exception { String query; Statement update; query = "UPDATE foo.bar USING TIMESTAMP 42 SET a=12 WHERE k='2 OR 1=1';"; update = update("foo", "bar").using(timestamp(42)).with(set("a", 12)).where(eq("k", "2 OR 1=1")); assertEquals(update.toString(), query); query = "UPDATE foo SET b='null WHERE k=1; --comment' WHERE k=2;"; update = update("foo").where().and(eq("k", 2)).with(set("b", "null WHERE k=1; --comment")); assertEquals(update.toString(), query); query = "UPDATE foo USING TIMESTAMP 42 SET \"b WHERE k=1; --comment\"=[3,2,1]+\"b WHERE k=1; --comment\" WHERE k=2;"; update = update("foo") .where() .and(eq("k", 2)) .with(prependAll("b WHERE k=1; --comment", Arrays.asList(3, 2, 1))) .using(timestamp(42)); assertEquals(update.toString(), query); }
batch() .add(insertInto(table).values(new String[] {"k", "a"}, new Object[] {42, 1})) .add(update(table).using(ttl(400))); assertEquals(batch.getRoutingKey(protocolVersion, codecRegistry), bb); assertEquals(batch.toString(), batch_query);
@Override public UpdateBuilder<T> withTtl(int ttl) { update.using(QueryBuilder.ttl(ttl)); return this; } @Override
update = update("foo", "bar") .using(timestamp(42)) .with(set("a", 12)) .and(set("b", Arrays.asList(3, 2, 1))) update = update("foo").using(ttl(400)); assertEquals(update.toString(), query); .using(timestamp(42)) .where(eq("k", 2)) .and(eq("l", "foo")) update("foo").using(ttl(-400)); fail("Expected an IllegalArgumentException"); } catch (IllegalArgumentException e) {
@Test(groups = "unit") public void statementForwardingTest() throws Exception { Update upd = update("foo"); upd.setConsistencyLevel(ConsistencyLevel.QUORUM); upd.enableTracing(); Statement query = upd.using(timestamp(42)).with(set("a", 12)).and(incr("c", 3)).where(eq("k", 2)); assertEquals(query.getConsistencyLevel(), ConsistencyLevel.QUORUM); assertTrue(query.isTracing()); }