001package org.itsallcode.jdbc.dialect;
002
003import java.sql.PreparedStatement;
004import java.sql.SQLException;
005
006/**
007 * Implementors of this interface optionally convert an object and set it on a
008 * {@link PreparedStatement}.
009 * 
010 * @param <T> object type
011 */
012public interface ColumnValueSetter<T> {
013
014    /**
015     * Optionally convert an object and set it on a {@link PreparedStatement}.
016     * 
017     * @param stmt           prepared statement
018     * @param parameterIndex parameter index
019     * @param object         object to convert
020     * @throws SQLException if setting fails
021     */
022    void setObject(PreparedStatement stmt, int parameterIndex, T object) throws SQLException;
023}