package org.jfox.dao.mapping;

import java.lang.reflect.InvocationTargetException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Time;

/**
 * @author <a href="mailto:yangyong@ufsoft.com.cn">Young Yang</a>
 */

public class TimeColumnMapping extends ColumnMapping {

    public TimeColumnMapping(String columnName, Class type) {
        super(columnName, type);
    }

    public void doFillStatement(PreparedStatement pst, Object value, int index) throws SQLException, IllegalAccessException, InvocationTargetException {
        pst.setTime(index,(Time)value);
    }

    public void doFillObject(Object target, ResultSet rset) throws SQLException, IllegalAccessException, InvocationTargetException {
        getSetterMethod().invoke(target,new Object[]{rset.getTime(getColumnName())});
    }

    public static void main(String[] args) {

    }
}

