I just want to make sure that I'm doing the right
thing here, since I've not been able to find a unit
test for the simple case of a 1:1 association create.
Heres what I had to do to get it working. The
navigation is from the child to the parent, one way:
1. create the parent and the child objects, associate
the child with the parent:
..
parent.setChild(child)
then
2. 'store' the parent (pb.store(parent)), getting
it's id first (getIdentity) so you can put it in the
child's parentId ref., and then set the child's
parentId.
THEN, (I hope this is right), I had to:
3. pb.retrieveReference(child, "parent");
4. 'store' the child..
This actually works, but seems a little complicated.
It seems to me that I should be able to create the
model associations and just say 'store' on the parent,
no?
Is this even right? I got the retrieveReference from
looking at a number of the tests, but none that
specifically address the simple case of 1:1.
as for the repository, the only thing interesting is
that the child has:
<reference-descriptor
name="parent"
class-ref="com.xx.ormap.test.Parent"
auto-update="true"
>
<foreignkey field-ref="parentId"/>
</reference-descriptor>
Thanx
-hba
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]