- 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 Summary
Modifier and TypeMethodDescriptionhandle(ResultSet resultSet, SelectQuery query, ResultSetRowIndexConsumer consumer) Processes a ResultSet and converts it into the specified result type.
-
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 processquery- the query that produced this ResultSetconsumer- 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
-