Package com.skyline.base.mapper

Source Code of com.skyline.base.mapper.NotificationMapper

package com.skyline.base.mapper;

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

import org.springframework.jdbc.core.RowMapper;

import com.skyline.base.model.Notification;
import com.skyline.base.type.NotificationType;

/**
* Notificationçš„Mapper
*
* @author jairus
*
*@version 0.1
*/
public class NotificationMapper implements RowMapper<Notification> {

  private static final NotificationMapper MAPPER = new NotificationMapper();

  public static NotificationMapper getMapper() {
    return MAPPER;
  }

  public Notification mapRow(ResultSet rs, int rowNum) throws SQLException {
    Notification notification = new Notification();
    notification.setId(rs.getLong("id"));
    notification.setNotifierId(rs.getLong("notifierId"));
    notification.setNotifierNickname(rs.getString("notifierNickname"));
    notification.setOwnerId(rs.getLong("ownerId"));
    notification.setResourceId(rs.getLong("resourceId"));
    notification.setResourceTitle(rs.getString("resourceTitle"));
    notification.setType(NotificationType.valueOf(rs.getString("type")));
    return notification;
  }

}
TOP

Related Classes of com.skyline.base.mapper.NotificationMapper

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.