Examples of forStatementGeneration()


Examples of info.archinnov.achilles.internal.metadata.holder.PropertyMeta.forStatementGeneration()

    @Test
    public void should_prepare_select_eager_ps_with_static_columns() throws Exception {
        PropertyMeta nameMeta = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);

        when(meta.forOperations().getColumnsMetaToLoad()).thenReturn(asList(nameMeta));
        when(nameMeta.forStatementGeneration().prepareSelectField(isA(Selection.class))).thenReturn(select().column("name"));
        when(meta.structure().hasOnlyStaticColumns()).thenReturn(true);
        when(meta.getAllMetasExceptId()).thenReturn(asList(nameMeta));

        when(idMeta.forStatementGeneration().generateWhereClauseForSelect(Mockito.eq(Optional.fromNullable(nameMeta)), isA(Select.class)))
                .thenReturn(select("name").from("ks","table").where(eq("id", bindMarker("id"))));
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.PropertyMeta.forStatementGeneration()

    public void should_prepare_clustered_counter_queries() throws Exception {
        PropertyMeta counterMeta = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
        PropertyMetaStatementGenerator statementGenerator = mock(PropertyMetaStatementGenerator.class, RETURNS_DEEP_STUBS);

        when(meta.getAllCounterMetas()).thenReturn(asList(counterMeta));
        when(counterMeta.forStatementGeneration()).thenReturn(statementGenerator);
        when(counterMeta.getPropertyName()).thenReturn("countProperty");
        when(counterMeta.getCQL3ColumnName()).thenReturn("count");
        when(counterMeta.structure().isStaticColumn()).thenReturn(false);

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.