Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » How to copy eResources such that xmi ids are maintained across resources
How to copy eResources such that xmi ids are maintained across resources [message #615995] Wed, 26 March 2008 19:40
Rohit Kelapure is currently offline Rohit KelapureFriend
Messages: 11
Registered: July 2009
Junior Member
How do I copy an eResource (say oldResource) to a new eResource (say
newResource) such that the newResource keeps the same xmi ids of the model
eobjects persisted in the oldResource.

This is what I am currently doing ..
Resource oldResource = myEObject.eResource();
ResourceSet resourceSet = oldResource.getResourceSet();
URI originalUri = oldResource.getURI();
Resource newResource = resourceSet.createResource(originalUri);
newResource.setURI(newURI);
newResource.getContents().add(newDD);
newResource().save(new HashMap());

After creating and persisting the newResource I dont see the XMI ids of
the eObjects in oldResource copy over to the newResource.

Can someone please help. What do I need to do here ...?

Thanks in advance,
Rohit Kelapure
Previous Topic:[Teneo] NoSuchMethodError exception when trying to add element to an EList
Next Topic:[Teneo] Creating/Opening several GMF diagrams
Goto Forum:
  


Current Time: Fri Jun 18 06:40:50 GMT 2021

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

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

Back to the top