public class BeanListHandler extends GenericListHandler
ResultSetHandler
implementation that converts a
ResultSet
into a List
of beans. This class is
thread safe.ResultSetHandler
Modifier and Type | Field and Description |
---|---|
private RowProcessor |
convert
The RowProcessor implementation to use when converting rows
into beans.
|
private java.lang.Class |
type
The Class of beans produced by this handler.
|
Constructor and Description |
---|
BeanListHandler(java.lang.Class type)
Creates a new instance of BeanListHandler.
|
BeanListHandler(java.lang.Class type,
RowProcessor convert)
Creates a new instance of BeanListHandler.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
handleRow(java.sql.ResultSet rs)
Convert the
ResultSet row into a bean with
the Class given in the constructor. |
handle
private java.lang.Class type
private RowProcessor convert
public BeanListHandler(java.lang.Class type)
type
- The Class that objects returned from handle()
are created from.public BeanListHandler(java.lang.Class type, RowProcessor convert)
type
- The Class that objects returned from handle()
are created from.convert
- The RowProcessor
implementation
to use when converting rows into beans.protected java.lang.Object handleRow(java.sql.ResultSet rs) throws java.sql.SQLException
ResultSet
row into a bean with
the Class
given in the constructor.handleRow
in class GenericListHandler
rs
- ResultSet
to process.null
.java.sql.SQLException
- if a database access error occursGenericListHandler.handle(ResultSet)