# DoorMapper.java

    package com.mycim.server.carrier.dao.mapper;

    import com.mycim.framework.jdbc.mapper.RowMapper;
    import com.mycim.valueobject.ems.Door;

    import java.sql.ResultSet;
    import java.sql.SQLException;

    public class DoorMapper implements RowMapper<Door> {

        @Override
        public Door mapRow(ResultSet rs, int rowNum) throws SQLException {
            Door door = new Door();
            // construct the value object
            door.setInstanceRrn(rs.getLong("instance_rrn"));
            door.setInstanceId(rs.getString("instance_id"));
            door.setInstanceDesc(rs.getString("instance_desc"));
            door.setDoorStatus(rs.getString("current_status"));
            door.setDoorPollutionLevel(rs.getString("pollution_level"));
            door.setCarrierCode(rs.getString("door_code"));
            door.setAllowableEventsId(rs.getString("allowable_events_id"));
            door.setObjectSubtype(rs.getString("door_type"));
            door.setMaintenanceEngineerId(rs.getString("engineer_group_id"));
            door.setNamedSpace(rs.getString("named_space"));
            door.setObject(rs.getString("object"));
            door.setObjectType(rs.getString("object_type"));
            door.setMcsMoveStatus(rs.getString("mcs_move_status"));
            door.setMcsLastMoveTime(rs.getTimestamp("mcs_last_move_time"));
            door.setMcsLastOperatorRrn(new Long(rs.getLong("mcs_last_operator_rrn")));
            door.setEqptRrn(new Long(rs.getLong("eqpt_rrn")));
            door.setJobRrn(new Long(rs.getLong("job_rrn")));
            door.setRunRrn(new Long(rs.getLong("run_rrn")));
            door.setCarrierMapRrn(new Long(rs.getLong("carrier_map_rrn")));
            door.setLoadPosition(new Short(rs.getShort("load_position")));
            door.setFlagType(rs.getString("flag_type"));

            return door;
        }

    }