Skip to main content



      Home
Home » Modeling » EMF » Problems with references/proxy
Problems with references/proxy [message #690837] Thu, 30 June 2011 05:55 Go to next message
Eclipse UserFriend
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 11:52 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Problems with references/proxy [message #691140 is a reply to message #691060] Thu, 30 June 2011 15:49 Go to previous messageGo to next message
Eclipse UserFriend
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 01:59 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Announcement: EMF Builder Generator
Next Topic:Implementing EMF Query2 Indexing
Goto Forum:
  


Current Time: Thu Jul 03 04:27:55 EDT 2025

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

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

Back to the top