Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Reference to CDOObject
[CDO] Reference to CDOObject [message #882043] Tue, 05 June 2012 17:32 Go to next message
Christophe MOINE is currently offline Christophe MOINEFriend
Messages: 34
Registered: February 2012
Member
Hello CDO Team,

I would like to make a reference to a CDOObject in my model; for now I did the trick with a long Attribute that stores the CDO IDs, but it enforces me the make several transactions to get a valid CDO ID... Sad The only remaining way left I see is to make a SuperType for everyone of my classes, but that is a bit tedious: do you see any other ways ?

I guess maybe not because it could mix up with other meta models... Is that correct ?

Thank you in advance,

Regards,

Christophe.
Re: [CDO] Reference to CDOObject [message #882052 is a reply to message #882043] Tue, 05 June 2012 17:52 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 05.06.2012 19:32, schrieb Christophe MOINE:
> Hello CDO Team,
>
> I would like to make a reference to a CDOObject in my model;
Why not just througha normal EReference?

> for now I did the trick with a long Attribute that stores the CDO IDs, but it enforces me the make several
> transactions to get a valid CDO ID...
Yes, that's a known problem with store-assigned IDs.

> :( The only remaining way left I see is to make a SuperType for everyone of my classes, but that is a bit tedious:
What do you mean by super type? How's that supposed to work?

> do you see any other ways ?
With CDO 4.1 you can use client-assigned IDs. Please refer to

352561: Support client assigned CDOIDs (UUIDs)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=352561

Another way would be to implement a mechanism that allows the server to modify a committed changeset before it reaches
the storage layer.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Reference to CDOObject [message #882278 is a reply to message #882052] Wed, 06 June 2012 07:21 Go to previous messageGo to next message
Christophe MOINE is currently offline Christophe MOINEFriend
Messages: 34
Registered: February 2012
Member
> Am 05.06.2012 19:32, schrieb Christophe MOINE:
> > Hello CDO Team,
> >
> > I would like to make a reference to a CDOObject in my model;
> Why not just througha normal EReference?

an EReference of which kind ? I cannot choose EObject or something like that Sad

> > for now I did the trick with a long Attribute that stores the CDO IDs, but it enforces me the make several
> > transactions to get a valid CDO ID...
> Yes, that's a known problem with store-assigned IDs.
Ok no problem...

> > Sad The only remaining way left I see is to make a SuperType for everyone of my classes, but that is a bit tedious:
> What do you mean by super type? How's that supposed to work?

I maybe should say super interface, such as an EClass "ModelElement": each EClass should implement this super interface. Then I would make a reference of type "ModelElement".

> > do you see any other ways ?
> With CDO 4.1 you can use client-assigned IDs. Please refer to
> 352561: Support client assigned CDOIDs (UUIDs)

If I understand well, it uses UUIDs, which sounds really nice... Is there some performance difference when using UUIDs since the server doesn't need to calculate the next suitable cdoID ?


> Another way would be to implement a mechanism that allows the server to modify a committed changeset before it reaches
the storage layer.

Sounds a bit complicated for me Smile

Cheers,

Christophe.
Re: [CDO] Reference to CDOObject [message #882294 is a reply to message #882278] Wed, 06 June 2012 07:41 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 06.06.2012 09:21, schrieb Christophe MOINE:
>> Am 05.06.2012 19:32, schrieb Christophe MOINE:
>> > Hello CDO Team,
>> >
>> > I would like to make a reference to a CDOObject in my model; Why not just througha normal EReference?
>
> an EReference of which kind ? I cannot choose EObject or something like that :(
Oh, why not?

>
>> > for now I did the trick with a long Attribute that stores the CDO IDs, but it enforces me the make several >
>> transactions to get a valid CDO ID...
>> Yes, that's a known problem with store-assigned IDs.
> Ok no problem...
>
>> > :( The only remaining way left I see is to make a SuperType for everyone of my classes, but that is a bit tedious:
>> What do you mean by super type? How's that supposed to work?
>
> I maybe should say super interface, such as an EClass "ModelElement": each EClass should implement this super
> interface. Then I would make a reference of type "ModelElement".
Now I see what you mean. I think EObject should work, too.

>
>> > do you see any other ways ?
>> With CDO 4.1 you can use client-assigned IDs. Please refer to
>> 352561: Support client assigned CDOIDs (UUIDs)
>
> If I understand well, it uses UUIDs, which sounds really nice... Is there some performance difference when using UUIDs
> since the server doesn't need to calculate the next suitable cdoID ?
I can just guess that the opposite is the case: String IDs consume more space in memory and in the DB. Processing them
here and there would probably also consume some extra cycles.

>
>
>> Another way would be to implement a mechanism that allows the server to modify a committed changeset before it reaches
> the storage layer.
>
> Sounds a bit complicated for me :)
Certainly quicker if I'd do it :P

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Reference to CDOObject [message #882298 is a reply to message #882294] Wed, 06 June 2012 07:58 Go to previous messageGo to next message
Christophe MOINE is currently offline Christophe MOINEFriend
Messages: 34
Registered: February 2012
Member
Ok, now I understand our misunderstanding:
We cannot choose type EObject for an EReference, just Object.... I read some artical about this, but cannot find it again.

Ok no pb, I'll do it with "ModelElement", since I need it quite quickly Wink

Thank you,

Cheers,

Christophe.
Re: [CDO] Reference to CDOObject [message #882307 is a reply to message #882298] Wed, 06 June 2012 08:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
EObject should always be available as a possible type for an
EReference. Which editor are you using?


On 06/06/2012 9:59 AM, Christophe MOINE wrote:
> Ok, now I understand our misunderstanding:
> We cannot choose type EObject for an EReference, just Object.... I
> read some artical about this, but cannot find it again.
>
> Ok no pb, I'll do it with "ModelElement", since I need it quite
> quickly ;)
>
> Thank you,
>
> Cheers,
>
> Christophe.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [CDO] Reference to CDOObject [message #882365 is a reply to message #882307] Wed, 06 June 2012 10:04 Go to previous messageGo to next message
Christophe MOINE is currently offline Christophe MOINEFriend
Messages: 34
Registered: February 2012
Member
Goooosh, I was using "Ecore Diagram Editing", but the plain "Sample Ecore Model Editor" offers EObject... :-/

Sorry, but that was a bit tricky ! Smile

Cheers,

Christophe.
Re: [CDO] Reference to CDOObject [message #882378 is a reply to message #882365] Wed, 06 June 2012 10:39 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 06.06.2012 12:04, schrieb Christophe MOINE:
> Goooosh, I was using "Ecore Diagram Editing",
Even there you can refers to EObjects by right-clicking on "Additional resources" in the outline view and selecting
"Load resource" to load the EcorePackage.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:[CDO 4.1] : Adapter of ResourceSet of remote user not notified on Resource add/remove
Next Topic:[CDO] Latest 4.0 maintenance branch materializes wrong plugin dependency versions?
Goto Forum:
  


Current Time: Fri Apr 19 13:26:00 GMT 2024

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

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

Back to the top