# PilotLotInfoMapper.java

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

    import com.mycim.framework.jdbc.mapper.RowMapper;
    import com.mycim.valueobject.prp.Item;
    import com.mycim.valueobject.prp.Operation;
    import com.mycim.valueobject.prp.ProcessPlanning;
    import com.mycim.valueobject.prp.Route;
    import com.mycim.valueobject.security.UserGroup;
    import com.mycim.valueobject.wip.Lot;
    import com.mycim.valueobject.wip.PilotLotInfo;

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

    /**
     * @author andy
     */
    public class PilotLotInfoMapper implements RowMapper<PilotLotInfo> {

        @Override
        public PilotLotInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
            PilotLotInfo pilotLotInfo = new PilotLotInfo();
            Lot lot = new Lot(rs.getLong("lot_rrn"));
            pilotLotInfo.setLot(lot);
            pilotLotInfo.setEndProduct(new Item(rs.getLong("END_PRODUCT_RRN")));
            pilotLotInfo.setEndProcess(new ProcessPlanning(rs.getLong("END_PROCESS_RRN")));
            pilotLotInfo.setEndRoute(new Route(rs.getLong("END_ROUTE_RRN")));
            pilotLotInfo.getEndRoute().setInstanceId(rs.getString("END_ROUTE_ID"));
            pilotLotInfo.setEndWflStepPath(rs.getString("END_WFL_STEP_PATH"));
            pilotLotInfo.setEndOperation(new Operation(rs.getLong("END_OPERATION_RRN")));
            pilotLotInfo.getEndOperation().setInstanceId(rs.getString("END_OPERATION_ID"));
            pilotLotInfo.setQty(rs.getInt("QTY"));
            pilotLotInfo.setMinParentQty(rs.getInt("MIN_PARENT_QTY"));
            pilotLotInfo.setSkipUserGroup(new UserGroup(rs.getLong("SKIP_USER_GROUP_RRN")));
            pilotLotInfo.getSkipUserGroup().setInstanceId(rs.getString("SKIP_USER_GROUP_ID"));
            pilotLotInfo.setStatus(rs.getString("STATUS"));
            pilotLotInfo.setAttributeData1(rs.getString("ATTRIBUTE_DATA1"));
            pilotLotInfo.setAttributeData2(rs.getString("ATTRIBUTE_DATA2"));
            pilotLotInfo.setAttributeData3(rs.getString("ATTRIBUTE_DATA3"));
            pilotLotInfo.setAttributeData4(rs.getString("ATTRIBUTE_DATA4"));
            pilotLotInfo.setAttributeData5(rs.getString("ATTRIBUTE_DATA5"));
            pilotLotInfo.setPilotTimes(rs.getLong("PILOT_TIMES"));
            pilotLotInfo.setPilotRules(rs.getString("PILOT_RULES"));
            pilotLotInfo.setPilotLotType(rs.getString("PILOT_LOT_TYPE"));
            pilotLotInfo.setMeasureOperations(rs.getString("MEASURE_OPERATIONS"));
            pilotLotInfo.setAutoReleaseSpcHold(rs.getString("AUTO_RELEASE_SPC_HOLD"));
            pilotLotInfo.setAutoReleasePilotHold(rs.getString("AUTO_RELEASE_PILOT_HOLD"));
            pilotLotInfo.setAutoMergePilot(rs.getString("AUTO_MERGE_PILOT"));
            pilotLotInfo.setTransRrn(rs.getLong("trans_rrn"));
            return pilotLotInfo;
        }

    }