This one time, at band camp, chris williams said:
cw >can you give an example of how this is done?
cw >
cw >currently, we use a <sql many-key ...> to relate from
cw >parent to child as in (A has a 1 to n relationship to
cw >B):
cw >
cw ><class name="A" ....>
cw > ...
cw > <field name="B" type="..." collection="vector" ...>
cw > <sql many-key="a_id"/>
cw > </field>
cw ></class>
cw >
cw >but we do not reference A in B anywhere. should we
cw >use the <sql name=".."> in the mapping for B to do
cw >this?
cw >
cw >thanks,
chris,
Here is a very simple example of a bi-directional relation at the object level:
class objectA
{
int id;
...
ArrayList listOfObjectB = new Arraylist(); // used to denote the children
...
}
class objectB
{
int id;
...
objectA a; // used to denote the parent
}
With this bi-directional relation establish, one can walk the object
tree from objectA to objectB or from objectB to objectA.
Bruce
--
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev