Class SkipNullResultSetExtractor<T>

java.lang.Object
com.randomnoun.common.spring.SkipNullResultSetExtractor<T>
Type Parameters:
T - The type of object that the supplied RowMapper will return
All Implemented Interfaces:
org.springframework.jdbc.core.ResultSetExtractor<List<T>>

public class SkipNullResultSetExtractor<T> extends Object implements org.springframework.jdbc.core.ResultSetExtractor<List<T>>
A ResultSetExtractor that uses a RowMapper to return a List of values from a ResultSet, but will not include nulls in the returned List. This could be used to return structured objects, where some records are used to modify existing results rather than returning new objects.
Author:
knoxg
  • Constructor Details

  • Method Details

    • extractData

      public List<T> extractData(ResultSet rs) throws SQLException, org.springframework.dao.DataAccessException
      Specified by:
      extractData in interface org.springframework.jdbc.core.ResultSetExtractor<T>
      Throws:
      SQLException
      org.springframework.dao.DataAccessException