Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [sdo serialization] want to use reference instead of id
[sdo serialization] want to use reference instead of id [message #431198] Thu, 02 July 2009 09:35 Go to next message
Thomas is currently offline Thomas
Messages: 37
Registered: July 2009
Member
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 10:52 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26137
Registered: July 2009
Senior Member
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
Previous Topic:Question about EFeatureMap
Next Topic:Accessing attributes in generated code for editor
Goto Forum:
  


Current Time: Thu Oct 23 13:54:39 GMT 2014

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

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