Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problems with references/proxy
Problems with references/proxy [message #690837] Thu, 30 June 2011 09:55 Go to next message
davids  is currently offline davids Friend
Messages: 3
Registered: June 2011
Junior Member
Hi all,
I am new to EMF and have a problem regarding cross references in the EMF model of the project I am working on. Assumed there is an EClass with an EReference pointing to an object in another resource, I understood that this reference is a proxy first and is resolved when the referenced object is loaded.
However I am confused about how/when this proxy is created, is this done automatically? My problem is that I want to resolve all references using EcoreUtils.resolveAll, but I saw that the reference in my class is set to null and not to the proxy when trying to resolve it, so resolving does not work.
Is there something wrong in the program/model or do I miss some information regarding that subject?
Re: Problems with references/proxy [message #691060 is a reply to message #690837] Thu, 30 June 2011 15:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
David,

Comments below.

On 30/06/2011 2:55 AM, david schuld wrote:
> Hi all,
> I am new to EMF and have a problem regarding cross references in the
> EMF model of the project I am working on. Assumed there is an EClass
> with an EReference pointing to an object in another resource, I
> understood that this reference is a proxy first and is resolved when
> the referenced object is loaded.
No, it's resolved when you try to follow the reference to that object
from the referencing object.
> However I am confused about how/when this proxy is created, is this
> done automatically?
It's done during deserialization. All cross document references will
start out as proxies.
> My problem is that I want to resolve all references using
> EcoreUtils.resolveAll, but I saw that the reference in my class is set
> to null and not to the proxy when trying to resolve it, so resolving
> does not work.
EcoreUtil.resolve returns the original object if it fails to resolve so
I'm doubtful that an attempt to resolve a proxy replaced the proxies
with null.
> Is there something wrong in the program/model or do I miss some
> information regarding that subject?
What you describe doesn't sound possible so I'm at a loss to explain
it. Most of the problems with cross document references not working are
caused by not using absolute URIs on the resources at the time they are
saved.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Problems with references/proxy [message #691140 is a reply to message #691060] Thu, 30 June 2011 19:49 Go to previous messageGo to next message
davids  is currently offline davids Friend
Messages: 3
Registered: June 2011
Junior Member
thanks a lot for your answer. I actually did not mean that EcoreUtils.resolveAll() replaced the proxies by null but that the references are null at the time I call resolveAll. So if I get it right the references should be proxies from deserialization on, so if they are null it should be a URI problem or so, which is definitely possible since I was told that the developers of the model did a lot of wrong stuff.
Re: Problems with references/proxy [message #691259 is a reply to message #691140] Fri, 01 July 2011 05:59 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
If they are null, then I don't think there's anything present in the
serialization...

> thanks a lot for your answer. I actually did not mean that
> EcoreUtils.resolveAll() replaced the proxies by null but that the
> references are null at the time I call resolveAll. So if I get it
> right the references should be proxies from deserialization on, so if
> they are null it should be a URI problem or so, which is definitely
> possible since I was told that the developers of the model did a lot
> of wrong stuff.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Announcement: EMF Builder Generator
Next Topic:Implementing EMF Query2 Indexing
Goto Forum:
  


Current Time: Fri Mar 29 14:59:06 GMT 2024

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

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

Back to the top