Package com.skyline.wo.mapper

Source Code of com.skyline.wo.mapper.ShortMessageMapper

package com.skyline.wo.mapper;

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

import org.springframework.jdbc.core.RowMapper;

import com.skyline.wo.model.ShortMessage;

public class ShortMessageMapper  implements RowMapper<ShortMessage> {
 
  private static final ShortMessageMapper MAPPER = new ShortMessageMapper();
 
  public static ShortMessageMapper getMapper() {
    return MAPPER;
  }

  @Override
  public ShortMessage mapRow(ResultSet rs, int rowNum) throws SQLException {
    ShortMessage s = new ShortMessage();
    s.setCreateTime(rs.getTimestamp("createTime"));
    s.setId(rs.getLong("id"));
    //s.setImg(rs.getString("img"));
    s.setOwnerId(rs.getLong("ownerId"));
    s.setOwnerNickname(rs.getString("ownerNickname"));
    s.setOwnerPortrait(rs.getString("ownerPortrait"));
   
    s.setText(rs.getString("text"));
    //s.setVideo(rs.getString("video"));
    s.setComment(rs.getString("comment"));
    s.setSourceOwnerId(rs.getLong("sourceOwnerId"));
    s.setSourceOwnerNickname(rs.getString("sourceOwnerNickname"));
   
    return s;
  }
}
TOP

Related Classes of com.skyline.wo.mapper.ShortMessageMapper

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.