- Type Parameters:
T- the type of object resulting from the packing
public interface ResultPacker<T>
-
Method Summary
Modifier and TypeMethodDescriptionFetches a single instance from the givenResultSet, assumingResultSet.next()has been calledIterates through the givenResultSet, packing its contents into aListusingget(ResultSet)in the order they appear.
-
Method Details
-
pack
Iterates through the givenResultSet, packing its contents into aListusingget(ResultSet)in the order they appear. This method does not close theResultSet.- Parameters:
resultSet- theResultSetinstance containing the query result to process- Returns:
- a
Listcontaining the data from the query result - Throws:
SQLException- thrown if anything goes wrong during the packingNullPointerException- in caseresultSetis null
-
get
Fetches a single instance from the givenResultSet, assumingResultSet.next()has been called- Parameters:
resultSet- theResultSet- Returns:
- the instance fetched from the
ResultSet - Throws:
SQLException- in case of failure
-