# EntityCounterRowMapper.java

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

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

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

    public class EntityCounterRowMapper implements RowMapper<EntityCounter> {

        @Override
        public EntityCounter mapRow(ResultSet rs, int rowNum) throws SQLException {
            EntityCounter entityCounter = new EntityCounter();
            entityCounter.setEntityRrn(rs.getLong("ENTITY_RRN"));
            entityCounter.setEntityId(rs.getString("ENTITY_ID"));
            entityCounter.setEntityDesc(rs.getString("INSTANCE_DESC"));
            entityCounter.setCounterType(rs.getString("COUNTER_TYPE"));
            entityCounter.setCounterDesc(rs.getString("COUNTER_DESC"));
            entityCounter.setTargetCount(rs.getLong("TARGET_COUNT"));
            entityCounter.setAlarmEnableFlag(rs.getString("ALARM_ENABLE_FLAG"));
            entityCounter.setAlarmId(rs.getString("ALARM_ID"));
            entityCounter.setWarningCount(rs.getLong("WARNING_COUNT"));
            entityCounter.setWarnAlarmEnableFlag(rs.getString("WARN_ALARM_ENABLE_FLAG"));
            entityCounter.setWarnAlarmId(rs.getString("WARN_ALARM_ID"));
            entityCounter.setActualCount(rs.getLong("ACTUAL_COUNT"));
            entityCounter.setChecklistRrn(rs.getLong("CHECKLIST_RRN"));
            entityCounter.setSequenceNumber((long) (rowNum + 1));

            return entityCounter;
        }

    }