<mapping>
<description>Castor generated mapping file</description>
<class name="A" identity="reference">
<description>Default mapping for class A</description>
<map-to xml="A"/>
<field name=" bMap " type="java.lang.Object" collection="map"
get- method="getBMap">
<bind-xml name="B" node="element"/>
</field>
</class>
<class name="B">
<field name="parent" type=" java.lang.Object " >
<bind-xml name="stcdbDatabaseModel"
node="element" reference="true"/>
</field>
</class>
</mapping>
-----Original Message-----
From: Sudhendra Seshachala
Sent: Tuesday, May 11, 2004 11:31 AM
To: '[EMAIL PROTECTED]'
Subject: Establishing PArent-child relationship
I have a Class as follows
Class A {
HashMap bMap = new HashMap // contanins B
}
Class B
{
Stirng name;
A parent;
}
Basically B has a reference to A as shown above
I tried the following mappingXML
<mapping>
<description>Castor generated mapping file</description>
<class name="A" identity="parent">
<description>Default mapping for class A</description>
<map-to xml="A"/>
<field name=" bMap " type="java.lang.Object" collection="map"
get- method="getBMap">
<bind-xml name="B" node="element"/>
</field>
</class>
<class name="B">
<field name="parent" type=" java.lang.Object " >
<bind-xml name="stcdbDatabaseModel"
node="element" reference="parent"/>
</field>
</class>
</mapping>
I still don't get the parent. It is null
Am I missing anything here ?? Please let me know.
Thanks
Sudhi
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev