Package info.archinnov.achilles.type

Examples of info.archinnov.achilles.type.IndexCondition


        CompleteBean entity2 = CompleteBeanTestBuilder.builder().randomId().name("John DOO").buid();

        manager.insert(entity1);
        manager.insert(entity2);

        IndexCondition condition = new IndexCondition("name", "John DOO");
        List<CompleteBean> actual = manager.indexedQuery(CompleteBean.class, condition).get();

        assertThat(actual).hasSize(1);

        CompleteBean found1 = actual.get(0);
View Full Code Here


        manager.insert(entity1);
        manager.insert(entity2);
        manager.insert(entity3);

        //When
        IndexCondition condition = new IndexCondition("consistencylevel", EACH_QUORUM);
        final List<EntityWithSecondaryIndexOnEnum> actual = manager.indexedQuery(EntityWithSecondaryIndexOnEnum.class, condition).get();

        //Then
        assertThat(actual).hasSize(2);
        final EntityWithSecondaryIndexOnEnum found1 = actual.get(0);
View Full Code Here

    }

    @Test
    public void should_throw_clustered_exception_for_indexed_query() throws Exception {
        IndexCondition condition = new IndexCondition("name", "John DOO");

        exception.expect(AchillesException.class);
        exception.expectMessage("Index query is not supported for clustered entity");

        manager.indexedQuery(ClusteredEntity.class, condition).get();
View Full Code Here

    @Test
    public void should_encode_index_condition_value() throws Exception {
        //Given
        PropertyMeta nameMeta = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
        IndexCondition indexCondition = spy(new IndexCondition("name", "DuyHai"));

        when(meta.getAllMetasExceptCounters()).thenReturn(asList(nameMeta));
        when(nameMeta.getCQL3ColumnName()).thenReturn("name");
        when(nameMeta.getPropertyName()).thenReturn("name");
        when(nameMeta.forTranscoding().encodeToCassandra("DuyHai")).thenReturn("DuyHai");
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.type.IndexCondition

Copyright © 2018 www.massapicom. 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.