package com.parikls.movieland.web.dao.rowmapper;

import com.parikls.movieland.util.Constant;
import com.parikls.movieland.web.dao.entity.Country;
import org.springframework.jdbc.core.RowMapper;

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

public class CountryRowMapper implements RowMapper<Country> {

    @Override
    public Country mapRow(ResultSet rs, int rowNum) throws SQLException {
        Country country = new Country();
        country.setId(rs.getLong(Constant.ID));
        country.setName(rs.getString(Constant.NAME));
        return country;
    }
}