title: Upgrading from ParameterizedRowMapper to SingleColumnRowMapper for multiple columns
body: <p>I'm upgrading a Spring 3 application to Spring 4. My <a href="http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/stereotype/Repository.html" rel="nofollow noreferrer"><code>@Repository</code></a> has <a href="https://docs.spring.io/spring/docs/4.1.0.RELEASE/javadoc-api/org/springframework/jdbc/core/simple/ParameterizedRowMapper.html" rel="nofollow noreferrer"><code>ParameterizedRowMapper</code></a> objects to map the SQL results to objects. But since Spring 4 that interface has been <a href="http://docs.spring.io/spring/docs/current/javadoc-api/deprecated-list.html#interface" rel="nofollow noreferrer">deprecated</a> "in favor of the regular <a href="http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/jdbc/core/SingleColumnRowMapper.html" rel="nofollow noreferrer"><code>SingleColumnRowMapper</code></a>". But I use mappers for mapping <strong>multiple</strong> columns. How am I meant to map multiple columns using <code>SingleColumnRowMapper</code>? Or am I meant to be doing something completely different?</p>
  
  <p>For example, here is the kind of code I have now:</p>
  
  <pre><code>    private static final ParameterizedRowMapper&lt;Thing&gt; THING_ENTRY_MAPPER = new ParameterizedRowMapper&lt;Thing&gt;() {
  
         @Override
         public Thing mapRow(ResultSet rs, int rowNum) throws SQLException {
            return new Thing(rs.getLong(1), rs.getLong(2), rs.getInt(3));
         }
      };
  
  
      @Override
      public List&lt;Thing&gt; getThings(
            ID id, long start, long end) {
         final Map&lt;String, Object&gt; params = new HashMap&lt;String, Object&gt;(4);
         putIDParams(params, id);
         putTimeRangeParams(params, start, end);
         return getNamedParameterJdbcTemplate().query(QUERY_THING, params,
               THING_ENTRY_MAPPER);
      }
  </code></pre>
  
  <p>How should I be implementing that kind of functionality now?</p>