All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.simpleflatmapper.jdbc.property.IndexedSetterProperty Maven / Gradle / Ivy

Go to download

Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.

There is a newer version: 9.0.2
Show newest version
package org.simpleflatmapper.jdbc.property;


import org.simpleflatmapper.jdbc.impl.setter.PreparedStatementSetterImpl;
import org.simpleflatmapper.map.property.SetterFactoryProperty;
import org.simpleflatmapper.map.mapper.PropertyMapping;
import org.simpleflatmapper.reflect.IndexedSetter;
import org.simpleflatmapper.reflect.Setter;
import org.simpleflatmapper.reflect.SetterFactory;

import java.lang.reflect.Type;
import java.sql.PreparedStatement;

public class IndexedSetterProperty extends SetterFactoryProperty {

    private final IndexedSetter setter;

    public 

IndexedSetterProperty(final IndexedSetter setter) { super(new SetterFactory() { @SuppressWarnings("unchecked") @Override public Setter getSetter(Object arg) { return new PreparedStatementSetterImpl(((PropertyMapping)arg).getColumnKey().getIndex(), (IndexedSetter) setter); } }, PreparedStatement.class); this.setter = setter; } public IndexedSetter getIndexedSetter() { return setter; } @Override public String toString() { return "IndexedSetter{IndexedSetter}"; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy