Re: getting the database values of an object without changing the one in the current editing context
Re: getting the database values of an object without changing the one in the current editing context
- Subject: Re: getting the database values of an object without changing the one in the current editing context
- From: WO Dev <email@hidden>
- Date: Thu, 5 Jul 2007 14:16:37 +0200
Thanks Cyryl,
Well I was hoping not to have to deal with "I have to store the
object somewhere before even knowing I might need it's previous state
later";)
Xavier
WO Dev wrote:
Hi,
I'm not sure my subject is understandable, anyway.
Assuming I have an object "x", I'm manipulating it in an editing
context. At a certain point I need to get the original object (the
one from the database) but without changing anything to the one in
my editing context.
How could I do that?
I need the object in its globality, so if I can get the object
directly and not a dictionary of its values it's better:)
You can answer "bla bla project wonder":) but please point me to
the correct method as I didn't find it for now;)
one of the possible ways of doing that is to make object.snapshot()
before changing it and after some time create new editing context ,
fetch the object into it and then do
objectInTheNewEditingContext.updateFromSnapshot()
changes would be made to the objectInTheNewEditingContext only
--
Cyryl Plotnicki-Chudyk
Software Developer
Power Media S.A.
http://www.power.com.pl
District Court for Wroclaw-Fabryczna
KRS: 0000281947
NIP: PL-898-16-47-572
Capital stock: 500 000 PLN
_______________________________________________
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