Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] - CDOFeatureDeltaVisitor and CDORemoveFeatureDelta
[CDO] - CDOFeatureDeltaVisitor and CDORemoveFeatureDelta [message #1756459] Fri, 17 March 2017 08:56 Go to next message
Philippe EUGENE is currently offline Philippe EUGENEFriend
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
Re: [CDO] - CDOFeatureDeltaVisitor and CDORemoveFeatureDelta [message #1767929 is a reply to message #1756459] Wed, 12 July 2017 08:37 Go to previous message
Philippe EUGENE is currently offline Philippe EUGENEFriend
Messages: 58
Registered: January 2011
Member
We solved this issue by no longer using CDOTransactionHandler1.

We replace this handler by a CDOLazyContentAdapter that we attach to the CDO resource.
Previous Topic:[CDO] - EJavaObject mapping failed with a PostgreSQL database
Next Topic:[CDO] Reset repository content to a previous commit
Goto Forum:
  


Current Time: Thu Apr 25 21:06:30 GMT 2024

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

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

Back to the top