[CDO] Getting locally created, modified and/or deleted objects from a CDOResource or a CDOView? [message #508520] |
Tue, 19 January 2010 10:12 |
Bjoern Sundin Messages: 19 Registered: July 2009 Location: Switzerland |
Junior Member |
|
|
How do one retrieve the current changes in a CDOView e.g. to get added, modified and deleted objects since the last save within the session?
If I e.g. do a consistency check for a unique name I can successfully send an SQL query to the database using CDOView createQuery (CDO v.3). The result does, however, not include any newly created (or deleted) objects not yet saved to the database. This is of course not surprising and an expected behaviour, but I am looking for a way to also iterate through the "delta"(?) in order to include objects not yet persisted and exclude deleted ones.
[Updated on: Tue, 19 January 2010 10:15] Report message to a moderator
|
|
|
Re: [CDO] Getting locally created, modified and/or deleted objects from a CDOResource or a CDOView? [message #508527 is a reply to message #508520] |
Tue, 19 January 2010 10:22 |
|
Hi Bjoern,
Comments below...
Bjoern Sundin schrieb:
> How do one retrieve the current changes in a CDOView
Local changes can only happen in a CDOTransaction (which extends
CDOView). There you find getters for all kinds of changes. These getters
accumulate the more detailed information that you can find in possible
CDOSavepoints.
If you need the change information while change is happening you can
register a CDOTransactionHandler and inspect the new objects or change
deltas.
> e.g. to get added, modified and deleted objects since the last save
> within the session?
Just to get the terminology right, objects do not exist in CDOSession,
but rather in CDOViews/CDOTransactions.
> If I e.g. do a consistency check for a unique name I can successfully
> send an SQL query to the database using CDOView createQuery (CDO v.3).
> The result does, however, not include any newly created (or deleted)
> objects not yet saved to the database.
Yes, the query framework does not merge dirty state into the query
results. Maybe a cooperation with the new EMF Query will address this
complex challenge.
> This is of course not surprising and an expected behaviour, but I am
> looking for a way to also iterate through the "delta"(?) in order to
> include objects not yet persisted and exclude deleted ones.
See above.
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Powered by
FUDForum. Page generated in 0.23858 seconds