Home » Modeling » EMF » [CDO] Query instances of abstract types
|
Re: [CDO] Query instances of abstract types [message #649318 is a reply to message #649305] |
Tue, 18 January 2011 17:49 |
Victor Roldan Betancort Messages: 524 Registered: July 2009 |
Senior Member |
|
|
Erdal,
at API level, you can use OCL to query the server. Take a look at
org.eclipse.emf.cdo.tests.OCLQueryTest, there are several examples on
how to do that:
CDOQuery query = transaction.createQuery("ocl",
"Product1.allInstances()", getModel1Package().getProduct1());
List<Product1> products = query.getResult(Product1.class);
However, if you are looking to achieve this through CDO UI, there isn't
any tooling for that yet, sorry.
HTH,
Víctor.
Erdal Karaca escribió:
> I have an abstract super type of which multiple concrete types exist.
> Now, how would I query CDO to return all instances of that abstract type?
|
|
|
Re: [CDO] Query instances of abstract types [message #649324 is a reply to message #649318] |
Tue, 18 January 2011 18:21 |
|
Am 18.01.2011 18:49, schrieb Víctor Roldán Betancort:
> Erdal,
>
> at API level, you can use OCL to query the server. Take a look at org.eclipse.emf.cdo.tests.OCLQueryTest, there are several examples on how to do that:
>
>
> CDOQuery query = transaction.createQuery("ocl", "Product1.allInstances()", getModel1Package().getProduct1());
>
> List<Product1> products = query.getResult(Product1.class);
If you suspect a huge result set you may also call:
CloseableIterator<Product1> products = query.getResultAsync(Product1.class);
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
>
> However, if you are looking to achieve this through CDO UI, there isn't any tooling for that yet, sorry.
>
> HTH,
> Víctor.
>
>
> Erdal Karaca escribió:
>> I have an abstract super type of which multiple concrete types exist.
>> Now, how would I query CDO to return all instances of that abstract type?
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
| | | |
Re: [CDO] Query instances of abstract types [message #649347 is a reply to message #649329] |
Tue, 18 January 2011 20:31 |
|
Am 18.01.2011 19:32, schrieb Víctor Roldán Betancort:
> I actually have a query like that implemented, but only for DBStore. I could contribute it if necessary.
Thank you, Vik! But this API would need to *supportable* by any store implementation. The way I have it in mind does even not require changes in the IStore SPI as we're already using similar functionality elsewhere.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
>
> Eike Stepper escribió:
>> Am 18.01.2011 19:21, schrieb Eike Stepper:
>>> Hi Erdal,
>>>
>>> There is a bug in OCL itself:
>>>
>>> 329389: allInstances suspect on Abstract classes
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=329389
>> If you file an enhancement request against cdo.core someone may be able
>> to add API like:
>>
>> CDOView.queryInstances(EClass eClass, boolean includeSubClasses);
>> CDOView.queryInstancesAsync(EClass eClass, boolean includeSubClasses);
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 18.01.2011 17:55, schrieb Erdal Karaca:
>>>> I have an abstract super type of which multiple concrete types exist.
>>>> Now, how would I query CDO to return all instances of that abstract
>>>> type?
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
| |
Re: [CDO] Query instances of abstract types [message #649460 is a reply to message #649347] |
Wed, 19 January 2011 10:35 |
Victor Roldan Betancort Messages: 524 Registered: July 2009 |
Senior Member |
|
|
I see... I though the design would be similar to queryxref. I use IStore
dependant queries because it allows me to optimize, in the case of
DBStore, with simple SQL queries. I wonder if you could achieve a fast
IStore agnostic query. Looking forward to it :D
Thanks!
Víctor
Eike Stepper escribió:
> Am 18.01.2011 19:32, schrieb Víctor Roldán Betancort:
>> I actually have a query like that implemented, but only for DBStore. I
>> could contribute it if necessary.
> Thank you, Vik! But this API would need to *supportable* by any store
> implementation. The way I have it in mind does even not require changes
> in the IStore SPI as we're already using similar functionality elsewhere.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> Eike Stepper escribió:
>>> Am 18.01.2011 19:21, schrieb Eike Stepper:
>>>> Hi Erdal,
>>>>
>>>> There is a bug in OCL itself:
>>>>
>>>> 329389: allInstances suspect on Abstract classes
>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=329389
>>> If you file an enhancement request against cdo.core someone may be able
>>> to add API like:
>>>
>>> CDOView.queryInstances(EClass eClass, boolean includeSubClasses);
>>> CDOView.queryInstancesAsync(EClass eClass, boolean includeSubClasses);
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>
>>>> Am 18.01.2011 17:55, schrieb Erdal Karaca:
>>>>> I have an abstract super type of which multiple concrete types exist.
>>>>> Now, how would I query CDO to return all instances of that abstract
>>>>> type?
>>
|
|
|
Re: [CDO] Query instances of abstract types [message #649469 is a reply to message #649460] |
Wed, 19 January 2011 11:18 |
|
Am 19.01.2011 11:35, schrieb Víctor Roldán Betancort:
> I see... I though the design would be similar to queryxref. I use IStore dependant queries because it allows me to optimize, in the case of DBStore, with simple SQL queries. I wonder if you could achieve a fast IStore agnostic query. Looking forward to it :D
It would be based on IStoreAccessor.handleRevisions(EClass, CDOBranch, long, boolean, CDORevisionHandler)
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
>
> Thanks!
> Víctor
>
> Eike Stepper escribió:
>> Am 18.01.2011 19:32, schrieb Víctor Roldán Betancort:
>>> I actually have a query like that implemented, but only for DBStore. I
>>> could contribute it if necessary.
>> Thank you, Vik! But this API would need to *supportable* by any store
>> implementation. The way I have it in mind does even not require changes
>> in the IStore SPI as we're already using similar functionality elsewhere.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> Eike Stepper escribió:
>>>> Am 18.01.2011 19:21, schrieb Eike Stepper:
>>>>> Hi Erdal,
>>>>>
>>>>> There is a bug in OCL itself:
>>>>>
>>>>> 329389: allInstances suspect on Abstract classes
>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=329389
>>>> If you file an enhancement request against cdo.core someone may be able
>>>> to add API like:
>>>>
>>>> CDOView.queryInstances(EClass eClass, boolean includeSubClasses);
>>>> CDOView.queryInstancesAsync(EClass eClass, boolean includeSubClasses);
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>
>>>>> Am 18.01.2011 17:55, schrieb Erdal Karaca:
>>>>>> I have an abstract super type of which multiple concrete types exist.
>>>>>> Now, how would I query CDO to return all instances of that abstract
>>>>>> type?
>>>
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Goto Forum:
Current Time: Thu Apr 25 07:05:48 GMT 2024
Powered by FUDForum. Page generated in 0.03930 seconds
|