# EmailMessageMapper.java

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

    import com.mycim.framework.jdbc.mapper.RowMapper;
    import com.mycim.valueobject.alm.EmailMessage;

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

    /**
     * @author andy
     */
    public class EmailMessageMapper implements RowMapper<EmailMessage> {

        @Override
        public EmailMessage mapRow(ResultSet rs, int rowNum) throws SQLException {
            EmailMessage emailMessage = new EmailMessage();
            emailMessage.setMessageRrn(rs.getLong("MESSAGE_RRN"));
            emailMessage.setFromUser(rs.getString("FROM_USER"));
            emailMessage.setToUsers(rs.getString("TO_USERS"));
            emailMessage.setCcUsers(rs.getString("CC_USERS"));
            emailMessage.setSubject(rs.getString("SUBJECT"));
            emailMessage.setContent(rs.getString("CONTENT"));
            emailMessage.setEmailType(rs.getString("EMAIL_TYPE"));
            emailMessage.setAttributeData1(rs.getString("ATTRIBUTE_DATA1"));
            emailMessage.setAttributeData2(rs.getString("ATTRIBUTE_DATA2"));
            emailMessage.setAttributeData3(rs.getString("ATTRIBUTE_DATA3"));
            emailMessage.setAttributeData4(rs.getString("ATTRIBUTE_DATA4"));
            emailMessage.setAttributeData5(rs.getString("ATTRIBUTE_DATA5"));
            return emailMessage;
        }

    }