package dao;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.krams.tutorial.oxm.SubscriptionRequest;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport;
public class MyMapper implements RowMapper<SubscriptionRequest> {
public SubscriptionRequest mapRow(ResultSet rs, int rowNum) throws SQLException {
SubscriptionRequest subscription = new SubscriptionRequest();
subscription.setId(rs.getInt(1));
subscription.setCity(rs.getString(2));
return subscription;
}
}
this is my class at the moment, it is a mapper for my 1 table
how can i use the same mapper class for other database tables? or for each table, i must create new mapper class?