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.

Eric


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to