[CDO] Should a CDORevision already have changes of RevisionDelta applied? [message #1857849] |
Wed, 01 March 2023 09:29  |
Eclipse User |
|
|
|
Hello,
Should a CDORevision already have the changes listed in its revision delta applied to it?
The reason I ask is I am currently debugging a diff-viewer table, which works as expected but in some corner-cases fails to show the correct values of the attributes of a revision.
It basically does (siplified) the following steps:
Revision revision = (Revision) cell.getElement(); // get revision of current row of the table
CDORevisionKey cdoRevisionKey = revision.getRevisionKey();
((CDORevisionDelta) cdoRevisionKey).getFeatureDeltas(); // search through all deltas
searching through the feature-deltas (by comparing the changed feature) finds a changed attribute named gwSubstanceGroup , which is a list which was previously empty and now has a single element ("CKW") added to it:
CDOFeatureDelta[gwSubstanceGroup, LIST, originSize=0, list=[CDOFeatureDelta[gwSubstanceGroup, ADD, value=CKW, index=0]]]
However, when I try to load the value that attribute had in this revision, I simply get null:
Object value = ((InternalCDORevision) revision).getValue(iemfProperty);
whereas iemfProperty is exactly the feature which matched the delta before:
org.eclipse.emf.ecore.impl.EAttributeImpl@4aae8619 (name: gwSubstanceGroup) (ordered: true, unique: true, lowerBound: 0, upperBound: -1) (changeable: true, volatile: false, transient: false, defaultValueLiteral: null, unsettable: false, derived: false) (iD: false)
Digging a bit into getValue the offset is calculated and really, the position in the Object[] just contains null. To me it seems the revision contains the attribute-values without the changes (delta) applied to it.
I came to this conclusion, because the next (newer) revision contains the modifications listed in the current feature delta. So e.g. revision 1 contains the delta but not the actual modifications, revision 2 does in contrast not contain the delta information but the values are set there...
Any ideas about what is happening here would be greatly appreciated.
Best regards, Clemens
PS: We are using CDO 4.9 unfortunatly
[Updated on: Wed, 01 March 2023 10:47] by Moderator
|
|
|
Re: [CDO] Should a CDORevision already have changes of RevisionDelta applied? [message #1857909 is a reply to message #1857849] |
Mon, 06 March 2023 03:26  |
Eclipse User |
|
|
|
Hi Clemens,
Sorry, your question confuses me:
Linuxhippy Mising name wrote on Wed, 01 March 2023 15:29Should a CDORevision already have the changes listed in its revision delta applied to it?
What do you mean be "its revision deltas"? A CDORevision has no reference to revision deltas. They can be applied, though, but then the question is where and when does that happen?
Then, in your code snippet, the "Revision" is most likely not a CDO revision, as that would not carry deltas along.
|
|
|
Powered by
FUDForum. Page generated in 0.04928 seconds