• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Child editing context simple (?) question :-)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Child editing context simple (?) question :-)
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: OT: is WWDC worth it for WO developers ?
  • Next by Date: Re: Child editing context simple (?) question :-)
  • Previous by thread: Re: OT: is WWDC worth it for WO developers ?
  • Next by thread: Re: Child editing context simple (?) question :-)
  • Index(es):
    • Date
    • Thread