Package com.skyline.user.mapper

Source Code of com.skyline.user.mapper.EmailTokenMapper

package com.skyline.user.mapper;

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

import org.springframework.jdbc.core.RowMapper;

import com.skyline.user.model.EmailToken;
import com.skyline.user.type.EmailTokenType;

public class EmailTokenMapper implements RowMapper<EmailToken> {

  private final static EmailTokenMapper MAPPER = new EmailTokenMapper();

  public static EmailTokenMapper getMapper() {
    return MAPPER;
  }

  @Override
  public EmailToken mapRow(ResultSet rs, int arg1) throws SQLException {
    EmailToken t = new EmailToken();
    t.setChecked(rs.getBoolean("checked"));
    try {
      t.setCheckTime(rs.getTimestamp("checkTime"));
    } catch (Exception e) {
    }
    t.setEmail(rs.getString("email"));
    t.setId(rs.getLong("id"));
    t.setToken(rs.getString("token"));
    t.setType(EmailTokenType.valueOf(rs.getString("type")));
    t.setUserId(rs.getLong("userId"));
    return t;
  }

}
TOP

Related Classes of com.skyline.user.mapper.EmailTokenMapper

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.