Skip to main content



      Home
Home » Modeling » EMF » eContainer in other resource(eContainer in other resource)
eContainer in other resource [message #1708161] Mon, 14 September 2015 06:07 Go to next message
Eclipse UserFriend
Hi all,

I have a model A.xmi that contains a model B.xmi throught a containment reference that is a proxy. Both resources (A.xmi and B.xmi) are load and inside a ResourceSet. The thing is that I want to obtain the eContainer from an EObject y (the first element of B.xmi), but the y.eContainer is null and taking into account the definition of eContainer would be right thing. I've tried some things but without result, so I would like to know, how to obtain the eContainer in this case?

Thanks for any help.

Cheers,
Anthony
Re: eContainer in other resource [message #1708225 is a reply to message #1708161] Mon, 14 September 2015 14:29 Go to previous messageGo to next message
Eclipse UserFriend
Anthony,

If you want the container reference to be serialized (the only way it
will be not null until the containment reference to it is resolved), you
have to define an actual feature for it (an opposite for the containment
reference) and make it non-transient.


On 14/09/2015 12:07 PM, Anthony Garmendia wrote:
> Hi all,
>
> I have a model A.xmi that contains a model B.xmi throught a
> containment reference that is a proxy. Both resources (A.xmi and
> B.xmi) are load and inside a ResourceSet. The thing is that I want to
> obtain the eContainer from an EObject y (the first element of B.xmi),
> but the y.eContainer is null and taking into account the definition of
> eContainer would be right thing. I've tried some things but without
> result, so I would like to know, how to obtain the eContainer in this
> case?
> Thanks for any help.
>
> Cheers,
> Anthony
Re: eContainer in other resource [message #1708242 is a reply to message #1708225] Mon, 14 September 2015 17:48 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed,

Thank you very much for the reply. The thing is that I don't want to force that the Ecore Metamodel need to define an opposite for the containment
reference. I would like to get the eContainer when the opposite is not defined.
There is any way to get the eContainer without define this opposite containment reference?

Cheers,
Anthony
Re: eContainer in other resource [message #1708274 is a reply to message #1708242] Tue, 15 September 2015 03:14 Go to previous message
Eclipse UserFriend
Anthony,

Unless there is a serialized reference to the container, the object
being contained has no knowledge of its container until the container
resolves the proxy to the child. On a modeled container reference can
be serialized...

On 14/09/2015 11:48 PM, Anthony Garmendia wrote:
> Hi Ed,
>
> Thank you very much for the reply. The thing is that I don't want to
> force that the Ecore Metamodel need to define an opposite for the
> containment reference. I would like to get the eContainer when the
> opposite is not defined.
> There is any way to get the eContainer without define this opposite
> containment reference?
> Cheers,
> Anthony
Previous Topic:best practice displaying EMF-elements in tables
Next Topic:How to add ChildDescriptors for EObjects which are in a different Plugins
Goto Forum:
  


Current Time: Sun Jul 06 06:49:20 EDT 2025

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

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

Back to the top