db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl ...@apache.org>
Subject Re: How to remove village [was: Re: Release Torque-4.0-alpha1 soon? & set of supported databases]
Date Thu, 30 Sep 2010 19:50:47 GMT
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: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message