commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stevo Slavic (JIRA)" <>
Subject [jira] [Commented] (DBUTILS-74) New ListResultSetHandler with a ResultSetHandler as parameter
Date Sun, 08 Jul 2012 11:54:35 GMT


Stevo Slavic commented on DBUTILS-74:

Olivier described solution, but I believe what he really wants (please correct me if wrong)
is to have {{ResultSetHandler}} and it's implementations agnostic of whether it will be used
to handle a single result or a collection - it just needs to focus on handling single {{ResultSet}}
row to single object regardless if that object is a POJO, {{Object}} {{Array}}, or a {{Map}}.
In that case {{QueryRunner}}, like JPA's {{Query}}, should have this logic and separate API
for retrieving a single result, and separate one for retrieving a collection. IMO this would
be major refactoring of the dbutils so it's probably best to schedule it for next major (2.0)
> New ListResultSetHandler with a ResultSetHandler as parameter
> -------------------------------------------------------------
>                 Key: DBUTILS-74
>                 URL:
>             Project: Commons DbUtils
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Olivier Grégoire
>             Fix For: 1.5
>   Original Estimate: 1h
>  Remaining Estimate: 1h
> It would be great if we could have such a class:
> public class DefaultListResultSetHandler<T> extends AbstractListHandler<T>
>   public DefaultListResultSetHandler (ResultSetHandler<T> handler) {
>    if (handler == null) throw new NullPointerException();
>     this.handler = handler;
>   }
>   protected T handleRow (ResultSet rs) {
>     return handler.handle(rs);
>   }
> }
> This way, we avoid having two classes, one for the object handler itself and one for
the list handler. It's a all at once.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message