Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 400762

Summary: OCLQueryHandler does not consider subtypes
Product: [Modeling] EMF Reporter: Jan Rosczak <jan.rosczak>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: ed, jan.rosczak, mathieu.velten
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Jan Rosczak CLA 2013-02-14 02:24:31 EST
Lets say I have the following simple model:

AttributeTable
String name

GreenAttibuteTable extends AttributeTable

BlueAttributeTable extends AttributeTable

In my repository, I have four instances of GreenAttributeTables and three instances of BlueAttributeTables.

Using the OCL query string "AttributeTable.allInstances()" to get all instances of AttributeTables, GreenAttributeTables and BlueAttributeTables does not return any result, but I would have expected to get back seven instances of AttributeTables (the green and blue ones together).

As Bug 329389 indicates, it should generally work.
Comment 1 Eike Stepper CLA 2013-02-15 06:01:08 EST
*** Bug 400907 has been marked as a duplicate of this bug. ***
Comment 2 Ed Willink CLA 2013-02-15 06:21:58 EST
(In reply to comment #1)
> *** Bug 400907 has been marked as a duplicate of this bug. ***

See Bug 400907 for the analysis of this problem. 

(Perhaps better to reverse the duplication direction.)
Comment 3 Eike Stepper CLA 2013-04-07 03:54:43 EDT
I've fixed this both for eager and lazy extents:
commit f2af641004b144f4e0330e20ed9a5abeaeda15b0

Please note that I've set the default to lazy extents. This can be overridden via OCLQueryHandler.createsLazyExtents() or the (new) boolean query parameter "cdoLazyExtents". I've also added OCLQueryTest.Lazy to verify both extent creators.
Comment 4 Eike Stepper CLA 2013-06-27 03:31:51 EDT
Available in R20130613-1157 (4.2)