|
|
|
Re: [CDO] CDOID vs. EMF ID attribute [message #482487 is a reply to message #482422] |
Wed, 26 August 2009 19:00 |
|
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
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.03103 seconds