@Test(groups = "short") public void should_handle_tuples_with_default_codecs() { setUpTupleTypes(cluster()); // simple statement session().execute(insertQuery, uuid, "John Doe", locationValue); ResultSet rows = session().execute(selectQuery, uuid); Row row = rows.one(); assertRow(row); // prepared + values PreparedStatement ps = session().prepare(insertQuery); session().execute(ps.bind(uuid, "John Doe", locationValue)); rows = session().execute(selectQuery, uuid); row = rows.one(); assertRow(row); // bound with setTupleValue session() .execute( ps.bind() .setUUID(0, uuid) .setString(1, "John Doe") .setTupleValue("location", locationValue)); rows = session().execute(selectQuery, uuid); row = rows.one(); assertRow(row); }
@Test(groups = "short") public void should_handle_partial_tuples_with_default_codecs() { setUpTupleTypes(cluster()); // simple statement session().execute(insertQuery, uuid, "John Doe", partialLocationValueInserted); ResultSet rows = session().execute(selectQuery, uuid); Row row = rows.one(); assertPartialRow(row); // prepared + values PreparedStatement ps = session().prepare(insertQuery); session().execute(ps.bind(uuid, "John Doe", partialLocationValueInserted)); rows = session().execute(selectQuery, uuid); row = rows.one(); assertPartialRow(row); // bound with setTupleValue session() .execute( ps.bind() .setUUID(0, uuid) .setString(1, "John Doe") .setTupleValue("location", partialLocationValueInserted)); rows = session().execute(selectQuery, uuid); row = rows.one(); assertPartialRow(row); }
session() .execute( ins.bind().setList(0, null).setSet(1, null).setMap(2, null).setTupleValue(3, null));
byName.setMap("m", map, mapping.javaType, mapping.javaType); if (is21) { byName.setTupleValue("t", tupleValue); byName.setSet("s", set, TypeTokens.listOf(mapping.javaType)); byIndex.setMap(3, map, mapping.javaType, mapping.javaType); if (is21) { byIndex.setTupleValue(4, tupleValue); byIndex.setSet(5, set, TypeTokens.listOf(mapping.javaType));
case Types.OTHER: if(object.getClass().equals(com.datastax.driver.core.TupleValue.class)){ this.statement.setTupleValue(parameterIndex-1, (com.datastax.driver.core.TupleValue) object);
bstm.setToken(key, (Token) value); } else if (value instanceof TupleValue) { bstm.setTupleValue(key, (TupleValue) value); } else if (value instanceof UDTValue) { bstm.setUDTValue(key, (UDTValue) value);
bstm.setToken(i, (Token) value); } else if (value instanceof TupleValue) { bstm.setTupleValue(i, (TupleValue) value); } else if (value instanceof UDTValue) { bstm.setUDTValue(i, (UDTValue) value);
@Test(groups = "short") public void should_handle_tuples_with_default_codecs() { setUpTupleTypes(cluster()); // simple statement session().execute(insertQuery, uuid, "John Doe", locationValue); ResultSet rows = session().execute(selectQuery, uuid); Row row = rows.one(); assertRow(row); // prepared + values PreparedStatement ps = session().prepare(insertQuery); session().execute(ps.bind(uuid, "John Doe", locationValue)); rows = session().execute(selectQuery, uuid); row = rows.one(); assertRow(row); // bound with setTupleValue session() .execute( ps.bind() .setUUID(0, uuid) .setString(1, "John Doe") .setTupleValue("location", locationValue)); rows = session().execute(selectQuery, uuid); row = rows.one(); assertRow(row); }
@Test(groups = "short") public void should_handle_partial_tuples_with_default_codecs() { setUpTupleTypes(cluster()); // simple statement session().execute(insertQuery, uuid, "John Doe", partialLocationValueInserted); ResultSet rows = session().execute(selectQuery, uuid); Row row = rows.one(); assertPartialRow(row); // prepared + values PreparedStatement ps = session().prepare(insertQuery); session().execute(ps.bind(uuid, "John Doe", partialLocationValueInserted)); rows = session().execute(selectQuery, uuid); row = rows.one(); assertPartialRow(row); // bound with setTupleValue session() .execute( ps.bind() .setUUID(0, uuid) .setString(1, "John Doe") .setTupleValue("location", partialLocationValueInserted)); rows = session().execute(selectQuery, uuid); row = rows.one(); assertPartialRow(row); }
session() .execute( ins.bind().setList(0, null).setSet(1, null).setMap(2, null).setTupleValue(3, null));
byName.setMap("m", map, mapping.javaType, mapping.javaType); if (is21) { byName.setTupleValue("t", tupleValue); byName.setSet("s", set, TypeTokens.listOf(mapping.javaType)); byIndex.setMap(3, map, mapping.javaType, mapping.javaType); if (is21) { byIndex.setTupleValue(4, tupleValue); byIndex.setSet(5, set, TypeTokens.listOf(mapping.javaType));