[sdo serialization] want to use reference instead of id [message #431198] |
Thu, 02 July 2009 05:35  |
Eclipse User |
|
|
|
Hi all,
I have problem with sdo serialization.
We are using teneo for loading our data, so ids are generated by
database. Depending on database type, id for different EObject are
generated differently as it can be unique for all object or inside a
type of object.
In the second case (which is the case with sql server database), I have
problem with sdo serialization.
Here is a sample of serialization
<sdo:datagraph xmlns:com.oslo.dreams="http:///com.oslo.dreams.model"
xmlns:sdo="commonj.sdo">
<com.oslo.dreams:Root>
<resources name="toto" resourceCategories="#1"
capabilities="#//@eRootObject/@capabilities.0
#//@eRootObject/@capabilities.1"
capacity="5"/>
<capabilities name="capa1" skill="#1"
resourceOwner="#//@eRootObject/@resources.0"/>
<capabilities name="capa2" skill="#2"
resourceOwner="#//@eRootObject/@resources.0"/>
<resourceCategories id="1" name="haute categorie"/>
<skills id="1" name="s1"/>
<skills id="2" name="s2"/>
</com.oslo.dreams:Root>
</sdo:datagraph>
As we can see, some references are using ids.
But for id 1 we have to kind of EObject (Skill and ResourceCategorie)
So the deserialization will not work.
We are working with ecore 2.4.2 and teneo 1.1.0.
Thank's all for any clue that can help me to get ahead.
Thomas
|
|
|
Re: [sdo serialization] want to use reference instead of id [message #431200 is a reply to message #431198] |
Thu, 02 July 2009 06:52  |
Eclipse User |
|
|
|
Thomas,
Comments below.
Thomas Franconville wrote:
> Hi all,
>
> I have problem with sdo serialization.
> We are using teneo for loading our data, so ids are generated by
> database. Depending on database type, id for different EObject are
> generated differently as it can be unique for all object or inside a
> type of object.
Well, that's not how IDs are defined in XML Schema or Ecore though.
They must be unique with a resource/document across all types.
> In the second case (which is the case with sql server database), I
> have problem with sdo serialization.
> Here is a sample of serialization
>
> <sdo:datagraph xmlns:com.oslo.dreams="http:///com.oslo.dreams.model"
> xmlns:sdo="commonj.sdo">
> <com.oslo.dreams:Root>
> <resources name="toto" resourceCategories="#1"
> capabilities="#//@eRootObject/@capabilities.0
> #//@eRootObject/@capabilities.1"
> capacity="5"/>
> <capabilities name="capa1" skill="#1"
> resourceOwner="#//@eRootObject/@resources.0"/>
> <capabilities name="capa2" skill="#2"
> resourceOwner="#//@eRootObject/@resources.0"/>
> <resourceCategories id="1" name="haute categorie"/>
> <skills id="1" name="s1"/>
> <skills id="2" name="s2"/>
> </com.oslo.dreams:Root>
> </sdo:datagraph>
>
> As we can see, some references are using ids.
> But for id 1 we have to kind of EObject (Skill and ResourceCategorie)
> So the deserialization will not work.
It's an invalid document so unfortunately it's not going to work.
Resource.getEObject only gets a String argument. It does not know the
type of object it should return.
>
>
> We are working with ecore 2.4.2 and teneo 1.1.0.
I'd suggest using a specialized EDataType for each such id EAttribute
and encode the type name, as part of convertAbcToString.
>
> Thank's all for any clue that can help me to get ahead.
>
>
> Thomas
|
|
|
Powered by
FUDForum. Page generated in 0.03987 seconds