Examples of structure()


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

        assertThat(meta).isNotNull();

        assertThat(meta.<EmbeddedKey>getIdClass()).isEqualTo(EmbeddedKey.class);
        PropertyMeta idMeta = meta.getIdMeta();

        assertThat(idMeta.structure().isEmbeddedId()).isTrue();

        assertThat(meta.getPropertyMetas().get("firstName").structure().isStaticColumn()).isTrue();
    }

    @Test
View Full Code Here

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

        assertThat((Class<Set>) meta.getGetter().getReturnType()).isEqualTo(Set.class);
        assertThat(meta.getSetter().getName()).isEqualTo("setFollowers");
        assertThat((Class<Set>) meta.getSetter().getParameterTypes()[0]).isEqualTo(Set.class);

        assertThat(meta.type()).isEqualTo(PropertyType.SET);
        assertThat(meta.structure().isStaticColumn()).isTrue();
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Test
    public void should_parse_map() throws Exception {
View Full Code Here

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

        assertThat(meta.getGetter().getName()).isEqualTo("getPreferences");
        assertThat((Class<Map>) meta.getGetter().getReturnType()).isEqualTo(Map.class);
        assertThat(meta.getSetter().getName()).isEqualTo("setPreferences");
        assertThat((Class<Map>) meta.getSetter().getParameterTypes()[0]).isEqualTo(Map.class);
        assertThat(meta.structure().isStaticColumn()).isTrue();
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Test
    public void should_parse_map_with_parameterized_value() throws Exception {
View Full Code Here

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

    }

    @Test
    public void should_prepare_select_field_ps() throws Exception {
        PropertyMeta nameMeta = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
        when(nameMeta.structure().isCounter()).thenReturn(false);
        when(nameMeta.forStatementGeneration().prepareSelectField(isA(Selection.class))).thenReturn(select().column("name"));
        when(idMeta.forStatementGeneration().generateWhereClauseForSelect(Mockito.eq(fromNullable(nameMeta)), isA(Select.class)))
                .thenReturn(select("name").from("ks","table").where(eq("id",bindMarker("id"))));

        when(session.prepare(queryCaptor.capture())).thenReturn(ps);
View Full Code Here

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

    @Test
    public void should_exception_when_preparing_select_for_counter_type() throws Exception {

        PropertyMeta nameMeta = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
        when(nameMeta.structure().isCounter()).thenReturn(true);
        when(nameMeta.getPropertyName()).thenReturn("count");
        when(meta.getClassName()).thenReturn("entity");
        exception.expect(IllegalArgumentException.class);
        exception.expectMessage("Cannot prepare statement for property 'count' of entity 'entity' because it is a counter type");
View Full Code Here

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

        PropertyMeta nameMeta = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
        PropertyMeta ageMeta = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
        final Assignments assignments = update("ks","table").with();

        when(nameMeta.structure().isStaticColumn()).thenReturn(false);
        when(ageMeta.structure().isStaticColumn()).thenReturn(false);
        when(nameMeta.forStatementGeneration().prepareUpdateField(conditionsCaptor.capture())).thenReturn(assignments);
        when(ageMeta.forStatementGeneration().prepareUpdateField(isA(Assignments.class))).thenReturn(assignments);
        when(idMeta.forStatementGeneration().prepareCommonWhereClauseForUpdate(assignments, false)).thenReturn(assignments.where(eq("id", bindMarker("id"))));
        when(session.prepare(queryCaptor.capture())).thenReturn(ps);
View Full Code Here

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

        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);


        when(statementGenerator.prepareCommonWhereClauseForUpdate(update("table").with(incr("count", bindMarker("count"))), false))
                .thenReturn(update("table").where());
        when(statementGenerator.prepareCommonWhereClauseForUpdate(update("table").with(decr("count", bindMarker("count"))), 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.