Examples of forValues()


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

        // Build proxy when necessary
        switch (propertyMeta.type()) {
            case COUNTER:
                if (rawValue == null) {
                    final Counter counter = InternalCounterBuilder.initialValue(null);
                    propertyMeta.forValues().setValueToField(target, counter);
                }
                result = rawValue;
                break;
            case LIST:
                if (rawValue != null) {
View Full Code Here

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

        dirtyMap.put(method, dirtyChecker);
        Object value = null;
        if (args.length > 0) {
            value = args[0];
        }
        propertyMeta.forValues().setValueToField(target, value);
    }

    @Override
    public Object writeReplace() {
        return this.target;
View Full Code Here

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

            for (Definition column : columnDefinitions) {
                String columnName = column.getName();
                PropertyMeta pm = propertiesMap.get(columnName);
                if (pm != null) {
                    Object value = pm.forRowExtraction().invokeOnRowForFields(row);
                    pm.forValues().setValueToField(entity, value);
                }
            }
            PropertyMeta idMeta = meta.getIdMeta();
            if (idMeta.structure().isEmbeddedId()) {
                Object compoundKey = idMeta.forRowExtraction().extractCompoundPrimaryKeyFromRow(row, meta, entityState);
View Full Code Here

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

                }
            }
            PropertyMeta idMeta = meta.getIdMeta();
            if (idMeta.structure().isEmbeddedId()) {
                Object compoundKey = idMeta.forRowExtraction().extractCompoundPrimaryKeyFromRow(row, meta, entityState);
                idMeta.forValues().setValueToField(entity, compoundKey);
            }
        }
        return entity;
    }
View Full Code Here

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

        //When
        entityMapper.setValuesToClusteredCounterEntity(row, entityMeta, entity);

        //Then
        verify(counterMeta.forValues()).setValueToField(eq(entity), counterCaptor.capture());

        assertThat(counterCaptor.getValue().get()).isEqualTo(counterValue);
    }

    @Test
View Full Code Here

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

        CompleteBean actual = entityMapper.mapRowToEntityWithPrimaryKey(entityMeta, row, propertiesMap, MANAGED);

        assertThat(actual).isSameAs(entity);
        verify(idMeta.forValues()).setValueToField(entity, id);
        verify(valueMeta.forValues()).setValueToField(entity, "value");
    }

    @Test
    public void should_map_row_to_entity_with_primary_key() throws Exception {
        ClusteredEntity entity = new ClusteredEntity();
View Full Code Here

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

        when(idMeta.forRowExtraction().extractCompoundPrimaryKeyFromRow(row, entityMeta, MANAGED)).thenReturn(embeddedKey);

        ClusteredEntity actual = entityMapper.mapRowToEntityWithPrimaryKey(entityMeta, row, propertiesMap, MANAGED);

        assertThat(actual).isSameAs(entity);
        verify(idMeta.forValues()).setValueToField(entity, embeddedKey);
    }

    @Test
    public void should_not_map_row_to_entity_with_primary_key_when_entity_null() {
        ClusteredEntity actual = entityMapper.mapRowToEntityWithPrimaryKey(entityMeta, row, null, MANAGED);
View Full Code Here

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

        assertThat(factory.getCallbacks()).hasSize(1);
        assertThat(factory.getCallback(0)).isInstanceOf(ProxyInterceptor.class);

        verify(pm.forValues()).getValueFromField(entity);
        verify(pm.forValues()).setValueToField(realProxy, value);
        verify(counterMeta.forValues()).setValueToField(entity,null);
    }

    @Test
    public void should_build_null_proxy() throws Exception {
        assertThat(proxifier.buildProxyWithAllFieldsLoadedExceptCounters(null, context)).isNull();
View Full Code Here

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

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

        assertThat(meta.type()).isEqualTo(PropertyType.LIST);
        assertThat(meta.forValues().nullValueForCollectionAndMap()).isNotNull().isInstanceOf(List.class);
        assertThat(meta.structure().isStaticColumn()).isTrue();

        PropertyParsingContext context2 = newContext(Test.class, Test.class.getDeclaredField("mates"));
        PropertyMeta meta2 = parser.parse(context2);
        assertThat(meta2.type()).isEqualTo(PropertyType.LIST);
View Full Code Here

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

        assertThat(meta.structure().isStaticColumn()).isTrue();

        PropertyParsingContext context2 = newContext(Test.class, Test.class.getDeclaredField("mates"));
        PropertyMeta meta2 = parser.parse(context2);
        assertThat(meta2.type()).isEqualTo(PropertyType.LIST);
        assertThat(meta2.forValues().nullValueForCollectionAndMap()).isNotNull().isInstanceOf(List.class);
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Test
    public void should_parse_set() throws Exception {
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.