Hi Werner, I'm surprised, what do you mean by "supported" ?
I was expecting Identities to be only JDO related. Did I missed something ?
Apparently Castor XML refuses to marshal extra fields according to the xml
mapping attribute "identity="CLKTSOC CLKTCODE" even if I tell him to with
<field name="CLKTCODE" type="string"
<bind-xml node="element"/>
</field>
Sébastien PERES-LABOURDETTE
-----Message d'origine-----
De : Werner Guttmann [mailto:[EMAIL PROTECTED]
Envoyé : vendredi 1 février 2008 21:30
À : [email protected]
Objet : Re: [castor-user] Starnge Marshalling Behavior
Sebastien,
as far as I know, Castor XML never supported ,multi-value identities,
something Castor JDO supports, though.
Reading your email, I am getting the impression, though, that you think
this should work.
Werner
Sébastien PERES-LABOURDETTE wrote:
> Hi.
>
>
>
> Im facing a strange marshalling behavior that i cannot explain to
> myself even after running sample unit tests with Castor 1.1 / 1.1.1.
>
>
>
> Here is sample of the concerned mappings :
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <mapping>
>
> <class name="com.omerin.tscables.pmics.jdo.CLIENT"
> identity="CLKTSOC CLKTCODE">
>
> <description>CLIENT</description>
>
> <map-to table="client" xml="client"/>
>
> <field name="CLKTSOC" type="string">
>
> <sql name="CLKTSOC"
> type="char[3]"/>
>
> <bind-xml node="element"/>
>
> </field>
>
> <field name="CLKTCODE" type="string"
> required="true">
>
> <sql name="CLKTCODE"
> type="char[6]"/>
>
> <bind-xml node="element"/>
>
> </field>
>
> <field name="CLCTETS" type="string">
>
> <sql name="CLCTETS"
> type="char[2]"/>
>
> <bind-xml node="element"/>
>
> </field>
>
>
>
>
>
> (Notice I use multiple field identities)
>
>
>
> Then, executing the code below :
>
>
>
> db.begin();
>
> Object[] key = new Object[2];
>
> key[0] = new String("103");
>
> key[1] = new String("100106");
>
>
>
> CLIENT client = (CLIENT)
> db.load(CLIENT.class, new Identity(key));
>
> try {
>
> Marshaller m = new
> Marshaller(new PrintWriter(System.out));
>
>
> m.setMapping(DbProvider.getInstance().getMapping());
>
> m.marshal(client);
>
> } catch (Exception e) {
>
> e.printStackTrace();
>
> }
>
> db.commit();
>
> db.close();
>
>
>
>
>
> Produces at System.out :
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
>
>
> <client>
>
> <CLKTSOC>103</CLKTSOC>
>
> <CLCTETS>00</CLCTETS>
>
>
>
>
>
> It is like the marshaller does marshall only on the first field (left
> most) of the multiple field identity.
>
> I have 5 classes of that kind.
>
>
>
> Does something have changed marshalling identities while migrating from
> Castor 1.0.1 Complex to Castor 1.1 Identity ?
>
>
>
> Anyone to help me marshalling all of my identity fields ?
>
>
>
>
>
> Sébastien PERES-LABOURDETTE
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email