Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EcoreUtil.copy() for bidirectional references
EcoreUtil.copy() for bidirectional references [message #1211604] Tue, 26 November 2013 14:23 Go to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
EcoreUtil.copy() does not copy bidirectional links where both ends are not part of the copy, for good reasons.

However I have the following situation (very simplified):

Signal:
owner: -> SignalOwner; opposite outputs

SignalOwner:
outputs: 0..4-> Signal; opposite owner

Criteria -> SignalOwner:



Cause -> SignalOwner:
criterias: Cont.0..* -> Criteria

When I do a EcoreUtil.copy() (note: Signals are NOT contained in the copied section, everything else is) I get:

Cause are copied with their "outputs" Attribute empty (as expected because of bidirectional).

Criteria are not copied at all (this is NOT expected!) together with all its descendants (not shown above).

Is this behavior somehow expected?
What am I doing wrong?
In case it's not expected: where exactly I should debug to see what's going wrong?

TiA
Mauro
Re: EcoreUtil.copy() for bidirectional references [message #1211716 is a reply to message #1211604] Tue, 26 November 2013 15:32 Go to previous message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Please disregard.
I had mistakenly marked "derived" criterias.
Sorry for the useless noise.
Mauro

On 26/11/2013 15:23, Mauro Condarelli wrote:
> EcoreUtil.copy() does not copy bidirectional links where both ends are not part of the copy, for good reasons.
>
> However I have the following situation (very simplified):
>
> Signal:
> owner: -> SignalOwner; opposite outputs
>
> SignalOwner:
> outputs: 0..4-> Signal; opposite owner
>
> Criteria -> SignalOwner:
>
>
>
> Cause -> SignalOwner:
> criterias: Cont.0..* -> Criteria
>
> When I do a EcoreUtil.copy() (note: Signals are NOT contained in the copied section, everything else is) I get:
>
> Cause are copied with their "outputs" Attribute empty (as expected because of bidirectional).
>
> Criteria are not copied at all (this is NOT expected!) together with all its descendants (not shown above).
>
> Is this behavior somehow expected?
> What am I doing wrong?
> In case it's not expected: where exactly I should debug to see what's going wrong?
>
> TiA
> Mauro
Previous Topic:[CDO] [Teneo] Default enum value persisted as NULL
Next Topic:[EMF Client Platform] ViewModel adding children references
Goto Forum:
  


Current Time: Mon Mar 01 14:03:25 GMT 2021

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

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

Back to the top