Child editing context simple (?) question :-)
Child editing context simple (?) question :-)
- Subject: Child editing context simple (?) question :-)
- From: "Ricardo J. Parada" <email@hidden>
- Date: Fri, 27 Mar 2009 10:10:57 -0400
Hi All,
I need to iron out this one now. :-) I'm gonna borrow David Leber's example from his blog at http://davidleber.net :
EOEditingContext parentEc = ERXEC.newEditingContext(); Person person = Person.newPerson(parentEc);
EOEditingContext childEc = ERXEC.newEditingContext(parentEc); Address address = Address.newAddress(childEc); childEc.saveChanges(); // move changes into my parent
Notice that person is a new EO (i.e. never been saved to the database). The address EO is also new except that it is being created in the child editing context.
Now, saving the child editing context is supposed to push the changes to the parent editing context, except that it fails in my test case because I have the following mandatory relationship:
Person <-->> Address
How is something like this handled? Am I supposed to make the relationship optional or is there another way around this?
Thanks again in advance, Ricardo
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden