[EMFStore] Retaining ID's [message #1385671] |
Tue, 10 June 2014 08:16  |
Eclipse User |
|
|
|
Hi,
I have an EMF XMI resource that we have generated with manually set ID's. I wrapped all the EObjects in relevant EMFStore project and imported. This has well, but when I go to export the project, all the ID's I have set are replaced with UUID's.
Is there a way to retain all my ID's in ECP/EMFStore?
Thanks,
Mt Naj.
|
|
|
Re: [EMFStore] Retaining ID's [message #1385775 is a reply to message #1385671] |
Wed, 11 June 2014 03:39   |
Eclipse User |
|
|
|
Hi,
yes, you can use the internal API to set the IDs of you Resource as IDs
for EMFStore. You need to cast ESLocalProject to ESLocalProjectImpl and
then call
ESLocalProjectImpl.toInternalAPI().getProject().allocateModelElementIds(Map<EObject,
ModelElementId>).
Hope this helps!
Cheers,
Maximilian
Am 10.06.2014 14:16, schrieb Mt Naj:
> Hi,
>
> I have an EMF XMI resource that we have generated with manually set
> ID's. I wrapped all the EObjects in relevant EMFStore project and
> imported. This has well, but when I go to export the project, all the
> ID's I have set are replaced with UUID's.
> Is there a way to retain all my ID's in ECP/EMFStore?
>
> Thanks,
> Mt Naj.
>
--
Maximilian Kögel
Get Professional Eclipse Support: http://eclipsesource.com/munich
|
|
|
|
|
Re: [EMFStore] Retaining ID's [message #1451326 is a reply to message #1451213] |
Thu, 23 October 2014 13:14  |
Eclipse User |
|
|
|
Hi Alain,
somehow you must pass in a mapping of EObject to ID to the framework if
you wish to use your own IDs. So I see no way to avoid this, but maybe I
do not understand your question.
Cheers,
Maximilian
Am 23.10.2014 15:45, schrieb Alain Picard:
> BTW I got it to work, but I have to make sure the
> allocateModelElementIds is called before the object is attached to the
> model.
>
> This greatly impacts the design of the code that I have. Is there a
> better solution like providing the map and making sure it is updated
> before attaching objects to the model ?
>
> Thanks
> Alain
--
Maximilian Kögel
Get Professional Eclipse Support: http://eclipsesource.com/munich
|
|
|
Powered by
FUDForum. Page generated in 0.05939 seconds