Re: Partially saving the object graph. How? (Jean Pierre Malrieu)
Re: Partially saving the object graph. How? (Jean Pierre Malrieu)
- Subject: Re: Partially saving the object graph. How? (Jean Pierre Malrieu)
- From: Clark Mueller <email@hidden>
- Date: Mon, 19 Mar 2007 11:23:39 -0600
Jean,
I think it might be easier if you gave us a more specific context for
what you're doing. This need doesn't make a lot of sense to me. If we
knew why that were necessary, we might be able to help you think of a
better solution. :-)
That having been said, I think you might be able to override
updatedObjects(), insertedObjects(), and deletedObjects(), and filter
the results from those to include only objects that are instanceof A.
That strikes me as the method involving the least amount of work, but
I'm not sure what the results of that would actually be once it
filtered up to saveChanges(). I suspect at that point, it might
ignore those accessors, but you could try it.
Clark
On 19 Mar 07, at 11:13 AM, Jean Pierre Malrieu wrote:
Thanks for your answer, Peter.
It depends on what you are doing with entity B.
If you are not modifying any B objects, then you don't need to do
anything because only updated/inserted/deleted objects in the editing
context will get committed to the database.
I am modifying them. I am inserting them, then modifying them. Most
of the time, they are saved along with instances of entity A. But
in one app of mine, they must not be saved.
If you are modifying A and B objects, then you can't just commit A
changes because both A and B objects must be part of the same editing
context. If this is what you need to do, then i think you might to
reconsider your model.
Rethinking the emodel is not an option here, I am affraid.
Basically, what gets committed is determined by the editing
context you
call saveChanges() on. This is what determines the DB transaction.
Sure. I was wondering if the best strategy would be to override
saveObject() in a subclass of EOEditingContext in order to skip
entity B's inserts an updates.
Would that entail violating EOF commandments?
JPM
Regards
Peter
Jean Pierre Malrieu wrote:
Hi,
I have some instances of entity A that are not functionnal without
related instances of entity B.
But in some circumstances, I need to save only the instances of
object A.
What is the best strategy to acheive this?
Thanks.
JPM
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
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