Package info.archinnov.achilles.internal.metadata.holder

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


            }

        }
        PropertyParsingContext context = newContext(Test.class, Test.class.getDeclaredField("counter"));

        PropertyMeta meta = parser.parse(context);

        assertThat(meta.structure().isStaticColumn()).isTrue();
    }
View Full Code Here


    @Test
    public void should_get_cache_for_fields_update() throws Exception {
        EntityMeta meta = new EntityMeta();
//        meta.setTableName("table");

        PropertyMeta nameMeta = completeBean(Void.class, String.class).propertyName("name").type(SIMPLE).build();
        PropertyMeta ageMeta = completeBean(Void.class, String.class).propertyName("age").type(SIMPLE).build();

        when(context.<CompleteBean>getEntityClass()).thenReturn(CompleteBean.class);
        when(context.getEntityMeta()).thenReturn(meta);
        when(cache.getIfPresent(cacheKeyCaptor.capture())).thenReturn(ps);
View Full Code Here

    @Test
    public void should_generate_update_prepared_statement_when_not_found_in_cache() throws Exception {
        EntityMeta meta = new EntityMeta();
//        meta.setTableName("table");

        PropertyMeta nameMeta = completeBean(Void.class, String.class).propertyName("name").type(SIMPLE).build();
        PropertyMeta ageMeta = completeBean(Void.class, String.class).propertyName("age").type(SIMPLE).build();

        List<PropertyMeta> pms = asList(nameMeta, ageMeta);

        when(context.<CompleteBean>getEntityClass()).thenReturn(CompleteBean.class);
        when(context.getEntityMeta()).thenReturn(meta);
View Full Code Here

        }
        entityContext = new EntityParsingContext(configContext, Test.class);
        entityContext.setCurrentConsistencyLevels(Pair.create(TWO, THREE));
        PropertyParsingContext context = entityContext.newPropertyContext(Test.class.getDeclaredField("counter"));

        PropertyMeta meta = parser.parse(context);

        assertThat(meta.type()).isEqualTo(PropertyType.COUNTER);
        assertThat(meta.structure().getReadConsistencyLevel()).isEqualTo(ONE);
        assertThat(meta.structure().getWriteConsistencyLevel()).isEqualTo(ALL);
    }
View Full Code Here

    @Test
    public void should_prepare_message_for_collection_and_map_operation() throws Exception {
        //Given
        EntityMeta meta = mock(EntityMeta.class);
        PropertyMeta pm = mock(PropertyMeta.class);
        DirtyCheckChangeSet changeSet = new DirtyCheckChangeSet(pm, ADD_TO_SET);

        when(context.<CompleteBean>getEntityClass()).thenReturn(CompleteBean.class);
        when(context.getEntityMeta()).thenReturn(meta);
        when(pm.getPropertyName()).thenReturn("property");
        StatementCacheKey cacheKey = new StatementCacheKey(CacheType.ADD_TO_SET, newHashSet("property"), CompleteBean.class, noOptions());

        when(cache.getIfPresent(cacheKey)).thenReturn(null);
        when(generator.prepareCollectionAndMapUpdate(session, meta, changeSet, noOptions())).thenReturn(ps);
View Full Code Here

    @Test
    public void should_get_collection_and_map_operation_from_cache() throws Exception {
        //Given
        EntityMeta meta = mock(EntityMeta.class);
        PropertyMeta pm = mock(PropertyMeta.class);
        DirtyCheckChangeSet changeSet = new DirtyCheckChangeSet(pm, ADD_TO_SET);

        when(context.<CompleteBean>getEntityClass()).thenReturn(CompleteBean.class);
        when(context.getEntityMeta()).thenReturn(meta);
        when(pm.getPropertyName()).thenReturn("property");
        StatementCacheKey cacheKey = new StatementCacheKey(CacheType.ADD_TO_SET, newHashSet("property"), CompleteBean.class, noOptions());
        when(cache.getIfPresent(cacheKey)).thenReturn(ps);

        //When
        final PreparedStatement actual = manager.getCacheForCollectionAndMapOperation(session, cache, context, pm,
View Full Code Here

            public void setType(PropertyType type) {
                this.type = type;
            }
        }
        PropertyParsingContext context = newContext(Test.class, Test.class.getDeclaredField("type"));
        PropertyMeta meta = parser.parse(context);

        assertThat(meta.<PropertyType>getValueClass()).isEqualTo(PropertyType.class);
        assertThat(meta.config().<String>getCQL3ValueType()).isEqualTo(String.class);
    }
View Full Code Here

            public void setType(PropertyType type) {
                this.type = type;
            }
        }
        PropertyParsingContext context = newContext(Test.class, Test.class.getDeclaredField("type"));
        PropertyMeta meta = parser.parse(context);

        assertThat(meta.<PropertyType>getValueClass()).isEqualTo(PropertyType.class);
        assertThat(meta.config().<Integer>getCQL3ValueType()).isEqualTo(Integer.class);
    }
View Full Code Here

            public void setTypes(List<PropertyType> types) {
                this.types = types;
            }
        }
        PropertyParsingContext context = newContext(Test.class, Test.class.getDeclaredField("types"));
        PropertyMeta meta = parser.parse(context);

        assertThat(meta.<PropertyType>getValueClass()).isEqualTo(PropertyType.class);
        assertThat(meta.config().<Integer>getCQL3ValueType()).isEqualTo(Integer.class);
    }
View Full Code Here

            public void setTypes(Map<RetentionPolicy, PropertyType> types) {
                this.types = types;
            }
        }
        PropertyParsingContext context = newContext(Test.class, Test.class.getDeclaredField("types"));
        PropertyMeta meta = parser.parse(context);

        assertThat(meta.<PropertyType>getValueClass()).isEqualTo(PropertyType.class);
        assertThat(meta.config().<Integer>getCQL3KeyType()).isEqualTo(Integer.class);
        assertThat(meta.config().<String>getCQL3ValueType()).isEqualTo(String.class);
    }
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.internal.metadata.holder.PropertyMeta

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.