本文整理了Java中com.datastax.driver.core.Row.getTupleValue
方法的一些代码示例,展示了Row.getTupleValue
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Row.getTupleValue
方法的具体详情如下:
包路径:com.datastax.driver.core.Row
类名称:Row
方法名:getTupleValue
暂无
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
private void assertPartialRow(Row row) {
assertThat(row.getUUID(0)).isEqualTo(uuid);
assertThat(row.getObject(0)).isEqualTo(uuid);
assertThat(row.get(0, UUID.class)).isEqualTo(uuid);
assertThat(row.getString(1)).isEqualTo("John Doe");
assertThat(row.getObject(1)).isEqualTo("John Doe");
assertThat(row.get(1, String.class)).isEqualTo("John Doe");
assertThat(row.getTupleValue(2)).isEqualTo(partialLocationValueRetrieved);
assertThat(row.getObject(2)).isEqualTo(partialLocationValueRetrieved);
assertThat(row.get(2, TupleValue.class)).isEqualTo(partialLocationValueRetrieved);
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
private void assertRow(Row row) {
assertThat(row.getUUID(0)).isEqualTo(uuid);
assertThat(row.getObject(0)).isEqualTo(uuid);
assertThat(row.get(0, UUID.class)).isEqualTo(uuid);
assertThat(row.getString(1)).isEqualTo("John Doe");
assertThat(row.getObject(1)).isEqualTo("John Doe");
assertThat(row.get(1, String.class)).isEqualTo("John Doe");
assertThat(row.getTupleValue(2)).isEqualTo(locationValue);
assertThat(row.getObject(2)).isEqualTo(locationValue);
assertThat(row.get(2, TupleValue.class)).isEqualTo(locationValue);
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
.execute(String.format("SELECT v_%s FROM mytable WHERE k=0", i))
.one()
.getTupleValue(String.format("v_%s", i));
assertEquals(r, createdTuple);
代码示例来源:origin: org.apache.cassandra/cassandra-all
@Override
public TupleValue getTupleValue(String name)
{
return row.getTupleValue(name);
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
session().execute("SELECT v FROM mytable WHERE k=?", i).one().getTupleValue("v");
代码示例来源:origin: org.apache.cassandra/cassandra-all
@Override
public TupleValue getTupleValue(int i)
{
return row.getTupleValue(i);
}
代码示例来源:origin: jsevellec/cassandra-unit
@Override
public TupleValue getTupleValue(String name)
{
return row.getTupleValue(name);
}
代码示例来源:origin: jsevellec/cassandra-unit
@Override
public TupleValue getTupleValue(int i)
{
return row.getTupleValue(i);
}
代码示例来源:origin: com.strapdata.cassandra/cassandra-all
@Override
public TupleValue getTupleValue(int i)
{
return row.getTupleValue(i);
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
.execute(String.format("SELECT v_%s FROM mytable WHERE k=?", i), i)
.one()
.getTupleValue(String.format("v_%s", i));
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
assertThat(row.getObject(1)).isEqualTo("John Doe");
assertThat(row.get(1, String.class)).isEqualTo("John Doe");
assertThat(row.getTupleValue(2)).isEqualTo(locationValue);
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
.execute(String.format("SELECT v_%s FROM mytable WHERE k=0", i))
.one()
.getTupleValue(String.format("v_%s", i));
.execute(String.format("SELECT v_%s FROM mytable WHERE k=0", i))
.one()
.getTupleValue(String.format("v_%s", i));
.execute(String.format("SELECT v_%s FROM mytable WHERE k=0", i))
.one()
.getTupleValue(String.format("v_%s", i));
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
assertThat(row.getObject(1)).isEqualTo("John Doe");
assertThat(row.get(1, String.class)).isEqualTo("John Doe");
assertThat(row.getTupleValue(2)).isEqualTo(locationType.newValue(37.387224f, null));
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Test(groups = "short")
public void simpleWriteReadTest() throws Exception {
session().execute("USE " + keyspace);
PreparedStatement ins = session().prepare("INSERT INTO t(k, v) VALUES (?, ?)");
PreparedStatement sel = session().prepare("SELECT * FROM t WHERE k=?");
TupleType t =
cluster().getMetadata().newTupleType(DataType.cint(), DataType.text(), DataType.cfloat());
int k = 1;
TupleValue v = t.newValue(1, "a", 1.0f);
session().execute(ins.bind(k, v));
TupleValue v2 = session().execute(sel.bind(k)).one().getTupleValue("v");
assertEquals(v2, v);
// Test simple statement interpolation
k = 2;
v = t.newValue(2, "b", 2.0f);
session().execute("INSERT INTO t(k, v) VALUES (?, ?)", k, v);
v2 = session().execute(sel.bind(k)).one().getTupleValue("v");
assertEquals(v2, v);
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Test(groups = "short")
public void should_set_registry_on_nested_tuples() {
ResultSet rows = session().execute("SELECT c2 FROM t1 WHERE pk = 2");
Row row = rows.one();
// here the CodecRegistry will create a codec on-the-fly using the TupleType received from the
// resultset metadata
TupleValue tuple1 = row.getTupleValue("c2");
assertThat(tuple1.getCodecRegistry()).isSameAs(cluster().getConfiguration().getCodecRegistry());
TupleValue tuple2 = tuple1.getTupleValue(0);
assertThat(tuple2.getCodecRegistry()).isSameAs(cluster().getConfiguration().getCodecRegistry());
TupleValue tuple3 = tuple2.getTupleValue(0);
assertThat(tuple3.getCodecRegistry()).isSameAs(cluster().getConfiguration().getCodecRegistry());
String s = tuple3.getString(0);
assertThat(s).isEqualTo("foo");
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
TupleValue r = session().execute("SELECT b FROM mytable WHERE a=0").one().getTupleValue("b");
assertEquals(r, complete);
TupleValue partionResult = t.newValue("bar", 456, null);
session().execute("INSERT INTO mytable (a, b) VALUES (0, ?)", partial);
r = session().execute("SELECT b FROM mytable WHERE a=0").one().getTupleValue("b");
assertEquals(r, partionResult);
TupleValue subpartialResult = t.newValue("zoo", null, null);
session().execute("INSERT INTO mytable (a, b) VALUES (0, ?)", subpartial);
r = session().execute("SELECT b FROM mytable WHERE a=0").one().getTupleValue("b");
assertEquals(r, subpartialResult);
assertEquals(session().execute(prepared.bind(3)).one().getTupleValue("b"), complete);
assertEquals(session().execute(prepared.bind(4)).one().getTupleValue("b"), partionResult);
assertEquals(session().execute(prepared.bind(5)).one().getTupleValue("b"), subpartialResult);
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Test(groups = "short")
public void should_set_registry_on_nested_tuples_and_udts() {
ResultSet rows = session().execute("SELECT c3 FROM t1 WHERE pk = 3");
Row row = rows.one();
// here the CodecRegistry will create a codec on-the-fly using the TupleType received from the
// resultset metadata
TupleValue tuple1 = row.getTupleValue("c3");
assertThat(tuple1.getCodecRegistry()).isSameAs(cluster().getConfiguration().getCodecRegistry());
TupleValue tuple2 = tuple1.getTupleValue(0);
assertThat(tuple2.getCodecRegistry()).isSameAs(cluster().getConfiguration().getCodecRegistry());
TupleValue tuple3 = tuple2.getTupleValue(0);
assertThat(tuple3.getCodecRegistry()).isSameAs(cluster().getConfiguration().getCodecRegistry());
UDTValue udt1 = tuple3.getUDTValue(0);
assertThat(udt1.getCodecRegistry()).isSameAs(cluster().getConfiguration().getCodecRegistry());
UDTValue udt2 = udt1.getUDTValue("f1");
assertThat(udt2.getCodecRegistry()).isSameAs(cluster().getConfiguration().getCodecRegistry());
UDTValue udt3 = udt2.getUDTValue("f2");
assertThat(udt3.getCodecRegistry()).isSameAs(cluster().getConfiguration().getCodecRegistry());
String f3 = udt3.getString("f3");
assertThat(f3).isEqualTo("foo");
}
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
TupleValue returnedTuple = row.getTupleValue("t");
assertThat(getValue(returnedTuple, 0, mapping.outerType, registry))
.isEqualTo(mapping.value);
TupleValue returnedTuple = row.getTupleValue(3);
assertThat(getValue(returnedTuple, 0, mapping.outerType, registry))
.isEqualTo(mapping.value);
代码示例来源:origin: com.datastax.dse/dse-java-driver-core
private void assertRow(Row row) {
assertThat(row.getUUID(0)).isEqualTo(uuid);
assertThat(row.getObject(0)).isEqualTo(uuid);
assertThat(row.get(0, UUID.class)).isEqualTo(uuid);
assertThat(row.getString(1)).isEqualTo("John Doe");
assertThat(row.getObject(1)).isEqualTo("John Doe");
assertThat(row.get(1, String.class)).isEqualTo("John Doe");
assertThat(row.getTupleValue(2)).isEqualTo(locationValue);
assertThat(row.getObject(2)).isEqualTo(locationValue);
assertThat(row.get(2, TupleValue.class)).isEqualTo(locationValue);
}
代码示例来源:origin: com.datastax.dse/dse-java-driver-core
private void assertPartialRow(Row row) {
assertThat(row.getUUID(0)).isEqualTo(uuid);
assertThat(row.getObject(0)).isEqualTo(uuid);
assertThat(row.get(0, UUID.class)).isEqualTo(uuid);
assertThat(row.getString(1)).isEqualTo("John Doe");
assertThat(row.getObject(1)).isEqualTo("John Doe");
assertThat(row.get(1, String.class)).isEqualTo("John Doe");
assertThat(row.getTupleValue(2)).isEqualTo(partialLocationValueRetrieved);
assertThat(row.getObject(2)).isEqualTo(partialLocationValueRetrieved);
assertThat(row.get(2, TupleValue.class)).isEqualTo(partialLocationValueRetrieved);
}
内容来源于网络,如有侵权,请联系作者删除!