Hi Jean-Paul,
Your java code is correct, but your DataMap might not be... In a
1-to-1, one side of relationship is always dependent and takes its key
from the parent. Please check how the relationship is modeled. You may
find some information here in the Modeler Guide:
http://objectstyle.org/cayenne/modelerguide/modeling-db-layer/to-dep-
pk.html
Andrus
On Wednesday, September 17, 2003, at 09:30 AM, Jean-Paul Le Fèvre
wrote:
> One more time I'm facing difficulties in front of relationship
> management.
> The link is of type one-to-one between A and B and the reverse
> relationship
> is enabled. When I try to set up a link between instances a and b
> I got 'Some parts of FK are missing in snapshot'
>
> Since I don't know exactly how to implement the link I tried many
> different approaches but without success :
>
> in A :
> b = createAndRegisterNewObject("B");
> b.setA(this); // or b.setAid(this.getId()) id being the oid.
> setB(b); // or setBid(b.getId())
> commitChanges();
>
> gives : CayenneRuntimeException !
>
> If I do not call 'setB(b)' the exception is not thrown but the link is
> not correctly established : one end is missing.
This archive was generated by hypermail 2.0.0 : Thu Sep 18 2003 - 17:14:33 EDT