Interface ResultSetHandler<RESULT>

Type Parameters:
RESULT - the type of result that this handler produces
All Known Implementing Classes:
AbstractCollectorHandler, AbstractIterationHandler, AbstractResultListHandler, AbstractSingleResultHandler, AbstractStreamHandler, AssociationEntityPoolIterationHandler, BasicCollectorHandler, BasicResultListHandler, BasicSingleResultHandler, BasicStreamHandler, DomainCollectorHandler, DomainResultListHandler, DomainSingleResultHandler, DomainStreamHandler, EntityCollectorHandler, EntityIterationHandler, EntityPoolIterationHandler, EntityResultListHandler, EntitySingleResultHandler, EntityStreamHandler, MapCollectorHandler, MapIterationHandler, MappedResultStreamHandler, MapResultListHandler, MapSingleResultHandler, MapStreamHandler, OptionalBasicCollectorHandler, OptionalBasicResultListHandler, OptionalBasicSingleResultHandler, OptionalBasicStreamHandler, OptionalDomainCollectorHandler, OptionalDomainResultListHandler, OptionalDomainSingleResultHandler, OptionalDomainStreamHandler, OptionalDoubleCollectorHandler, OptionalDoubleResultListHandler, OptionalDoubleSingleResultHandler, OptionalDoubleStreamHandler, OptionalEntitySingleResultHandler, OptionalIntCollectorHandler, OptionalIntResultListHandler, OptionalIntSingleResultHandler, OptionalIntStreamHandler, OptionalLongCollectorHandler, OptionalLongResultListHandler, OptionalLongSingleResultHandler, OptionalLongStreamHandler, OptionalMapSingleResultHandler, ScalarCollectorHandler, ScalarIterationHandler, ScalarResultListHandler, ScalarSingleResultHandler, ScalarStreamHandler

public interface ResultSetHandler<RESULT>
An interface for handling JDBC ResultSet objects and converting them into application-specific result types.

This interface is responsible for processing database query results and transforming the raw ResultSet data into the desired Java objects. It's a key component in the data access layer that bridges the gap between database records and domain objects.

  • Method Details

    • handle

      Supplier<RESULT> handle(ResultSet resultSet, SelectQuery query, ResultSetRowIndexConsumer consumer) throws SQLException
      Processes a ResultSet and converts it into the specified result type.

      This method is called after executing a database query to process the returned ResultSet. It should iterate through the ResultSet and transform the data according to the implementation's logic. The consumer parameter can be used to track the current row position during processing.

      Parameters:
      resultSet - the JDBC ResultSet to process
      query - the query that produced this ResultSet
      consumer - a consumer that receives information about the current row being processed
      Returns:
      a supplier that provides the result of processing the ResultSet
      Throws:
      SQLException - if a database access error occurs during ResultSet processing