Examples of BoundStatementWrapper


Examples of info.archinnov.achilles.internal.statement.wrapper.BoundStatementWrapper

        when(context.getSerialConsistencyLevel()).thenReturn(fromNullable(ConsistencyLevel.LOCAL_SERIAL));

        when(ps.bind(Matchers.anyVararg())).thenReturn(bs);

        BoundStatementWrapper actual = binder.bindForInsert(context, ps, asList(nameMeta, ageMeta));

        verify(bs).setConsistencyLevel(ConsistencyLevel.ALL);
        verify(bs).setSerialConsistencyLevel(ConsistencyLevel.LOCAL_SERIAL);
        assertThat(asList(actual.getValues())).containsExactly(primaryKey, name, age, 0);
    }
View Full Code Here

Examples of info.archinnov.achilles.internal.statement.wrapper.BoundStatementWrapper

        when(nameMeta.forTranscoding().getAndEncodeValueForCassandra(entity)).thenReturn(name);
        when(ageMeta.forTranscoding().getAndEncodeValueForCassandra(entity)).thenReturn(null);

        when(ps.bind(Matchers.anyVararg())).thenReturn(bs);

        BoundStatementWrapper actual = binder.bindForInsert(context, ps, asList(nameMeta, ageMeta));

        verify(bs).setConsistencyLevel(ConsistencyLevel.ALL);
        assertThat(asList(actual.getValues())).containsExactly(primaryKey, name, null, 0);
    }
View Full Code Here

Examples of info.archinnov.achilles.internal.statement.wrapper.BoundStatementWrapper

        when(addressMeta.forTranscoding().getAndEncodeValueForCassandra(entity)).thenReturn(address);
        when(ageMeta.forTranscoding().getAndEncodeValueForCassandra(entity)).thenReturn(age);

        when(ps.bind(Matchers.anyVararg())).thenReturn(bs);

        BoundStatementWrapper actual = binder.bindForInsert(context, ps, asList(addressMeta, ageMeta));

        verify(bs).setConsistencyLevel(ConsistencyLevel.ALL);
        assertThat(asList(actual.getValues())).containsExactly(userId, name, address, age, 0);
    }
View Full Code Here

Examples of info.archinnov.achilles.internal.statement.wrapper.BoundStatementWrapper

        when(idMeta.structure().isEmbeddedId()).thenReturn(true);
        when(idMeta.forTranscoding().encodeToComponents(primaryKey, true)).thenReturn(Arrays.<Object>asList(userId, name));

        when(ps.bind(Matchers.anyVararg())).thenReturn(bs);

        BoundStatementWrapper actual = binder.bindStatementWithOnlyPKInWhereClause(context, ps, true, info.archinnov.achilles.type.ConsistencyLevel.ALL);

        verify(bs).setConsistencyLevel(ConsistencyLevel.ALL);
        assertThat(asList(actual.getValues())).containsExactly(userId, name);
    }
View Full Code Here

Examples of info.archinnov.achilles.internal.statement.wrapper.BoundStatementWrapper

        when(nameMeta.forTranscoding().getAndEncodeValueForCassandra(entity)).thenReturn(name);
        when(ageMeta.forTranscoding().getAndEncodeValueForCassandra(entity)).thenReturn(age);

        when(ps.bind(Matchers.anyVararg())).thenReturn(bs);

        BoundStatementWrapper actual = binder.bindForUpdate(context, ps, asList(nameMeta, ageMeta));

        verify(bs).setConsistencyLevel(ConsistencyLevel.ALL);
        verify(bs).setSerialConsistencyLevel(ConsistencyLevel.LOCAL_SERIAL);
        assertThat(asList(actual.getValues())).containsExactly(0, name, age, primaryKey);
    }
View Full Code Here

Examples of info.archinnov.achilles.internal.statement.wrapper.BoundStatementWrapper

        facade = context.daoFacade;
    }

    @Test
    public void should_push_statement_wrapper() throws Exception {
        BoundStatementWrapper bsWrapper = mock(BoundStatementWrapper.class);

        facade.pushStatement(bsWrapper);

        verify(flushContext).pushStatement(bsWrapper);
    }
View Full Code Here

Examples of info.archinnov.achilles.internal.statement.wrapper.BoundStatementWrapper

        verify(flushContext).pushStatement(bsWrapper);
    }

    @Test
    public void should_push_counter_statement_wrapper() throws Exception {
        BoundStatementWrapper bsWrapper = mock(BoundStatementWrapper.class);

        facade.pushCounterStatement(bsWrapper);

        verify(flushContext).pushCounterStatement(bsWrapper);
    }
View Full Code Here

Examples of info.archinnov.achilles.internal.statement.wrapper.BoundStatementWrapper

        when(idMeta.forTranscoding().forceEncodeToJSONForCounter(primaryKey)).thenReturn(primaryKey.toString());
        when(counterMeta.getCQL3ColumnName()).thenReturn("count");

        when(ps.bind(increment, "CompleteBean", primaryKey.toString(), "count")).thenReturn(bs);

        BoundStatementWrapper actual = binder.bindForSimpleCounterIncrementDecrement(context, ps, counterMeta, increment, ALL);

        verify(bs).setConsistencyLevel(ConsistencyLevel.ALL);
        assertThat(asList(actual.getValues())).containsExactly(increment, "CompleteBean", primaryKey.toString(), "count");
    }
View Full Code Here

Examples of info.archinnov.achilles.internal.statement.wrapper.BoundStatementWrapper

    }

    @Test
    public void should_execute_immediate() throws Exception {
        // Given
        BoundStatementWrapper bsWrapper = mock(BoundStatementWrapper.class);

        // When
        when(flushContext.execute(bsWrapper)).thenReturn(futureResultSet);

        ListenableFuture<ResultSet> actual = facade.executeImmediate(bsWrapper);
View Full Code Here

Examples of info.archinnov.achilles.internal.statement.wrapper.BoundStatementWrapper

        when(idMeta.forTranscoding().forceEncodeToJSONForCounter(primaryKey)).thenReturn(primaryKey.toString());
        when(counterMeta.getCQL3ColumnName()).thenReturn("count");

        when(ps.bind("CompleteBean", primaryKey.toString(), "count")).thenReturn(bs);

        BoundStatementWrapper actual = binder.bindForSimpleCounterSelect(context, ps, counterMeta, ALL);

        verify(bs).setConsistencyLevel(ConsistencyLevel.ALL);
        assertThat(asList(actual.getValues())).containsExactly("CompleteBean", primaryKey.toString(), "count");
    }
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.