On 30.09.10 06:20, Thomas Fischer wrote:
>     // maybe can go to BasePeer
>     public static List<Book> selectAndConvert(Criteria criteria,
> Mapper<Book> mapper, Connection con)
>     {
>         Query query = createQuery(criteria);
>         ResultSet resultSet = con.createStatement().executeQuery
> (query.toString());
>         List<Book> result = new ArrayList<Book>();
>         while (resultSet.next)
>         {
>             result.add(BookMapper.map(resultSet));
>         }
>         return result;
>     }

I understand. I tried to do something similar with commons-dbutils once.
Worked like a charm. Problem is, that this only covers the SELECT case.
I found it very difficult to apply the equivalent concept to the
INSERT/UPDATE case.

> Do you see any advantages of the metadata approach a compared to the mapper
> approach outlined above ?

Easier transition. Do something simple but useful for 3.3.1, keep the
big bang for later. ;-)

Bye, Thomas.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to