Re: Dealing with child's editing contexts [explained] :-)

2006-08-29 Thread Lachlan Deck
Hi Yann, On 28/08/2006, at 12:35 AM, Yann Bizeul wrote: This is Location's awakeFromInsertion method, it has a to-many relationship with LocationTagUser and a to-one relationship with Address. What is the best way to include the whole package to EOEditingContext ? Step back a second...

Dealing with child's editing contexts [explained] :-)

2006-08-27 Thread Yann Bizeul
Sorry about my previous mail, I clicked Send a bit quickly.Perhaps I could explain the code a bit.This is Location's awakeFromInsertion method, it has a to-many relationship with LocationTagUser and a to-one relationship with Address.What is the best way to include the whole package to EOEditingCon

Re: Dealing with child's editing contexts

2006-08-27 Thread Ken Anderson
This looks very scary to me...  Why would you be inserting objects into the editing context here?You should never set an object as a relationship until AFTER it's inserted into the editing context that the receiver is already in.My code never strays from:Address address = new Address();ec.insertObj

Dealing with child's editing contexts

2006-08-27 Thread Yann Bizeul
Is this code WOSpirit complient ? public void awakeFromInsertion(EOEditingContext ec) { super.awakeFromInsertion(ec);setDate(new NSTimestamp()); if (address().editingContext() == null) ec.insertObject(address());int i=0; for (i=0;i { LocationTagUser l = (LocationTagUser) locationTag