|
|
|
Re: [CDO] Consistency between XMIID and CDOId [message #1440507 is a reply to message #1440464] |
Wed, 08 October 2014 12:57 |
Felix Dorner Messages: 295 Registered: March 2012 |
Senior Member |
|
|
On 08/10/2014 13:55, Julien Siega wrote:
> Felix Dorner wrote on Wed, 08 October 2014 09:24
>> On 08/10/2014 10:21, Julien Siega wrote:
>> > Hi everyone,
>> >
>> > i'm using CDO and the function to import and export in XMI.
>> >
>> > I need to hold the consistency between XMIId and CDOid. For example
>> when
>> > i export my model from CDO to XMI i got XMIId for each Eobject. If i
>> > export again all XMIID are different for all EObjects.
>> >
>> > it's the same for the import.
>> >
>> > There is any way to keep the consistency between two exports, and
>> imports ?
>> >
>> > Thanks
>> > Julien
>>
>> I know people who "solved" this by storing the extrinsic IDs in a
>> separate model in the CDO Repo on import, and then reusing them when
>> Exporting back to XML.
>>
>> I think that if you find you have to conserve the IDs, you shouldn't
>> use them at all but rely on intrinsic model IDs.
>>
>> Felix
>
> Thanks for the tips, Is it a correspondence table between XMIId and
> CDOid ?
I don't remember exactly, I think they mapped XMI Id to the Object itself.
> Is it possible to override the generation of CDOId with my own id ? I
> have the idea to try to use XMIId inside CDO.
That's what I always wondered, but I don't know how CDOIds work. It
didn't seem feasible for some reason.
|
|
|
Re: [CDO] Consistency between XMIID and CDOId [message #1440625 is a reply to message #1440464] |
Wed, 08 October 2014 16:13 |
|
Am 08.10.2014 um 13:55 schrieb Julien Siega:
> Felix Dorner wrote on Wed, 08 October 2014 09:24
>> On 08/10/2014 10:21, Julien Siega wrote:
>> > Hi everyone,
>> >
>> > i'm using CDO and the function to import and export in XMI.
>> >
>> > I need to hold the consistency between XMIId and CDOid. For example when
>> > i export my model from CDO to XMI i got XMIId for each Eobject. If i
>> > export again all XMIID are different for all EObjects.
>> >
>> > it's the same for the import.
>> >
>> > There is any way to keep the consistency between two exports, and imports ?
>> >
>> > Thanks
>> > Julien
>>
>> I know people who "solved" this by storing the extrinsic IDs in a separate model in the CDO Repo on import, and then
>> reusing them when Exporting back to XML.
>>
>> I think that if you find you have to conserve the IDs, you shouldn't use them at all but rely on intrinsic model IDs.
>>
>> Felix
>
> Thanks for the tips, Is it a correspondence table between XMIId and CDOid ?
>
> Is it possible to override the generation of CDOId with my own id ? I have the idea to try to use XMIId inside CDO.
You can configure the server (before first start!) to let the clients generate UUIDs instead of the deault
server-generated long IDs:
In your cdo-server.xml set:
<property name="idGenerationLocation" value="CLIENT"/> <!-- Possible values: STORE | CLIENT -->
Then cdoID() will return a client-assigned UUID, which will also be stored in the cdo_id columns in the DB.
With CLIENT-assigned IDs you can plug your own CDOIDGenerator into the CDOSession:
org.eclipse.emf.cdo.session.CDOSessionConfiguration.setIDGenerator(CDOIDGenerator)
We could also enhance the CDOTransfer framework (assuming that's what you're using to export/import) to save target
XMLResources with xmi:id=CDOID.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04306 seconds