Examples of PartitionComponents


Examples of info.archinnov.achilles.internal.metadata.holder.PartitionComponents

        parser = new EmbeddedIdParser(new PropertyParsingContext(context, nameField));


        EmbeddedIdProperties props = parser.parseEmbeddedId(CorrectEmbeddedKey.class, propertyParser);

        final PartitionComponents partitionComponents = props.getPartitionComponents();
        assertThat(partitionComponents.getComponentClasses()).containsExactly(String.class);
        assertThat(partitionComponents.getComponentFields()).containsExactly(nameField);
        assertThat(partitionComponents.getComponentNames()).containsExactly("name");
        assertThat(partitionComponents.getCQL3ComponentNames()).containsExactly("name");

        final ClusteringComponents clusteringComponents = props.getClusteringComponents();
        assertThat(clusteringComponents.getComponentClasses()).containsExactly(int.class);
        assertThat(clusteringComponents.getComponentFields()).containsExactly(rankField);
        assertThat(clusteringComponents.getComponentNames()).containsExactly("rank");
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.PartitionComponents

        final Field countField = CorrectEmbeddedReversedKey.class.getDeclaredField("count");
        parser = new EmbeddedIdParser(new PropertyParsingContext(context, nameField));

        EmbeddedIdProperties props = parser.parseEmbeddedId(CorrectEmbeddedReversedKey.class, propertyParser);

        final PartitionComponents partitionComponents = props.getPartitionComponents();
        assertThat(partitionComponents.getComponentClasses()).containsExactly(String.class);
        assertThat(partitionComponents.getComponentFields()).containsExactly(nameField);
        assertThat(partitionComponents.getComponentNames()).containsExactly("name");
        assertThat(partitionComponents.getCQL3ComponentNames()).containsExactly("name");

        final ClusteringComponents clusteringComponents = props.getClusteringComponents();
        assertThat(clusteringComponents.getComponentClasses()).containsExactly(int.class, int.class);
        assertThat(clusteringComponents.getComponentFields()).containsExactly(rankField, countField);
        assertThat(clusteringComponents.getComponentNames()).containsExactly("rank", "count");
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.PartitionComponents

        final Field dateField = EmbeddedKeyWithCompoundPartitionKey.class.getDeclaredField("date");
        parser = new EmbeddedIdParser(new PropertyParsingContext(context, idField));

        EmbeddedIdProperties props = parser.parseEmbeddedId(EmbeddedKeyWithCompoundPartitionKey.class, propertyParser);

        final PartitionComponents partitionComponents = props.getPartitionComponents();
        assertThat(partitionComponents.getComponentClasses()).containsExactly(Long.class, String.class);
        assertThat(partitionComponents.getComponentFields()).containsExactly(idField, typeField);
        assertThat(partitionComponents.getComponentNames()).containsExactly("id", "type");
        assertThat(partitionComponents.getCQL3ComponentNames()).containsExactly("id", "type");

        final ClusteringComponents clusteringComponents = props.getClusteringComponents();
        assertThat(clusteringComponents.getComponentClasses()).containsExactly(UUID.class);
        assertThat(clusteringComponents.getComponentFields()).containsExactly(dateField);
        assertThat(clusteringComponents.getComponentNames()).containsExactly("date");
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.PartitionComponents

        final Field typeField = EmbeddedKeyAsCompoundPartitionKey.class.getDeclaredField("type");
        parser = new EmbeddedIdParser(new PropertyParsingContext(context, idField));

        EmbeddedIdProperties props = parser.parseEmbeddedId(EmbeddedKeyAsCompoundPartitionKey.class, propertyParser);

        final PartitionComponents partitionComponents = props.getPartitionComponents();
        assertThat(partitionComponents.getComponentClasses()).containsExactly(Long.class, String.class);
        assertThat(partitionComponents.getComponentFields()).containsExactly(idField, typeField);
        assertThat(partitionComponents.getComponentNames()).containsExactly("id", "type");
        assertThat(partitionComponents.getCQL3ComponentNames()).containsExactly("id", "type");

        final ClusteringComponents clusteringComponents = props.getClusteringComponents();
        assertThat(clusteringComponents.getComponentClasses()).isEmpty();
        assertThat(clusteringComponents.getComponentFields()).isEmpty();
        assertThat(clusteringComponents.getComponentNames()).isEmpty();
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.PartitionComponents

        parser = new EmbeddedIdParser(new PropertyParsingContext(context, partitionKeyField));

        EmbeddedIdProperties props = parser.parseEmbeddedId(EmbeddedKeyChild1.class, propertyParser);

        //Then
        final PartitionComponents partitionComponents = props.getPartitionComponents();
        assertThat(partitionComponents.getComponentClasses()).containsExactly(String.class);
        assertThat(partitionComponents.getComponentFields()).containsExactly(partitionKeyField);
        assertThat(partitionComponents.getComponentNames()).containsExactly("partitionKey");
        assertThat(partitionComponents.getCQL3ComponentNames()).containsExactly("partition_key");

        final ClusteringComponents clusteringComponents = props.getClusteringComponents();
        assertThat(clusteringComponents.getComponentClasses()).containsExactly(Long.class);
        assertThat(clusteringComponents.getComponentFields()).containsExactly(clusteringKeyField);
        assertThat(clusteringComponents.getComponentNames()).containsExactly("clustering");
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.PartitionComponents

        parser = new EmbeddedIdParser(new PropertyParsingContext(context, partitionKey1Field));

        EmbeddedIdProperties props = parser.parseEmbeddedId(EmbeddedKeyChild3.class, propertyParser);

        //Then
        final PartitionComponents partitionComponents = props.getPartitionComponents();
        assertThat(partitionComponents.getComponentClasses()).containsExactly(String.class, Long.class);
        assertThat(partitionComponents.getComponentFields()).containsExactly(partitionKey1Field, partitionKey2Field);
        assertThat(partitionComponents.getComponentNames()).containsExactly("partitionKey", "partitionKey2");
        assertThat(partitionComponents.getCQL3ComponentNames()).containsExactly("partition_key", "partition_key2");

        final ClusteringComponents clusteringComponents = props.getClusteringComponents();
        assertThat(clusteringComponents.getComponentClasses()).containsExactly(UUID.class);
        assertThat(clusteringComponents.getComponentFields()).containsExactly(clusteringKeyField);
        assertThat(clusteringComponents.getComponentNames()).containsExactly("clustering");
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.PartitionComponents

    public void setUp() {
        when(meta1.<Long>getValueClass()).thenReturn(Long.class);
        when(meta2.<Integer>getValueClass()).thenReturn(int.class);
        when(meta3.<ByteBuffer>getValueClass()).thenReturn(ByteBuffer.class);
        when(meta4.<String>getValueClass()).thenReturn(String.class);
        partitionComponents = new PartitionComponents(asList(meta1, meta2, meta3, meta4));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.