package org.jfox.dao.mapping;

import java.lang.reflect.InvocationTargetException;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

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

public class BigDecimalColumnMapping extends ColumnMapping {

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

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

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

    public static void main(String[] args) {

    }
}

