Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 151560 - Query Language for CDO
Summary: Query Language for CDO
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 enhancement with 1 vote (vote)
Target Milestone: Ganymede   Edit
Assignee: Eike Stepper CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-24 03:56 EDT by Chris Lenz CLA
Modified: 2010-06-29 09:21 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lenz CLA 2006-07-24 03:56:14 EDT
I would suggest a query language for CDO.
I thing it would be nice to make queries on cdo via ocl. Maybe it should be possible to add also the content int which the query is executed (on the whole models, or only on one specific model)

Interesting would be somthing like recursive functions in ocl like:
def: let getSubroles(r: Role) : Set(Role) =
r.subrole->collect(x|getSubroles(x))->asSet()->union(r.subrole)
The point is that it should be possible to get peaces of the whole environment whitout loading all models:
If elements are allreay in the heap, and we get them a second time from the server this should be the same object.

:-)
Comment 1 Eike Stepper CLA 2006-08-23 16:53:44 EDT
I've added support for OCL at client side. A special IOCLHelper implementation triggers remote requests to lazily gather extents. The scope of the extents can be specified as resource-wide or global. There's a convenient CDOHelperUtil to get the IOCLHelper for CDO:

    IOCLHelper helper = CDOHelperUtil.createOCLHelper(true);
    helper.setContext(eObject);

The following statements are identical in effect:

    IOCLHelper helper = CDOHelperUtil.createOCLHelper();
    IOCLHelper helper = CDOHelperUtil.createOCLHelper(false);

The QueryExtent signal and appropriate API has been added to the CDO protocol and is usable without OCL.
The IOCLHelper implementation for CDO and the needed support is in the new org.eclipse.emf.cdo.client.ocl plugin.
Some very basic tests are in:
	/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/ExtentTest.java
	/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/OCLTest.java
Comment 2 Eike Stepper CLA 2006-08-23 16:55:07 EDT
Committed to CVS
Comment 3 Eike Stepper CLA 2006-09-29 03:38:43 EDT
Fixed in 0.7.0.v200609261409
Comment 4 Nick Boldt CLA 2008-01-28 16:44:07 EST
Move to verified as per bug 206558.
Comment 5 Eike Stepper CLA 2008-09-11 13:48:01 EDT
CLOSING