Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] CDOID vs. EMF ID attribute
[CDO] CDOID vs. EMF ID attribute [message #482349] Wed, 26 August 2009 10:37 Go to next message
Michael Szediwy is currently offline Michael SzediwyFriend
Messages: 23
Registered: July 2009
Junior Member
Hi,


as far as I understood it EMF has the ability to support an ID
attribute. The EMF resource can directly access an object given the id.
My question is whether CDO resources can handle this special ID attribute?
E.g. to directly obtain an object from a resource using the id.
Or can the CDOID be used instead?

Thanks in advance,

Michael
Re: [CDO] CDOID vs. EMF ID attribute [message #482403 is a reply to message #482349] Wed, 26 August 2009 13:01 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
Hi Michael,

comments below

Michael Szediwy schrieb:
> Hi,
>
>
> as far as I understood it EMF has the ability to support an ID
> attribute. The EMF resource can directly access an object given the id.
> My question is whether CDO resources can handle this special ID
> attribute?
> E.g. to directly obtain an object from a resource using the id.
I'm currently not sure about the ID attribute, maybe that has something
to do with the XML-features of EMF.

We do not regard a common EMF-based ID in CDO.
You can, however, use queries to lookup objects having certain values
(e.g. if you create your custom ID).
> Or can the CDOID be used instead?
The CDOID can indeed be used to retrieve objects from the CDO store. You
can use CDOView.getObject() to achieve this.

Cheers,
Stefan
Re: [CDO] CDOID vs. EMF ID attribute [message #482422 is a reply to message #482403] Wed, 26 August 2009 13:54 Go to previous messageGo to next message
Michael Szediwy is currently offline Michael SzediwyFriend
Messages: 23
Registered: July 2009
Junior Member
Hi Stefan,

thanks for your quick response.
You wrote about querying a CDO resource.
How would I do that?


Stefan Winkler wrote:
> Hi Michael,
>
> comments below
>
> Michael Szediwy schrieb:
>> Hi,
>>
>>
>> as far as I understood it EMF has the ability to support an ID
>> attribute. The EMF resource can directly access an object given the id.
>> My question is whether CDO resources can handle this special ID
>> attribute?
>> E.g. to directly obtain an object from a resource using the id.
> I'm currently not sure about the ID attribute, maybe that has something
> to do with the XML-features of EMF.
>
> We do not regard a common EMF-based ID in CDO.
> You can, however, use queries to lookup objects having certain values
> (e.g. if you create your custom ID).
>> Or can the CDOID be used instead?
> The CDOID can indeed be used to retrieve objects from the CDO store. You
> can use CDOView.getObject() to achieve this.
>
> Cheers,
> Stefan
Re: [CDO] CDOID vs. EMF ID attribute [message #482487 is a reply to message #482422] Wed, 26 August 2009 19:00 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Michael,

Kai contributed a brief wiki article about the SQL query (together with
the SQLQueryHandler implementation itself :P ):
http://wiki.eclipse.org/Query_DB_Store_by_using_SQL

Please also note that there are at least three major semantic
differences between XML IDs and CDOIDs:

1: XML IDs are (must be) unique within a single resource. CDOIDs are
unique within their CDO repository, hence in your resource set.
2: You must createthe XML IDs. CDO creates the CDOIDs.
3: You can change the value of XML IDs at any time. The value of a CDOID
will never change (only exception is the NEW-->CLEAN transition that is
triggered by a commit operation at most once in the lifetime of each
persistent CDOObject)

If, for some reason, you already know the CDOID of an object you don't
need a query. Ask CDOView.getObject(CDOID).

HTH.

Cheers
/Eike

----
http://thegordian.blogspot.com



Michael Szediwy schrieb:
> Hi Stefan,
>
> thanks for your quick response.
> You wrote about querying a CDO resource.
> How would I do that?
>
>
> Stefan Winkler wrote:
>> Hi Michael,
>>
>> comments below
>>
>> Michael Szediwy schrieb:
>>> Hi,
>>>
>>>
>>> as far as I understood it EMF has the ability to support an ID
>>> attribute. The EMF resource can directly access an object given the id.
>>> My question is whether CDO resources can handle this special ID
>>> attribute?
>>> E.g. to directly obtain an object from a resource using the id.
>> I'm currently not sure about the ID attribute, maybe that has something
>> to do with the XML-features of EMF.
>>
>> We do not regard a common EMF-based ID in CDO.
>> You can, however, use queries to lookup objects having certain values
>> (e.g. if you create your custom ID).
>>> Or can the CDOID be used instead?
>> The CDOID can indeed be used to retrieve objects from the CDO store. You
>> can use CDOView.getObject() to achieve this.
>>
>> Cheers,
>> Stefan


Previous Topic:EMF object & propertyTester
Next Topic:Custom Create Methods
Goto Forum:
  


Current Time: Thu Apr 25 20:35:11 GMT 2024

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

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

Back to the top