Skip to main content



      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 09:23 Go to next message
Eclipse UserFriend
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 10:32 Go to previous message
Eclipse UserFriend
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: Fri Jul 18 17:03:33 EDT 2025

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

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

Back to the top