Hi

I have a class that has a method to return an array of interfaces.
e.g. 
class ClientExtCustomTable {
        public ICustomField[] getCustomFields();
}

All classes that implement this interface happen to extend CustomField. 


My castor mapping for this is

        <class name="inform.orm.entity.ClientExtCustomTable" >
                <map-to xml="custom"/>
                <field name="CustomFields" collection="array"
type="inform.orm.externaltables.ICustomField">
                        <bind-xml name="customfields"/> 
                </field>
        </class>                

I then define castor mapping for every class

        <class name = "inform.orm.externaltables.CustomField"
auto-complete="false">                  
             <map-to xml="field"/>      
                <field name="ColumnName" type="string" >
                        <bind-xml name="columnname" node="attribute"/>
                </field>
                <field name="Description" type="string" >
                        <bind-xml name="description" node="attribute"/>
                </field>
                <field name="Value" type="string" >
                        <bind-xml name="value" />
                </field>
                
        </class>
        <class name =
"inform.orm.externaltables.CustomField$StringField"
extends="inform.orm.externaltables.CustomField">
             <map-to xml="stringfield"/>                
                <field name="StringValue" type="string" >
                        <bind-xml name="stringvalue" />
                </field>
        </class>
        <class name =
"inform.orm.externaltables.CustomField$IntegerField"
extends="inform.orm.externaltables.CustomField">
             <map-to xml="integerfield"/>               
        </class>

>From this I would expect castor to produce the following XML

<clientext>
        <customfields>
                <integerfield columnname="aninteger"
description="anInteger" >
                        <value>3</value> 
                </integerfield >
                <stringfield columnname="astring" description="AString">
                        <value>This is a string</value> 
                        <stringvalue>This is a string</stringvalue> 
                </stringfield >
        </customfields>
</clientext>

However when I use caster to convert Java to XML I get the following:

<clientext>
        <customfield
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
columnname="aninteger" description="anInteger"
xsi:type="integerfield">
                <value xsi:type="java:java.lang.Integer">3</value> 
        </customfield>
        <customfield
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
columnname="astring" description="AString"
xsi:type="stringfield">
                <value>This is a string</value> 
                <stringvalue>This is a string</stringvalue> 
        </customfield>
</clientext>


What happened to my "customfields" node?
The actual "customfield" node appears to be a mixture of my class
mapping and something else. What is happening here?

Thanks
Richard

######################################################################
Attention: 
This e-mail message is privileged and confidential. If you are not the 
intended recipient please delete the message and notify the sender. 
Any views or opinions presented are solely those of the author.

######################################################################

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

Reply via email to