May I suggest you use auto-naming="deriveByClass" in your bind-xml element of field "descendants", instead of name="process"?
-----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé : vendredi 31 août 2007 08:28 À : [email protected] Objet : [castor-user] Specifying parent and child object mapping 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

