XML looks like below

<?xml version="1.0" encoding="UTF-8"?>
<papx>
        <hierarchy>
       <process id="---1970" name="total_process" normalizedName=""
type="PRO" subType="PRO"
            visualApperanceId="0">
            <attachments>
                    <attachment id="" name="">
                        <url></url>
                        <description>process attachement</description>
                        <content/>
                    </attachment>
            </attachments>
            <udaUsages>
            <udaUsage id="" name="Improvement Opportunity"
attributeId="0000000000000008">
                                <field_id>0000000000000000</field_id>
                <field_value>Yes</field_value>
            </udaUsage>
            </udaUsages>
            <process id="---1971" name="sub 1" normalizedName=""
type="SUP" subType="SUP"
                visualApperanceId="0">
               <note id="" name="">
                    <text>sub 1 note</text>
                    <content/>
                </note>
                <attachments>
                        <attachment id="" name="">
                            <url></url>
                            <description>sub 1 attachment</description>
                            <content/>
                        </attachment>
                </attachments>
                <udaUsages>
                        <udaUsage id="" name="ProcessVersion"
attributeId="0000000000000038">
        
<field_id>0000000000000000</field_id>
                            <field_value>Yes</field_value>
                        </udaUsage>
                </udaUsages>
                <process id="---1976" name="sub 1 sub 1"
normalizedName="" type="SUP" subType="SUP"
                    visualApperanceId="0">
                    <activities>
                        <activity id="---1978" name="act 11 act 1"
normalizedName=""
                            parentId="---1976" processId="---1976"
entityType="ACT"
                            entitySubType="ACT"
projectId="0800000180045a30" isResource="false"
                            visualApperanceId="0000000000000000">
                            <hierarchyLevel>7</hierarchyLevel>
                            <itemOrder/>
                            <formatOrder/>
                            <owner>Administrator</owner>
                            <sme>0000000000000000</sme>
                            <numericItemOrder/>
                            <touchTime>0</touchTime>
                            <totalTime>0</totalTime>
 
<touchTimeUom>0000000000002222</touchTimeUom>
 
<totalTimeUom>0000000000002222</totalTimeUom>
                            <activityOrder/>
                            <formalCondition/>
                            <validations>
                                <isEntityValid>true</isEntityValid>
                                <isDecomposed/>
                                <isDeliverableExists/>
                                <isDurationExists/>
                                <isInputExists>false</isInputExists>
                                <isOutputExists>true</isOutputExists>
 
<isResourceExists>false</isResourceExists>
                                <isSufficientOutputs/>
                            </validations>
                            <inputs/> 

-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 31, 2007 1:21 PM
To: [email protected]
Subject: Re: [castor-user] Specifying parent and child object mapping

What does the XML you are trying to unmarshal from look like ?

Werner

[EMAIL PROTECTED] wrote:
> Hi,
> 
> I am using castor mapping. I have a mapping as below
> 
> <class name="com.emc.documentum.bpa.domain.HierarchyItemDO">
>       <map-to xml="process"/>
>       <field name="id" type="java.lang.String"
> handler="util.RootDOHandler">
>               <bind-xml name="id" node="attribute"/>
>       </field>
>       <field name="descendants" collection="arraylist"
> type="com.emc.documentum.bpa.domain.HierarchyItemDO"
container="false">
>               <bind-xml name="process"/>
>       </field>
> </class>
> 
> <class name="com.emc.documentum.bpa.domain.ActivityDO"
> extends="com.emc.documentum.bpa.domain.HierarchyItemDO">
>       <map-to xml="activity"/>
>       <field name="id" type="java.lang.String"
> handler="util.RootDOHandler">
>               <bind-xml name="id" node="attribute"/>
>       </field>
> </class>
> 
> ActivityDO extends from HierarchyItemDO.
> 
> In the field name mapping for "descendants" above, 
> the arraylist will contain the elements of type is of type
> HierarchyItemDO and ActivityDO. I have defined the mapping for both
> HierarchyItemDO and ActivityDO. While unmarshalling, Castor is not
> recognizing if the instance of the element in the arraylist is
> HierarchyItemDO or ActivityDO and calling the corresponding class
> mapping. 
> 
> Can you please suggest how this can be achieved in castor mapping.
> 
> Regards
> Subramanyam
> 
> ---------------------------------------------------------------------
> 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



---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to