db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Emminger <e...@ericemminger.com>
Subject RFC advanced data import and export with XML
Date Wed, 12 Mar 2003 20:23:17 GMT
Torque can import and export data between the database and XML using 
datadump, datadtd, datasql, and insert-sql. I believe release 3.0 
contains some bugs in datadump, but that is a separate issue. While 
importing several related tables from XML to the database, I've found a 
need to change the value of the primary key in order to preserve 
foreign-key relationships between the tables. Since you don't know the 
value of the new primary key until you insert the object, using 
insert-sql won't work.

Here's what I've done.

I use Castor to convert the objects in my object model to XML, and 
vice-versa. To handle the foreign-key issue, after converting an XML 
document to objects, I manipulate the objects in Java. To make working 
with Castor and Torque easier, I created a simple utility to convert a 
Torque schema.xml file to a Castor mapping.xml file.

Am I over-engineering this?

Please, tell me what you think.


View raw message