Re: InsertObject
Re: InsertObject
- Subject: Re: InsertObject
- From: Alexander Spohr <email@hidden>
- Date: Wed, 30 May 2007 11:38:41 +0200
EOUtilities.createAndInsertInstance(anEditingContext, entityName)
Am 30.05.2007 um 10:59 schrieb Frederic JECKER:
Moin list,
Could someone answer the following question? :
I have two objects A and B, each extending EOGenericRecord.
Object A has a field of type B.
Now, when I create a new Object A which embeds a new object B,
before performing an EditingContext.saveChanges
What does 'embed' mean here? A relationship?
I must insert each object separately in my editingContext:
myContext.insertObject(B);
myContext.insertObject(A);
myContext.saveChanges();
.... which is rapidly over-complicated when saving complex object-
graphs
You insert them when you create them, not later. That does not seem
complex to me!?
Now, in order to perform the saveChanges in a more elegant way, can
someone tell me if
there is a method to override, method called by
EditingContext.saveChanges, in which I could
in each EOGenericRecord do the insertObject work ?
1. That would be too late.
2. How should the EditingContext know about Objects that are not
already in it or vice versa?
3. You can not connect Objects by relationships that are not inside
the same EditingContext.
Regards,
atze
_______________________________________________
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
References: | |
| >InsertObject (From: Frederic JECKER <email@hidden>) |