Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Model instance transformation
Model instance transformation [message #500040] Tue, 24 November 2009 18:45 Go to next message
Eclipse UserFriend
Originally posted by: luzi.anderegg.ergon.ch

Hi,

we store our model instances in multiple XMIResource using UUID's. There
is a base resource A which is referenced by resource B and C. Sometimes,
we replace an object in resource A by some other object. The object
should have the same ID as it is referenced by other objects in resource
B and C. What is the best way to do this?

Thanks,
Luzi
Re: Model instance transformation [message #500059 is a reply to message #500040] Tue, 24 November 2009 20:05 Go to previous messageGo to next message
Ed Merks is currently online Ed MerksFriend
Messages: 30650
Registered: July 2009
Senior Member
Luzi,

XMLResource has getID and setID methods you could use.


Luzi Anderegg wrote:
> Hi,
>
> we store our model instances in multiple XMIResource using UUID's.
> There is a base resource A which is referenced by resource B and C.
> Sometimes, we replace an object in resource A by some other object.
> The object should have the same ID as it is referenced by other
> objects in resource B and C. What is the best way to do this?
>
> Thanks,
> Luzi
Re: Model instance transformation [message #500073 is a reply to message #500059] Tue, 24 November 2009 20:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luzi.anderegg.ergon.ch

Ed Merks schrieb:
> Luzi,
>
> XMLResource has getID and setID methods you could use.
Thanks Ed. And is it ok to call setId with an EObject which is not in
the resource, i.e. can I first get the id of the object to replace, then
set the same id for the new object, and finally replace the object in
the resource?
>
>
> Luzi Anderegg wrote:
>> Hi,
>>
>> we store our model instances in multiple XMIResource using UUID's.
>> There is a base resource A which is referenced by resource B and C.
>> Sometimes, we replace an object in resource A by some other object.
>> The object should have the same ID as it is referenced by other
>> objects in resource B and C. What is the best way to do this?
>>
>> Thanks,
>> Luzi
Re: Model instance transformation [message #500088 is a reply to message #500073] Tue, 24 November 2009 21:48 Go to previous message
Ed Merks is currently online Ed MerksFriend
Messages: 30650
Registered: July 2009
Senior Member
Luzi,

I think that's okay, but it seems better to replace it and then set the ID.


Luzi Anderegg wrote:
> Ed Merks schrieb:
>> Luzi,
>>
>> XMLResource has getID and setID methods you could use.
> Thanks Ed. And is it ok to call setId with an EObject which is not in
> the resource, i.e. can I first get the id of the object to replace,
> then set the same id for the new object, and finally replace the
> object in the resource?
>>
>>
>> Luzi Anderegg wrote:
>>> Hi,
>>>
>>> we store our model instances in multiple XMIResource using UUID's.
>>> There is a base resource A which is referenced by resource B and C.
>>> Sometimes, we replace an object in resource A by some other object.
>>> The object should have the same ID as it is referenced by other
>>> objects in resource B and C. What is the best way to do this?
>>>
>>> Thanks,
>>> Luzi
Previous Topic:Wrapper for EObject and EMF Notification
Next Topic:databinding missing IEMFSetProperty
Goto Forum:
  


Current Time: Wed Nov 20 12:01:20 GMT 2019

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

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

Back to the top