[CDO] - CDOFeatureDeltaVisitor and CDORemoveFeatureDelta [message #1756459] |
Fri, 17 March 2017 08:56 |
Philippe EUGENE Messages: 58 Registered: January 2011 |
Member |
|
|
Hi,
I'm implementing a CDOTransactionHandler with a CDOFeatureDeltaVisitor.
On a remove my visitor process a CDORemoveFeatureDelta.
Quote:
CDOFeatureDelta[variants, REMOVE, value=UNKNOWN, index=0]
The value associate with the FeatureDelta is an UNKNOWN object and not a CDOID object.
Then i have no way to know what object was removed.
I search some code sample into the CDO project and i found the CDONotificationBuilder.
@Override
public void visit(CDORemoveFeatureDelta delta)
{
EStructuralFeature feature = delta.getFeature();
int index = delta.getIndex();
Object oldValue = delta.getValue();
if (oldValue instanceof CDOID)
{
CDOID oldID = (CDOID)oldValue;
CDOObject object = findObjectByID(oldID);
if (object != null)
{
oldValue = object;
}
}
add(new CDODeltaNotificationImpl(object, Notification.REMOVE, feature, oldValue, null, index));
}
In this sample a CDOObject could be retrieve from the CDODeltaFeature.
In my case the delta.getValue(), always return an UNKNOWN object and not a CDOID.
What is the right way to retrieve a CDOObject from a CDORemoveFeatureDelta ?
Thanks,
--
Philippe
|
|
|
|
Powered by
FUDForum. Page generated in 0.03083 seconds