Class StructuredMapCallbackHandlerResultSetExtractor

java.lang.Object
com.randomnoun.common.spring.StructuredMapCallbackHandlerResultSetExtractor
All Implemented Interfaces:
org.springframework.jdbc.core.ResultSetExtractor<Object>

public class StructuredMapCallbackHandlerResultSetExtractor extends Object implements org.springframework.jdbc.core.ResultSetExtractor<Object>
A bit like a StructuredListResultSetExtractor, but executes a callback on each object, rather than returning List of them.
Author:
knoxg
See Also:
  • Constructor Details

  • Method Details

    • extractData

      public Object extractData(ResultSet rs) throws SQLException, org.springframework.dao.DataAccessException
      Required to support ResultSetExtractor interface
      Specified by:
      extractData in interface org.springframework.jdbc.core.ResultSetExtractor<Object>
      Parameters:
      rs - resultSet to process
      Returns:
      null
      Throws:
      SQLException
      org.springframework.dao.DataAccessException
    • processRow

      public void processRow(ResultSet rs) throws SQLException
      Used by the ResultReader interface to process a single row from the database.

      The row is read and matched against the 'levels' specified in the object constructor. As values change, tree branches are created in the returned structured List.

      Throws:
      SQLException
      See Also:
      • RowCallbackHandler.processRow(java.sql.ResultSet)