Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Cross-reference persistency(How to persist cross-references?)
Cross-reference persistency [message #1063857] Fri, 14 June 2013 14:22 Go to next message
Fedor Malyshev is currently offline Fedor MalyshevFriend
Messages: 1
Registered: April 2013
Junior Member
I have got two resources, which are serialized to files.
And i have a cross-reference (non-containment) from one part of the model (in first file) to another part (second file). While resources are being deserialized from these files (second one, then first one) cross reference is initialized via new instance of object which is filled with correct data if "resolve proxies" is set true.
But though - it's a bug, cause I need a real cross reference (non-containment), but get a new object without container wich is now pointed by my cross-reference. What I should do? Is it necessary to put all model in a single resource??
Re: Cross-reference persistency [message #1063870 is a reply to message #1063857] Fri, 14 June 2013 15:34 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Fedor,

Comments below.

On 14/06/2013 4:43 PM, Fedor Malyshev wrote:
> I have got two resources, which are serialized to files.
What URIs do these resources have?
> And i have a cross-reference (non-containment) from one part of the
> model (in first file) to another part (second file).
What do the serialized URIs look like in the result?
> While resources are being deserialized from these files (second one,
> then first one) cross reference is initialized via new instance of
> object which is filled with correct data if "resolve proxies" is set true.
What URIs did you use to load the resources? Note that during
deserialization a proxy instance is created. Later when you access the
data it will be resolved (or at least an attempt to do so is made).
> But though - it's a bug, cause I need a real cross reference
> (non-containment), but get a new object without container wich is now
> pointed by my cross-reference.
That sounds like a proxy.
> What I should do?
Generally proxies are resolved automatically, so you must be doing
something wrong, but without answers to my questions above, I can't be
sure what that might be.
> Is it necessary to put all model in a single resource??
No, of course not.

But it is generally necessary to ensure you use absolute URIs when
saving and loading resources so that the serialized URIs in the results
are relative URIs.

If you have follow up questions, please be sure to answer the questions
above.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Resolved] - [EMF] - Customize URIHandlerImpl
Next Topic:[CDO 4.2M5] Security Model & H2 DB
Goto Forum:
  


Current Time: Fri Apr 19 23:01:35 GMT 2024

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

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

Back to the top