Some time ago we had a little discussion about XML generation from 
Torque Objects. I've written some code to do this, using 
commons-betwixt, now. The way it works is that you add 
serialization="xml" to your <table> definitions, and the resulting 
Objects contain a toXml() method, and also implement 
java.io.Externalizable (in XML form). Most of the code is on BaseObject 
rather than generated into the separate Base Objects. FK-relationships 
are retained and you can override the interesting bits by overriding a 
method defined in the Base Object which performs the equivalent function 
of the ".betwixt" file. I haven't yet done the XML->Torque direction. No 
extra files are generated (all the betwixt config is done in code).

If anyone's interested I could make the diff available and give a bit 
more information.

Gareth

On Tuesday, July 9, 2002, at 11:58  am, Gareth Boden wrote:

>
> On Tuesday, July 9, 2002, at 11:34  am, Age Mooy wrote:
>
>>> Also, I don't want to have to write additional mappings for all the
>>> classes and I want primitive data in elements not attributes, which
>>> would mean using a tweaked Castor XML - there didn't seem to be any
>>> mention of this being configurable.
>>
>> Try http://jakarta.apache.org/commons/betwixt/
>
> This looks interesting. I guess I could add something to Torque to 
> automatically generate appropriate .betwixt files (or Castor XML 
> mappings) when generating the OM. I'll look some more at this later.
>
>> JSR57 (from memory) dealt with XML serialization and the result was 
>> added to
>> the java.beans package in jdk 1.4. See
>> http://java.sun.com/j2se/1.4/docs/guide/beans/changes14.html for an
>> explanation of the new features.
>>
>
> It's nice they've put that XMLEncoder in there, but it's more 
> Java-oriented in syntax and less data-oriented (void statements, 
> classnames, etc.) Also don't want to force upgrading to 1.4 just yet.
>
> Gareth
>
>
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:turbine-torque-user-
> [EMAIL PROTECTED]>
>
>
---
Development Team Leader, eGS, 5-7 Singer Street, London EC2A 4BQ. +44 
(0)20 7336 1440

CONFIDENTIALITY: This is email is confidential and intended solely for 
the use of the individual to whom it is addressed.� Any views or 
opinions presented are solely those of the author and do not necessarily 
represent those of eGovernment Solutions (UK) Ltd.� If you are not the 
intended recipient, be advised that you have received this email in 
error and that any use, dissemination, forwarding, or copying of this 
email is strictly prohibited.� If you have received this email in error 
please contact the sender.


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

Reply via email to