Index: OptimalBeanListHandler.java
===================================================================
--- OptimalBeanListHandler.java (revision 536476)
+++ OptimalBeanListHandler.java (working copy)
@@ -19,6 +19,7 @@
import java.sql.ResultSet;
import java.sql.SQLException;
+import org.apache.commons.dbutils.ResultSetHandler;
import org.apache.commons.dbutils.RowProcessor;
/**
@@ -28,7 +29,7 @@
*
* @see org.apache.commons.dbutils.ResultSetHandler
*/
-public class BeanListHandler extends GenericListHandler {
+public class OptimalBeanListHandler implements ResultSetHandler {
/**
* The Class of beans produced by this handler.
@@ -47,7 +48,7 @@
* @param type The Class that objects returned from handle()
* are created from.
*/
- public BeanListHandler(Class type) {
+ public OptimalBeanListHandler(Class type) {
this.type = type;
}
@@ -59,22 +60,23 @@
* @param convert The RowProcessor implementation
* to use when converting rows into beans.
*/
- public BeanListHandler(Class type, RowProcessor convert) {
+ public OptimalBeanListHandler(Class type, RowProcessor convert) {
this.type = type;
this.convert = convert;
}
/**
- * Convert the ResultSet row into a bean with
+ * Convert the whole ResultSet into a List of beans with
* the Class given in the constructor.
*
- * @return A bean, never null.
+ * @param rs The ResultSet to handle.
*
+ * @return A List of beans, never null.
+ *
* @throws SQLException if a database access error occurs
- * @see org.apache.commons.dbutils.handlers.GenericListHandler#handle(ResultSet)
+ * @see org.apache.commons.dbutils.RowProcessor#toBeanList(ResultSet, Class)
*/
- protected Object handleRow(ResultSet rs) throws SQLException {
- return this.convert.toBean(rs, type);
+ public Object handle(ResultSet rs) throws SQLException {
+ return this.convert.toBeanList(rs, type);
}
-
}