Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Is there a way to get the 'diff' of two CDO Audit views?
[CDO] Is there a way to get the 'diff' of two CDO Audit views? [message #499854] Tue, 24 November 2009 11:39 Go to next message
Lothar Werzinger is currently offline Lothar WerzingerFriend
Messages: 153
Registered: July 2009
Location: Bay Area
Senior Member
Is there a way to get the 'diff' of two CDO Audit views? Theoretically one
could use EMF compare, but that would require to transfer the whole model
to the client twice and with large models that is clearly undesirable.

There there a way to ask CDO for the changes in the model based on two
timestaps without using EMF compare?

Thanks in advance!

Lothar
Re: [CDO] Is there a way to get the 'diff' of two CDO Audit views? [message #499867 is a reply to message #499854] Tue, 24 November 2009 12:39 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6451
Registered: July 2009
Senior Member
Lothar Werzinger schrieb:
> Is there a way to get the 'diff' of two CDO Audit views?
No, a CDOView, audit or not, is just a partial cache on the overall
object graph.

> Theoretically one
> could use EMF compare, but that would require to transfer the whole model
> to the client twice and with large models that is clearly undesirable.
>
Yes, but that's currently the only way I could imagine to do this.

> There there a way to ask CDO for the changes in the model based on two
> timestaps without using EMF compare?
>
For a given object you can access its CDORevision, ask its version or
compare it to other revisions of the same EClass (returns a
CDORevisionDelta). There's a static method in CDOUtil that makes this
easy: CDOUtil.getRevision(CDOObject object, int version) or so.

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Is there a way to get the 'diff' of two CDO Audit views? [message #500031 is a reply to message #499867] Tue, 24 November 2009 18:25 Go to previous messageGo to next message
Lothar Werzinger is currently offline Lothar WerzingerFriend
Messages: 153
Registered: July 2009
Location: Bay Area
Senior Member
Eike Stepper wrote:

> Lothar Werzinger schrieb:
>> Is there a way to get the 'diff' of two CDO Audit views?
> No, a CDOView, audit or not, is just a partial cache on the overall
> object graph.
>
>> Theoretically one
>> could use EMF compare, but that would require to transfer the whole model
>> to the client twice and with large models that is clearly undesirable.
>>
> Yes, but that's currently the only way I could imagine to do this.

But on the server it should be relatively easy to query the changes that
have a timestamp greater than X1 and less or equal X2, right? So the only
missing piece would be CDO API to access that query.

>> There there a way to ask CDO for the changes in the model based on two
>> timestaps without using EMF compare?
>>
> For a given object you can access its CDORevision, ask its version or
> compare it to other revisions of the same EClass (returns a
> CDORevisionDelta). There's a static method in CDOUtil that makes this
> easy: CDOUtil.getRevision(CDOObject object, int version) or so.

So if I know that an object that I am interested in has changed then this
method allows me to get it's previous state with that helper method.
Does that work in any CDO view type (e.g. Transaction)?

Thanks!
Lothar
Re: [CDO] Is there a way to get the 'diff' of two CDO Audit views? [message #500039 is a reply to message #500031] Tue, 24 November 2009 18:44 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6451
Registered: July 2009
Senior Member
Lothar Werzinger schrieb:
> Eike Stepper wrote:
>
>
>> Lothar Werzinger schrieb:
>>
>>> Is there a way to get the 'diff' of two CDO Audit views?
>>>
>> No, a CDOView, audit or not, is just a partial cache on the overall
>> object graph.
>>
>>
>>> Theoretically one
>>> could use EMF compare, but that would require to transfer the whole model
>>> to the client twice and with large models that is clearly undesirable.
>>>
>>>
>> Yes, but that's currently the only way I could imagine to do this.
>>
>
> But on the server it should be relatively easy to query the changes that
> have a timestamp greater than X1 and less or equal X2, right? So the only
> missing piece would be CDO API to access that query.
>
You could use the Query API with a custom query handler for that purpose.

>>> There there a way to ask CDO for the changes in the model based on two
>>> timestaps without using EMF compare?
>>>
>>>
>> For a given object you can access its CDORevision, ask its version or
>> compare it to other revisions of the same EClass (returns a
>> CDORevisionDelta). There's a static method in CDOUtil that makes this
>> easy: CDOUtil.getRevision(CDOObject object, int version) or so.
>>
>
> So if I know that an object that I am interested in has changed then this
> method allows me to get it's previous state with that helper method.
> Does that work in any CDO view type (e.g. Transaction)?
>
Yes ;-)

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:how can i access/get into my ###Imp Objects
Next Topic:Wrapper for EObject and EMF Notification
Goto Forum:
  


Current Time: Thu Nov 21 04:06:17 GMT 2019

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

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

Back to the top