Yelena,
This issue was fixed last week in the CVS version, so if you can grab
the sources from CVS and run the build script. More information on our
CVS server can be found here: http://castor.exolab.org/cvs.html
--Keith
"Kiyko, Yelena" wrote:
>
> Hi,
>
> I'm having problems unmarshalling objects with the location attribute when
> the field with the same name occurs within different "locations". Here is a
> simplified example:
>
> public class A
> {
> B getB1();
> B getB2();
> }
> public class B
> {
> String getName();
> }
>
> I want the result XML to look like this:
>
> <A>
> <B1>
> <B>
> <name>blah<name>
> <B>
> <B1>
> <B2>
> <B>
> <name>blah<name>
> <B>
> <B2>
> </A>
>
> In other words, I need to add a "wrapper" element to class B, and I'm trying
> to achieve it using location attribute. Here is the mapping file:
>
> <mapping>
> > <description></description>
> > <class name="A">
> > <map-to xml="A"/>
> >
> > <field name="B1" type="B">
> > <bind-xml name="B" node="element" location="B1"/>
> > </field>
> > <field name="B2" type="B">
> > <bind-xml name="B" node="element" location="B2"/>
> > </field>
> > </class>
>
> <class name="B">
> > <map-to xml="B"/>
> > <field name="name" type="java.lang.String">
> > <bind-xml name="name" node="element"/>
> > </field>
> > </class>
>
> > </mapping>
>
> This results in TypeConversion error during unmarshalling - "unable to add
> 'B' to <null>, could not set value of B1(B) to (B). Marshalling works as
> expected.
>
> Am i misunderstanding the "location" functionality? Is there other way to
> add a "wrapper" xml element for a class?
>
> Many thanks,
> Yelena
>
>
> -----------------------------------------------------------
> 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