# CarrierMapper.java

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

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

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

    public class CarrierMapper implements RowMapper<Carrier> {

        @Override
        public Carrier mapRow(ResultSet rs, int rowNum) throws SQLException {
            Carrier carrier = new Carrier();
            // construct the value object
            carrier.setInstanceRrn(rs.getLong("instance_rrn"));
            carrier.setInstanceId(rs.getString("instance_id"));
            carrier.setInstanceDesc(rs.getString("instance_desc"));
            carrier.setCarrierStatus(rs.getString("current_status"));
            carrier.setCarrierPollutionLevel(rs.getString("pollution_level"));
            carrier.setCarrierCode(rs.getString("carrier_code"));
            carrier.setAllowableEventsId(rs.getString("allowable_events_id"));
            carrier.setObjectSubtype(rs.getString("carrier_type"));
            carrier.setMaintenanceEngineerId(rs.getString("engineer_group_id"));
            carrier.setNamedSpace(rs.getString("named_space"));
            carrier.setObject(rs.getString("object"));
            carrier.setObjectType(rs.getString("object_type"));
            carrier.setMcsMoveStatus(rs.getString("mcs_move_status"));
            carrier.setMcsLastMoveTime(rs.getTimestamp("mcs_last_move_time"));
            carrier.setMcsLastOperatorRrn(new Long(rs.getLong("mcs_last_operator_rrn")));
            carrier.setEqptRrn(new Long(rs.getLong("eqpt_rrn")));
            carrier.setJobRrn(new Long(rs.getLong("job_rrn")));
            carrier.setRunRrn(new Long(rs.getLong("run_rrn")));
            carrier.setCarrierMapRrn(new Long(rs.getLong("carrier_map_rrn")));
            carrier.setLoadPosition(new Short(rs.getShort("load_position")));
            carrier.setLocationRrn(rs.getLong("location_rrn"));
            carrier.setLocationId(rs.getString("location_id"));
            carrier.setSlotCount(rs.getLong("slot_count"));
            carrier.setFlagType(rs.getString("flag_type"));
            carrier.setDmmType(rs.getString("dmm_type"));
            carrier.setAvailableSlotCount(rs.getLong("available_slot_count"));
            return carrier;
        }

    }