Search in sources :

Example 6 with PropertyMapping

use of org.simpleflatmapper.map.mapper.PropertyMapping in project SimpleFlatMapper by arnaudroger.

the class CsvMapperBuilder method buildDelayedSetters.

@SuppressWarnings({ "unchecked" })
private DelayedCellSetterFactory<T, ?>[] buildDelayedSetters(final ParsingContextFactoryBuilder parsingContextFactoryBuilder, int delayedSetterEnd, boolean hasKeys) {
    final Map<String, CsvMapperBuilder<?>> delegateMapperBuilders = new HashMap<String, CsvMapperBuilder<?>>();
    final Map<String, Integer> propertyToMapperIndex = new HashMap<String, Integer>();
    final DelayedCellSetterFactory<T, ?>[] delayedSetters = new DelayedCellSetterFactory[delayedSetterEnd];
    final int newMinDelayedSetter = minDelayedSetter != 0 ? minDelayedSetter : hasKeys ? delayedSetterEnd : 0;
    propertyMappingsBuilder.forEachProperties(new ForEachCallBack<PropertyMapping<T, ?, CsvColumnKey, CsvColumnDefinition>>() {

        final CellSetterFactory cellSetterFactory = new CellSetterFactory(cellValueReaderFactory, mapperConfig.mapperBuilderErrorHandler());

        @Override
        public void handle(PropertyMapping<T, ?, CsvColumnKey, CsvColumnDefinition> propMapping) {
            if (propMapping != null) {
                PropertyMeta<T, ?> prop = propMapping.getPropertyMeta();
                CsvColumnKey key = propMapping.getColumnKey();
                if (prop != null) {
                    if (prop.isSubProperty()) {
                        addSubProperty(delegateMapperBuilders, prop, key, propMapping.getColumnDefinition());
                    } else {
                        delayedSetters[propMapping.getColumnKey().getIndex()] = cellSetterFactory.getDelayedCellSetter(prop, key.getIndex(), propMapping.getColumnDefinition(), parsingContextFactoryBuilder);
                    }
                }
            }
        }

        private <I, P> void addSubProperty(Map<String, CsvMapperBuilder<?>> delegateMapperBuilders, PropertyMeta<T, P> prop, CsvColumnKey key, CsvColumnDefinition columnDefinition) {
            SubPropertyMeta<T, I, P> subPropertyMeta = (SubPropertyMeta<T, I, P>) prop;
            final PropertyMeta<T, I> propOwner = subPropertyMeta.getOwnerProperty();
            CsvMapperBuilder<I> delegateMapperBuilder = (CsvMapperBuilder<I>) delegateMapperBuilders.get(propOwner.getName());
            if (delegateMapperBuilder == null) {
                delegateMapperBuilder = new CsvMapperBuilder<I>(propOwner.getPropertyType(), propOwner.getPropertyClassMeta(), newMinDelayedSetter, cellValueReaderFactory, mapperConfig);
                delegateMapperBuilders.put(propOwner.getName(), delegateMapperBuilder);
            }
            Integer currentIndex = propertyToMapperIndex.get(propOwner.getName());
            if (currentIndex == null || currentIndex < key.getIndex()) {
                propertyToMapperIndex.put(propOwner.getName(), key.getIndex());
            }
            delegateMapperBuilder.addMapping(subPropertyMeta.getSubProperty(), key, columnDefinition);
        }
    }, 0, delayedSetterEnd);
    final Map<String, CsvMapper<?>> mappers = new HashMap<String, CsvMapper<?>>();
    propertyMappingsBuilder.forEachProperties(new ForEachCallBack<PropertyMapping<T, ?, CsvColumnKey, CsvColumnDefinition>>() {

        @Override
        public void handle(PropertyMapping<T, ?, CsvColumnKey, CsvColumnDefinition> propMapping) {
            if (propMapping == null)
                return;
            PropertyMeta<T, ?> prop = propMapping.getPropertyMeta();
            if (prop.isSubProperty()) {
                addSubPropertyDelayedSetter(delegateMapperBuilders, delayedSetters, propMapping.getColumnKey().getIndex(), prop);
            }
        }

        private <I, P> void addSubPropertyDelayedSetter(Map<String, CsvMapperBuilder<?>> delegateMapperBuilders, DelayedCellSetterFactory<T, ?>[] delayedSetters, int setterIndex, PropertyMeta<T, P> prop) {
            PropertyMeta<T, I> subProp = ((SubPropertyMeta<T, I, P>) prop).getOwnerProperty();
            final String propName = subProp.getName();
            CsvMapper<I> mapper = (CsvMapper<I>) mappers.get(propName);
            if (mapper == null) {
                CsvMapperBuilder<I> delegateMapperBuilder = (CsvMapperBuilder<I>) delegateMapperBuilders.get(propName);
                mapper = delegateMapperBuilder.mapper();
                mappers.put(propName, mapper);
            }
            int indexOfMapper = propertyToMapperIndex.get(propName);
            Setter<? super T, ? super I> setter = null;
            if (!subProp.isConstructorProperty()) {
                setter = subProp.getSetter();
            }
            delayedSetters[setterIndex] = new DelegateMarkerDelayedCellSetterFactory<T, I>(mapper, setter, setterIndex, indexOfMapper);
        }
    }, 0, delayedSetterEnd);
    return delayedSetters;
}
Also used : HashMap(java.util.HashMap) SubPropertyMeta(org.simpleflatmapper.reflect.meta.SubPropertyMeta) ConstructorPropertyMeta(org.simpleflatmapper.reflect.meta.ConstructorPropertyMeta) SelfPropertyMeta(org.simpleflatmapper.reflect.meta.SelfPropertyMeta) SubPropertyMeta(org.simpleflatmapper.reflect.meta.SubPropertyMeta) PropertyMeta(org.simpleflatmapper.reflect.meta.PropertyMeta) DelayedCellSetterFactory(org.simpleflatmapper.csv.mapper.DelayedCellSetterFactory) DelayedCellSetterFactory(org.simpleflatmapper.csv.mapper.DelayedCellSetterFactory) PropertyMapping(org.simpleflatmapper.map.mapper.PropertyMapping) CellSetter(org.simpleflatmapper.csv.mapper.CellSetter) Setter(org.simpleflatmapper.reflect.Setter)

Example 7 with PropertyMapping

use of org.simpleflatmapper.map.mapper.PropertyMapping in project SimpleFlatMapper by arnaudroger.

the class CsvMapperBuilder method getSetters.

@SuppressWarnings({ "unchecked", "rawtypes" })
private CellSetter<T>[] getSetters(final ParsingContextFactoryBuilder parsingContextFactoryBuilder, final int delayedSetterEnd) {
    final Map<String, CsvMapperBuilder<?>> delegateMapperBuilders = new HashMap<String, CsvMapperBuilder<?>>();
    final Map<String, Integer> propertyToMapperIndex = new HashMap<String, Integer>();
    // calculate maxIndex
    int maxIndex = propertyMappingsBuilder.forEachProperties(new ForEachCallBack<PropertyMapping<T, ?, CsvColumnKey, CsvColumnDefinition>>() {

        int maxIndex = delayedSetterEnd;

        @Override
        public void handle(PropertyMapping<T, ?, CsvColumnKey, CsvColumnDefinition> propMapping) {
            if (propMapping != null) {
                maxIndex = Math.max(propMapping.getColumnKey().getIndex(), maxIndex);
                PropertyMeta<T, ?> prop = propMapping.getPropertyMeta();
                if (prop != null) {
                    CsvColumnKey key = propMapping.getColumnKey();
                    if (prop.isConstructorProperty()) {
                        throw new IllegalStateException("Unexpected ConstructorPropertyMeta at " + key.getIndex());
                    } else if (prop.isSubProperty()) {
                        final PropertyMeta<?, ?> propOwner = ((SubPropertyMeta) prop).getOwnerProperty();
                        CsvMapperBuilder<?> delegateMapperBuilder = delegateMapperBuilders.get(propOwner.getName());
                        if (delegateMapperBuilder == null) {
                            delegateMapperBuilder = new CsvMapperBuilder(propOwner.getPropertyType(), propOwner.getPropertyClassMeta(), minDelayedSetter, cellValueReaderFactory, mapperConfig);
                            delegateMapperBuilders.put(propOwner.getName(), delegateMapperBuilder);
                        }
                        Integer currentIndex = propertyToMapperIndex.get(propOwner.getName());
                        if (currentIndex == null || currentIndex < key.getIndex()) {
                            propertyToMapperIndex.put(propOwner.getName(), key.getIndex());
                        }
                        delegateMapperBuilder.addMapping(((SubPropertyMeta) prop).getSubProperty(), key, propMapping.getColumnDefinition());
                    }
                }
            }
        }
    }, delayedSetterEnd).maxIndex;
    // builder se setters
    final CellSetter<T>[] setters = new CellSetter[maxIndex + 1 - delayedSetterEnd];
    propertyMappingsBuilder.forEachProperties(new ForEachCallBack<PropertyMapping<T, ?, CsvColumnKey, CsvColumnDefinition>>() {

        final Map<String, CsvMapperImpl<?>> mappers = new HashMap<String, CsvMapperImpl<?>>();

        final CellSetterFactory cellSetterFactory = new CellSetterFactory(cellValueReaderFactory, mapperConfig.mapperBuilderErrorHandler());

        @Override
        public void handle(PropertyMapping<T, ?, CsvColumnKey, CsvColumnDefinition> propMapping) {
            if (propMapping == null) {
                return;
            }
            PropertyMeta<T, ?> prop = propMapping.getPropertyMeta();
            if (prop == null || prop instanceof SelfPropertyMeta) {
                return;
            }
            if (prop instanceof SubPropertyMeta) {
                DelegateMarkerSetter<T, ?> delegateMarkerSetter = getDelegateMarkerSetter((SubPropertyMeta) prop);
                setters[propMapping.getColumnKey().getIndex() - delayedSetterEnd] = delegateMarkerSetter;
            } else {
                setters[propMapping.getColumnKey().getIndex() - delayedSetterEnd] = cellSetterFactory.getCellSetter(prop, propMapping.getColumnKey().getIndex(), propMapping.getColumnDefinition(), parsingContextFactoryBuilder);
            }
        }

        private <I, P> DelegateMarkerSetter<T, I> getDelegateMarkerSetter(SubPropertyMeta<T, I, P> prop) {
            final String propName = prop.getOwnerProperty().getName();
            CsvMapperImpl<I> mapper = (CsvMapperImpl<I>) mappers.get(propName);
            if (mapper == null) {
                CsvMapperBuilder<I> delegateMapperBuilder = (CsvMapperBuilder<I>) delegateMapperBuilders.get(propName);
                mapper = (CsvMapperImpl<I>) delegateMapperBuilder.mapper();
                mappers.put(propName, mapper);
            }
            int indexOfMapper = propertyToMapperIndex.get(propName);
            return new DelegateMarkerSetter<T, I>(mapper, prop.getOwnerProperty().getSetter(), indexOfMapper);
        }
    }, delayedSetterEnd);
    return setters;
}
Also used : HashMap(java.util.HashMap) ForEachCallBack(org.simpleflatmapper.util.ForEachCallBack) SubPropertyMeta(org.simpleflatmapper.reflect.meta.SubPropertyMeta) ConstructorPropertyMeta(org.simpleflatmapper.reflect.meta.ConstructorPropertyMeta) SelfPropertyMeta(org.simpleflatmapper.reflect.meta.SelfPropertyMeta) SubPropertyMeta(org.simpleflatmapper.reflect.meta.SubPropertyMeta) PropertyMeta(org.simpleflatmapper.reflect.meta.PropertyMeta) CellSetter(org.simpleflatmapper.csv.mapper.CellSetter) SelfPropertyMeta(org.simpleflatmapper.reflect.meta.SelfPropertyMeta) DelayedCellSetterFactory(org.simpleflatmapper.csv.mapper.DelayedCellSetterFactory) PropertyMapping(org.simpleflatmapper.map.mapper.PropertyMapping)

Example 8 with PropertyMapping

use of org.simpleflatmapper.map.mapper.PropertyMapping in project SimpleFlatMapper by arnaudroger.

the class PreparedStatementMapperBuilder method buildIndexFieldMappers.

@SuppressWarnings("unchecked")
public MultiIndexFieldMapper<T>[] buildIndexFieldMappers() {
    final List<MultiIndexFieldMapper<T>> fields = new ArrayList<MultiIndexFieldMapper<T>>();
    propertyMappingsBuilder.forEachProperties(new ForEachCallBack<PropertyMapping<T, ?, JdbcColumnKey, FieldMapperColumnDefinition<JdbcColumnKey>>>() {

        @Override
        public void handle(PropertyMapping<T, ?, JdbcColumnKey, FieldMapperColumnDefinition<JdbcColumnKey>> pm) {
            if (isMultiIndex(pm.getPropertyMeta())) {
                fields.add(newCollectionFieldMapper(pm));
            } else {
                fields.add(newFieldMapper(pm));
            }
        }

        private <P, C> MultiIndexFieldMapper<T> newCollectionFieldMapper(PropertyMapping<T, P, JdbcColumnKey, FieldMapperColumnDefinition<JdbcColumnKey>> pm) {
            PropertyMeta<T, ?> propertyMeta = pm.getPropertyMeta();
            IndexedGetter<C, P> indexedGetter;
            IntGetter<? super C> sizeGetter;
            Getter<T, C> collectionGetter = (Getter<T, C>) propertyMeta.getGetter();
            if (TypeHelper.isAssignable(List.class, propertyMeta.getPropertyType())) {
                indexedGetter = (IndexedGetter<C, P>) new ListIndexedGetter<P>();
                sizeGetter = (IntGetter<C>) new ListSizeGetter();
            } else if (TypeHelper.isArray(propertyMeta.getPropertyType())) {
                indexedGetter = (IndexedGetter<C, P>) new ArrayIndexedGetter<P>();
                sizeGetter = new ArraySizeGetter();
            } else {
                throw new IllegalArgumentException("Unexpected elementMeta" + propertyMeta);
            }
            PropertyMeta<C, P> childProperty = (PropertyMeta<C, P>) pm.getPropertyMeta().getPropertyClassMeta().newPropertyFinder(ConstantPredicate.<PropertyMeta<?, ?>>truePredicate()).findProperty(DefaultPropertyNameMatcher.of("0"), pm.getColumnDefinition().properties());
            final PropertyMapping<C, P, JdbcColumnKey, FieldMapperColumnDefinition<JdbcColumnKey>> pmchildProperttMeta = pm.propertyMeta(childProperty);
            IndexedSetter<PreparedStatement, P> setter = getSetter(pmchildProperttMeta);
            return new CollectionIndexFieldMapper<T, C, P>(setter, collectionGetter, sizeGetter, indexedGetter);
        }

        private <P, C> IndexedSetter<PreparedStatement, P> getSetter(PropertyMapping<C, P, JdbcColumnKey, FieldMapperColumnDefinition<JdbcColumnKey>> pm) {
            IndexedSetter<PreparedStatement, P> setter = null;
            IndexedSetterProperty indexedSetterProperty = pm.getColumnDefinition().lookFor(IndexedSetterProperty.class);
            if (indexedSetterProperty != null) {
                setter = (IndexedSetter<PreparedStatement, P>) indexedSetterProperty.getIndexedSetter();
            }
            if (setter == null) {
                setter = indexedSetterFactory(pm);
            }
            if (setter == null) {
                mapperConfig.mapperBuilderErrorHandler().accessorNotFound("Could not find setter for " + pm.getColumnKey() + " type " + pm.getPropertyMeta().getPropertyType() + " path " + pm.getPropertyMeta().getPath() + " See " + ErrorDoc.toUrl("PS_SETTER_NOT_FOUND"));
            }
            return setter;
        }

        private <P, C> IndexedSetter<PreparedStatement, P> indexedSetterFactory(PropertyMapping<C, P, JdbcColumnKey, FieldMapperColumnDefinition<JdbcColumnKey>> pm) {
            IndexedSetter<PreparedStatement, P> setter = null;
            final IndexedSetterFactoryProperty indexedSetterPropertyFactory = pm.getColumnDefinition().lookFor(IndexedSetterFactoryProperty.class);
            if (indexedSetterPropertyFactory != null) {
                IndexedSetterFactory<PreparedStatement, PropertyMapping<?, ?, JdbcColumnKey, FieldMapperColumnDefinition<JdbcColumnKey>>> setterFactory = (IndexedSetterFactory<PreparedStatement, PropertyMapping<?, ?, JdbcColumnKey, FieldMapperColumnDefinition<JdbcColumnKey>>>) indexedSetterPropertyFactory.getIndexedSetterFactory();
                setter = setterFactory.getIndexedSetter(pm);
            }
            if (setter == null) {
                setter = indexedSetterFactory.getIndexedSetter(pm);
            }
            if (setter == null) {
                final ClassMeta<P> classMeta = pm.getPropertyMeta().getPropertyClassMeta();
                if (classMeta instanceof ObjectClassMeta) {
                    ObjectClassMeta<P> ocm = (ObjectClassMeta<P>) classMeta;
                    if (ocm.getNumberOfProperties() == 1) {
                        PropertyMeta<P, ?> subProp = ocm.getFirstProperty();
                        final PropertyMapping<?, ?, JdbcColumnKey, FieldMapperColumnDefinition<JdbcColumnKey>> subPropertyMapping = pm.propertyMeta(subProp);
                        IndexedSetter<PreparedStatement, ?> subSetter = indexedSetterFactory(subPropertyMapping);
                        if (subSetter != null) {
                            setter = new PreparedStatementIndexSetterOnGetter<Object, P>((PreparedStatementIndexSetter<Object>) subSetter, (Getter<P, Object>) subProp.getGetter());
                        }
                    }
                }
            }
            return setter;
        }

        private <P> MultiIndexFieldMapper<T> newFieldMapper(PropertyMapping<T, P, JdbcColumnKey, FieldMapperColumnDefinition<JdbcColumnKey>> pm) {
            return new SingleIndexFieldMapper<T, P>(getSetter(pm), pm.getPropertyMeta().getGetter());
        }
    });
    return fields.toArray(new MultiIndexFieldMapper[0]);
}
Also used : FieldMapperColumnDefinition(org.simpleflatmapper.map.property.FieldMapperColumnDefinition) ListIndexedGetter(org.simpleflatmapper.reflect.getter.ListIndexedGetter) Getter(org.simpleflatmapper.reflect.Getter) ArraySizeGetter(org.simpleflatmapper.reflect.getter.ArraySizeGetter) IntGetter(org.simpleflatmapper.reflect.primitive.IntGetter) ArrayIndexedGetter(org.simpleflatmapper.reflect.getter.ArrayIndexedGetter) IndexedGetter(org.simpleflatmapper.reflect.IndexedGetter) PreparedStatementIndexSetterOnGetter(org.simpleflatmapper.jdbc.impl.setter.PreparedStatementIndexSetterOnGetter) ListSizeGetter(org.simpleflatmapper.reflect.getter.ListSizeGetter) ArrayIndexedGetter(org.simpleflatmapper.reflect.getter.ArrayIndexedGetter) ArrayList(java.util.ArrayList) IndexedSetterFactoryProperty(org.simpleflatmapper.jdbc.property.IndexedSetterFactoryProperty) PropertyMeta(org.simpleflatmapper.reflect.meta.PropertyMeta) ArrayList(java.util.ArrayList) List(java.util.List) IndexedSetterProperty(org.simpleflatmapper.jdbc.property.IndexedSetterProperty) PreparedStatementIndexSetterOnGetter(org.simpleflatmapper.jdbc.impl.setter.PreparedStatementIndexSetterOnGetter) ObjectClassMeta(org.simpleflatmapper.reflect.meta.ObjectClassMeta) ClassMeta(org.simpleflatmapper.reflect.meta.ClassMeta) IndexedSetterFactory(org.simpleflatmapper.reflect.IndexedSetterFactory) PreparedStatementIndexedSetterFactory(org.simpleflatmapper.jdbc.impl.PreparedStatementIndexedSetterFactory) PreparedStatement(java.sql.PreparedStatement) ArraySizeGetter(org.simpleflatmapper.reflect.getter.ArraySizeGetter) IndexedSetter(org.simpleflatmapper.reflect.IndexedSetter) ListIndexedGetter(org.simpleflatmapper.reflect.getter.ListIndexedGetter) ArrayIndexedGetter(org.simpleflatmapper.reflect.getter.ArrayIndexedGetter) IndexedGetter(org.simpleflatmapper.reflect.IndexedGetter) PropertyMapping(org.simpleflatmapper.map.mapper.PropertyMapping) ObjectClassMeta(org.simpleflatmapper.reflect.meta.ObjectClassMeta) ListSizeGetter(org.simpleflatmapper.reflect.getter.ListSizeGetter) IntGetter(org.simpleflatmapper.reflect.primitive.IntGetter)

Example 9 with PropertyMapping

use of org.simpleflatmapper.map.mapper.PropertyMapping in project SimpleFlatMapper by arnaudroger.

the class FieldMapperToAppendableFactory method setterFromFactory.

@SuppressWarnings("unchecked")
private <S, P> Setter<Appendable, ? super P> setterFromFactory(PropertyMapping<S, P, CsvColumnKey, FieldMapperColumnDefinition<CsvColumnKey>> pm) {
    Setter<Appendable, ? super P> setter = null;
    final SetterFactoryProperty setterFactoryProperty = pm.getColumnDefinition().lookFor(SetterFactoryProperty.class);
    if (setterFactoryProperty != null) {
        final SetterFactory<Appendable, PropertyMapping<S, P, CsvColumnKey, FieldMapperColumnDefinition<CsvColumnKey>>> setterFactory = (SetterFactory<Appendable, PropertyMapping<S, P, CsvColumnKey, FieldMapperColumnDefinition<CsvColumnKey>>>) setterFactoryProperty.getSetterFactory();
        setter = setterFactory.getSetter(pm);
    }
    if (setter == null) {
        if (!pm.getPropertyMeta().isSelf()) {
            final ClassMeta<P> classMeta = pm.getPropertyMeta().getPropertyClassMeta();
            if (classMeta instanceof ObjectClassMeta) {
                ObjectClassMeta<P> ocm = (ObjectClassMeta<P>) classMeta;
                if (ocm.getNumberOfProperties() == 1) {
                    PropertyMeta<P, ?> subProp = ocm.getFirstProperty();
                    Setter<Appendable, Object> subSetter = (Setter<Appendable, Object>) setterFromFactory(pm.propertyMeta(subProp));
                    if (subSetter != null) {
                        setter = new SetterOnGetter<Appendable, Object, P>(subSetter, (Getter<P, Object>) subProp.getGetter());
                    } else {
                        return new ObjectToStringSetter<P>(subProp.getGetter());
                    }
                }
            }
        }
    }
    return setter;
}
Also used : FieldMapperColumnDefinition(org.simpleflatmapper.map.property.FieldMapperColumnDefinition) CharacterGetter(org.simpleflatmapper.reflect.primitive.CharacterGetter) ShortGetter(org.simpleflatmapper.reflect.primitive.ShortGetter) LongGetter(org.simpleflatmapper.reflect.primitive.LongGetter) BooleanGetter(org.simpleflatmapper.reflect.primitive.BooleanGetter) Getter(org.simpleflatmapper.reflect.Getter) IntGetter(org.simpleflatmapper.reflect.primitive.IntGetter) FloatGetter(org.simpleflatmapper.reflect.primitive.FloatGetter) SetterOnGetter(org.simpleflatmapper.reflect.setter.SetterOnGetter) ByteGetter(org.simpleflatmapper.reflect.primitive.ByteGetter) DoubleGetter(org.simpleflatmapper.reflect.primitive.DoubleGetter) SetterFactory(org.simpleflatmapper.reflect.SetterFactory) SetterFactoryProperty(org.simpleflatmapper.map.property.SetterFactoryProperty) PropertyMapping(org.simpleflatmapper.map.mapper.PropertyMapping) CsvColumnKey(org.simpleflatmapper.csv.CsvColumnKey) Setter(org.simpleflatmapper.reflect.Setter) ObjectClassMeta(org.simpleflatmapper.reflect.meta.ObjectClassMeta)

Example 10 with PropertyMapping

use of org.simpleflatmapper.map.mapper.PropertyMapping in project SimpleFlatMapper by arnaudroger.

the class PreparedStatementFieldMapperFactoryTest method testCustomSetterFactory.

@Test
public void testCustomSetterFactory() throws Exception {
    Object o = new Object();
    newFieldMapperAndMapToPS(new ConstantGetter<Object, Object>(o), Object.class, new SetterFactoryProperty(new SetterFactory<PreparedStatement, PropertyMapping<?, ?, ?, ?>>() {

        @Override
        public <P> Setter<PreparedStatement, P> getSetter(PropertyMapping<?, ?, ?, ?> arg) {
            return new Setter<PreparedStatement, P>() {

                @Override
                public void set(PreparedStatement target, P value) throws Exception {
                    ps.setString(36, "bb");
                }
            };
        }
    }));
    verify(ps).setString(36, "bb");
}
Also used : SetterFactory(org.simpleflatmapper.reflect.SetterFactory) PreparedStatementSetterFactory(org.simpleflatmapper.jdbc.impl.PreparedStatementSetterFactory) PropertyMapping(org.simpleflatmapper.map.mapper.PropertyMapping) Setter(org.simpleflatmapper.reflect.Setter) DbObject(org.simpleflatmapper.test.beans.DbObject) SetterFactoryProperty(org.simpleflatmapper.map.property.SetterFactoryProperty) Test(org.junit.Test) ResultSetGetterFactoryTest(org.simpleflatmapper.jdbc.test.impl.getter.ResultSetGetterFactoryTest)

Aggregations

PropertyMapping (org.simpleflatmapper.map.mapper.PropertyMapping)11 FieldMapperColumnDefinition (org.simpleflatmapper.map.property.FieldMapperColumnDefinition)6 PropertyMeta (org.simpleflatmapper.reflect.meta.PropertyMeta)5 Setter (org.simpleflatmapper.reflect.Setter)4 Test (org.junit.Test)3 HashMap (java.util.HashMap)2 CellSetter (org.simpleflatmapper.csv.mapper.CellSetter)2 DelayedCellSetterFactory (org.simpleflatmapper.csv.mapper.DelayedCellSetterFactory)2 JdbcColumnKey (org.simpleflatmapper.jdbc.JdbcColumnKey)2 SetterFactoryProperty (org.simpleflatmapper.map.property.SetterFactoryProperty)2 Getter (org.simpleflatmapper.reflect.Getter)2 SetterFactory (org.simpleflatmapper.reflect.SetterFactory)2 ConstructorPropertyMeta (org.simpleflatmapper.reflect.meta.ConstructorPropertyMeta)2 ObjectClassMeta (org.simpleflatmapper.reflect.meta.ObjectClassMeta)2 SelfPropertyMeta (org.simpleflatmapper.reflect.meta.SelfPropertyMeta)2 SubPropertyMeta (org.simpleflatmapper.reflect.meta.SubPropertyMeta)2 IntGetter (org.simpleflatmapper.reflect.primitive.IntGetter)2 DbObject (org.simpleflatmapper.test.beans.DbObject)2 Type (java.lang.reflect.Type)1 PreparedStatement (java.sql.PreparedStatement)1