Hi Thomas
I have had a similar issue as I am using both JDO and XML and I have had to
do as Keith says and resort to two mapping files: one for XML and one for
JDO. I also ran into a few issues with identities with JDO lazy loading of
collections so I had to use transient identities
in my XML document in my particular case. Saving objects back into JDO is
not very nice and we are having to code workarounds - collections and
dependent objects yuck!
Glen

-----Original Message-----
From: Keith Visco [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 13:06 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Pretend to map some fields to XML




Thomas Louis wrote:
>
> Hello,
>
> how can I pretend to map some fields of my class to XML. I can't declare
> them "transient" because they had to be mapped for JDO.

For now, I believe you'll have to maintain two separate mapping files.
However
we have discussed in the past adding a transient attribute to the
bind-xml element.
So in the future it may be directly supported.

--Keith




>
> Example:
> Mapping-file:
>
> <class name="Item" identity="id" key-generator="MAX">
>   <map-to xml="item" table="item"/>
>   <field name="id" type="integer">
>     <sql name="item_id"/>
>   </field>
>   <field name="content" type="java.lang.String">
>     <sql name="content"/>
>     <bind-xml name="content" node="text">
>   </field>
> </class>
>
> The problem occurs, when I marshall the items. Then the generated XML
looks
> like that:
>
> <item>Foo<id>0</id></item>
> <item>Bar<id>0</id></item>
>
> But I don't want these <id>s neither than an element nor an attribute.
>
> Do you know what to change in the mapping file?
>
> Thomas
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to