Examples of PropertyMeta


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

    }

    @Test
    public void should_update_table_with_new_indexed_simple_field() throws Exception {
        // Given
        PropertyMeta idMeta = valueClass(Long.class).type(ID).cqlColumnName("id").build();
        PropertyMeta longColPM = valueClass(Long.class).type(SIMPLE).cqlColumnName("longcol").build();
        longColPM.setIndexProperties(new IndexProperties("long_index", "longCol"));

        when(meta.getAllMetasExceptId()).thenReturn(asList(longColPM));
        when(meta.getIdMeta()).thenReturn(idMeta);
        when(tableMeta.getColumns()).thenReturn(Arrays.<ColumnMetadata>asList());
View Full Code Here

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

    }

    @Test
    public void should_update_table_with_new_list_field() throws Exception {
        // Given
        PropertyMeta idMeta = valueClass(Long.class).type(ID).cqlColumnName("id").build();
        PropertyMeta listStringPM = valueClass(String.class).type(LIST).cqlColumnName("list_string").build();

        when(meta.getAllMetasExceptId()).thenReturn(asList(listStringPM));
        when(meta.getIdMeta()).thenReturn(idMeta);
        when(tableMeta.getColumns()).thenReturn(Arrays.<ColumnMetadata>asList());
View Full Code Here

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

    }

    @Test
    public void should_update_table_with_new_set_field() throws Exception {
        // Given
        PropertyMeta idMeta = valueClass(Long.class).type(ID).cqlColumnName("id").build();
        PropertyMeta setStringPM = valueClass(String.class).type(SET).cqlColumnName("set_string").build();

        when(meta.getAllMetasExceptId()).thenReturn(asList(setStringPM));
        when(meta.getIdMeta()).thenReturn(idMeta);
        when(tableMeta.getColumns()).thenReturn(Arrays.<ColumnMetadata>asList());
View Full Code Here

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

    }

    @Test
    public void should_update_table_with_new_map_field() throws Exception {
        // Given
        PropertyMeta idMeta = valueClass(Long.class).type(ID).cqlColumnName("id").build();
        PropertyMeta mapStringPM = completeBean(Integer.class, String.class).type(MAP).cqlColumnName("preferences").build();

        when(meta.getAllMetasExceptId()).thenReturn(asList(mapStringPM));
        when(meta.getIdMeta()).thenReturn(idMeta);
        when(tableMeta.getColumns()).thenReturn(Arrays.<ColumnMetadata>asList());
View Full Code Here

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

    }

    @Test
    public void should_update_table_with_new_clustered_counter_field() throws Exception {
        // Given
        PropertyMeta idMeta = valueClass(Long.class).type(ID).cqlColumnName("id").build();
        PropertyMeta counterPM = valueClass(Counter.class).type(COUNTER).cqlColumnName("count").build();

        when(meta.getAllMetasExceptId()).thenReturn(asList(counterPM));
        when(meta.getIdMeta()).thenReturn(idMeta);
        when(tableMeta.getColumns()).thenReturn(Arrays.<ColumnMetadata>asList());
        when(meta.structure().isClusteredCounter()).thenReturn(true);
View Full Code Here

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

        assertThat(stringCaptor.getValue()).isEqualTo("\n\tALTER TABLE tableName ADD count counter");
    }

    @Test
    public void should_not_add_counter_field_if_non_clustered_counter_entity() throws Exception {
        PropertyMeta idMeta = valueClass(Long.class).type(ID).propertyName("id").build();
        PropertyMeta counterPM = valueClass(Counter.class).type(COUNTER).propertyName("count").build();

        when(meta.getAllMetasExceptId()).thenReturn(asList(counterPM));
        when(meta.getIdMeta()).thenReturn(idMeta);
        when(tableMeta.getColumns()).thenReturn(Arrays.<ColumnMetadata>asList());
        when(meta.structure().isClusteredCounter()).thenReturn(false);
View Full Code Here

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

        when(proxifier.getRealObject(entity)).thenReturn(entity);
        when(proxifier.getInterceptor(entity)).thenReturn(interceptor);
        when(interceptor.getDirtyMap()).thenReturn(dirtyMap);
        when(meta.getAllCounterMetas()).thenReturn(allCounterMetas);

        PropertyMeta pm = PropertyMetaTestBuilder.completeBean(Void.class, UserBean.class).propertyName("user").type(SIMPLE)
                .accessors().build();
        DirtyChecker dirtyChecker = new SimpleDirtyChecker(pm);
        dirtyMap.put(pm.getGetter(), dirtyChecker);
        when(context.isClusteredCounter()).thenReturn(false);

        entityUpdater.update(context, entity);

        verify(context).setEntity(entity);
View Full Code Here

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

        when(proxifier.isProxy(entity)).thenReturn(true);
        when(proxifier.getRealObject(entity)).thenReturn(entity);
        when(proxifier.getInterceptor(entity)).thenReturn(interceptor);
        when(interceptor.getDirtyMap()).thenReturn(dirtyMap);

        PropertyMeta pm = PropertyMetaTestBuilder.completeBean(Void.class, UserBean.class).propertyName("user").type(SIMPLE)
                .accessors().build();
        DirtyChecker dirtyChecker = new SimpleDirtyChecker(pm);
        dirtyMap.put(pm.getGetter(), dirtyChecker);
        when(context.isClusteredCounter()).thenReturn(true);

        entityUpdater.update(context, entity);

        verify(context).setEntity(entity);
View Full Code Here

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

        validator.validateRawTypedQuery(CompleteBean.class, statement, meta);
    }

    @Test
    public void should_exception_when_missing_id_column() throws Exception {
        PropertyMeta idMeta = PropertyMetaTestBuilder.completeBean(Void.class, Long.class).propertyName("id").cqlColumnName("id").type(PropertyType.ID).build();

        when(meta.getIdMeta()).thenReturn(idMeta);

        final RegularStatement statement = select("name","age").from("table").where(eq("col", 10L));
View Full Code Here

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

        validator.validateTypedQuery(CompleteBean.class, statement, meta);
    }

    @Test
    public void should_skip_id_column_validation_when_select_star() throws Exception {
        PropertyMeta idMeta = PropertyMetaTestBuilder.completeBean(Void.class, Long.class).propertyName("id").type(PropertyType.ID).build();

        when(meta.getIdMeta()).thenReturn(idMeta);

        final RegularStatement statement = select().from("table").where(eq("id",10L));
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.