package system;

import java.sql.SQLException;
import java.util.ArrayList;

import common.DBAccessWrapper;
import common.Entity;

/**
 *
 * @author 無糖ブラック
 *
 */
public class ColumnMaster extends Entity {

	/**
	 *
	 * @param db
	 * @param keys
	 * @param values
	 */
	public ColumnMaster(DBAccessWrapper db, ArrayList<String> keys, ArrayList<String> values) {
		super(db, keys,values);
	}


	/**
	 *
	 * @return
	 * @throws ClassNotFoundException
	 * @throws SQLException
	 */
	public ColumnSetting getColumnSetting(String personId) throws SQLException, ClassNotFoundException {

		ClassColumnSetting clsColumnSetting = new ClassColumnSetting(m_db);

		String condition = "";
		ArrayList<String> conditionTypes = new ArrayList<String>();
		ArrayList<Object> conditionValues = new ArrayList<Object>();

		condition = "SUPER_IDENTIFICATION = ? and USER_NUMBER = ?";
		conditionTypes.add("int");
		conditionTypes.add("string");
		conditionValues.add(identification());
		conditionValues.add(personId);

		ArrayList<ColumnSetting> objects = clsColumnSetting.select(condition, conditionTypes, conditionValues);

		return objects.get(0);
	}
}
