Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumseContainer in other resource
https://www.eclipse.org/forums/index.php/mv/msg/1070267/1708161/#msg_1708161
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]]>Antonio Garmendia2015-09-14T10:07:44-00:00Re: eContainer in other resource
https://www.eclipse.org/forums/index.php/mv/msg/1070267/1708225/#msg_1708225
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]]>Ed Merks2015-09-14T18:29:05-00:00Re: eContainer in other resource
https://www.eclipse.org/forums/index.php/mv/msg/1070267/1708242/#msg_1708242
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]]>Antonio Garmendia2015-09-14T21:48:16-00:00Re: eContainer in other resource
https://www.eclipse.org/forums/index.php/mv/msg/1070267/1708274/#msg_1708274
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]]>Ed Merks2015-09-15T07:14:52-00:00