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

org.simpleflatmapper.jdbc.impl.setter.BooleanPreparedStatementSetter Maven / Gradle / Ivy

package org.simpleflatmapper.jdbc.impl.setter;

import org.simpleflatmapper.converter.Context;
import org.simpleflatmapper.map.setter.BooleanContextualSetter;
import org.simpleflatmapper.map.setter.ContextualSetter;
import org.simpleflatmapper.reflect.Setter;
import org.simpleflatmapper.reflect.primitive.BooleanSetter;

import java.sql.PreparedStatement;

public class BooleanPreparedStatementSetter implements ContextualSetter, BooleanContextualSetter {

    private final int columnIndex;
    private final BooleanPreparedStatementIndexSetter setter = new BooleanPreparedStatementIndexSetter();

    public BooleanPreparedStatementSetter(int columnIndex) {
        this.columnIndex = columnIndex;
    }

    @Override
    public void setBoolean(PreparedStatement target, boolean value, Context context) throws Exception {
        setter.setBoolean(target, value, columnIndex, context);
    }

    @Override
    public void set(PreparedStatement target, Boolean value, Context context) throws Exception {
        setter.set(target, value, columnIndex, context);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy