Search in sources :

Example 1 with DefaultColumnDefinition

use of com.datastax.oss.driver.internal.core.cql.DefaultColumnDefinition in project java-driver by datastax.

the class RequestLogFormatterTest method mockPreparedStatement.

private PreparedStatement mockPreparedStatement(String query, Map<String, DataType> variables) {
    ImmutableList.Builder<ColumnDefinition> definitions = ImmutableList.builder();
    int i = 0;
    for (Map.Entry<String, DataType> entry : variables.entrySet()) {
        definitions.add(new DefaultColumnDefinition(new ColumnSpec("test", "foo", entry.getKey(), i, RawType.PRIMITIVES.get(entry.getValue().getProtocolCode())), context));
    }
    return new DefaultPreparedStatement(Bytes.fromHexString("0x"), query, DefaultColumnDefinitions.valueOf(definitions.build()), Collections.emptyList(), null, null, null, Collections.emptyMap(), null, null, null, null, null, Collections.emptyMap(), null, null, null, Integer.MIN_VALUE, null, null, false, context.getCodecRegistry(), context.getProtocolVersion());
}
Also used : DefaultPreparedStatement(com.datastax.oss.driver.internal.core.cql.DefaultPreparedStatement) ColumnSpec(com.datastax.oss.protocol.internal.response.result.ColumnSpec) ImmutableList(com.datastax.oss.driver.shaded.guava.common.collect.ImmutableList) DefaultColumnDefinition(com.datastax.oss.driver.internal.core.cql.DefaultColumnDefinition) DataType(com.datastax.oss.driver.api.core.type.DataType) ImmutableMap(com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap) Map(java.util.Map) DefaultColumnDefinition(com.datastax.oss.driver.internal.core.cql.DefaultColumnDefinition) ColumnDefinition(com.datastax.oss.driver.api.core.cql.ColumnDefinition)

Aggregations

ColumnDefinition (com.datastax.oss.driver.api.core.cql.ColumnDefinition)1 DataType (com.datastax.oss.driver.api.core.type.DataType)1 DefaultColumnDefinition (com.datastax.oss.driver.internal.core.cql.DefaultColumnDefinition)1 DefaultPreparedStatement (com.datastax.oss.driver.internal.core.cql.DefaultPreparedStatement)1 ImmutableList (com.datastax.oss.driver.shaded.guava.common.collect.ImmutableList)1 ImmutableMap (com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap)1 ColumnSpec (com.datastax.oss.protocol.internal.response.result.ColumnSpec)1 Map (java.util.Map)1