Skip to main content



      Home
Home » Modeling » EMF » [CDO] Getting locally created, modified and/or deleted objects from a CDOResource or a CDOView?
[CDO] Getting locally created, modified and/or deleted objects from a CDOResource or a CDOView? [message #508520] Tue, 19 January 2010 05:12 Go to next message
Eclipse UserFriend
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 05:15] by 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 05:22 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: [CDO] Getting locally created, modified and/or deleted objects from a CDOResource or a CDOView? [message #508534 is a reply to message #508527] Tue, 19 January 2010 05:43 Go to previous message
Eclipse UserFriend
Hello Eike,

Thank you for the quick and accurate reply. I found the change datas I need in the CDOTransaction using the methods
transaction.getDetachedObjects()
transaction.getDirtyObjects();
transaction.getNewObjects()

Cheers
Bjoern
Previous Topic:emf.ecore2Java and templatepath
Next Topic:Delete Model from an resource
Goto Forum:
  


Current Time: Tue Jul 01 03:10:39 EDT 2025

Powered by FUDForum. Page generated in 0.08234 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top