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: Guido Neitzer <email@hidden>
- Date: Thu, 5 Jul 2007 13:56:58 -0600
On 05.07.2007, at 13:46, WO Dev wrote:
Actually I need it to save the previous object as a string (in fact
an xml representation).
So my process is to manipulate an object, and when I submit the
changes, just before saveChanges, I'm tracking who did this, when,
and the xml representation.
That's why I'd like to get the database "state" of the object when
I do te tracking part.
You can use "snapshot()" to get the state, for which EOF thinks it is
the current database state. If some other application changed it,
this might be different from the actual values in the database.
You could also use a raw sql query to get the current content from
the database.
I use "changesFromSnapshot" to collect only changes to the objects.
My eo superclass does all that for me and creates a dictionary of
changes when the object is saved.
cug
_______________________________________________
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