Search in sources :

Example 11 with MapType

use of com.datastax.oss.driver.api.core.type.MapType in project java-driver by datastax.

the class DataTypeDetachableTest method attaching_map_should_attach_all_of_its_subtypes.

@Test
public void attaching_map_should_attach_all_of_its_subtypes() {
    TupleType tuple1 = DataTypes.tupleOf(DataTypes.INT);
    TupleType tuple2 = DataTypes.tupleOf(DataTypes.TEXT);
    MapType map = DataTypes.mapOf(tuple1, tuple2);
    assertThat(tuple1.isDetached()).isTrue();
    assertThat(tuple2.isDetached()).isTrue();
    map.attach(attachmentPoint);
    assertThat(tuple1.isDetached()).isFalse();
    assertThat(tuple2.isDetached()).isFalse();
}
Also used : TupleType(com.datastax.oss.driver.api.core.type.TupleType) MapType(com.datastax.oss.driver.api.core.type.MapType) Test(org.junit.Test)

Aggregations

MapType (com.datastax.oss.driver.api.core.type.MapType)11 ListType (com.datastax.oss.driver.api.core.type.ListType)7 SetType (com.datastax.oss.driver.api.core.type.SetType)7 DataType (com.datastax.oss.driver.api.core.type.DataType)6 TupleType (com.datastax.oss.driver.api.core.type.TupleType)6 UserDefinedType (com.datastax.oss.driver.api.core.type.UserDefinedType)4 Test (org.junit.Test)4 CustomType (com.datastax.oss.driver.api.core.type.CustomType)3 CodecNotFoundException (com.datastax.oss.driver.api.core.type.codec.CodecNotFoundException)3 NonNull (edu.umd.cs.findbugs.annotations.NonNull)3 CqlIdentifier (com.datastax.oss.driver.api.core.CqlIdentifier)2 TypeCodec (com.datastax.oss.driver.api.core.type.codec.TypeCodec)2 TupleValue (com.datastax.oss.driver.api.core.data.TupleValue)1 ColumnMetadata (com.datastax.oss.driver.api.core.metadata.schema.ColumnMetadata)1 TableMetadata (com.datastax.oss.driver.api.core.metadata.schema.TableMetadata)1 ViewMetadata (com.datastax.oss.driver.api.core.metadata.schema.ViewMetadata)1 GenericType (com.datastax.oss.driver.api.core.type.reflect.GenericType)1 ImmutableList (com.datastax.oss.driver.shaded.guava.common.collect.ImmutableList)1 ImmutableMap (com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap)1 TypeToken (com.datastax.oss.driver.shaded.guava.common.reflect.TypeToken)1