SourceForge has been redesigned. Learn more.
Close

#14 Support easy transfer between tables w/ different names

shipped_with_v0.6.4
closed
5
2011-01-19
2010-07-09
Anonymous
No

The 'type' specified in a <generate> or <iterate> element must match the database table name. This makes it tedious to read data from one table and copy it to a table with a different name: each column needs to be mapped explicitely.

A consumer which overrides the entity/table name would be an easy solution, e.g. instantiated by a factory method DBSystem.inserter(String tableName) and used as

<generate source="db" type="t1" consumer="db.inserter('t2')" />

Discussion

  • Volker Bergmann

    Volker Bergmann - 2010-07-09

    A comparably simple but more generally applicable solution is to define an appropriate Converter implementation, e.g. EntityRenamer which simply renames the entity type.

    <iterate source="db" type="t1" converter="new EntityRenamer('t2')" consumer="db" />

     
  • Volker Bergmann

    Volker Bergmann - 2011-01-19
    • milestone: --> shipped_with_v0.6.4
    • status: open --> closed