Class to generate a QueryStatement for iterating through the elements of a Set. This can be in an Extent/Query for example where the user has selected a candidate class and to include/exclude subclasses. The generated query statement typically contains UNIONs for each of the possible classes involved.
To give an example, lets assume that we have class A which is the candidate and this has a subclass B. We want to find all objects of the candidate type and optionally its subclasses and we want information about what type the object is (A or B). The query will be of the form
SELECT THIS.A_ID,'org.jpox.samples.A' as JPOXMETADATA, THIS.COLUMN1, THIS.COLUMN2 FROM A THIS LEFT OUTER JOIN B SUBELEMENT0 ON SUBELEMENT0.B_ID = THIS.A_ID WHERE SUBELEMENT0.B_ID IS NULL UNION SELECT THIS.A_ID,'org.jpox.samples.B' as JPOXMETADATA, THIS.COLUMN1, THIS.COLUMN2 FROM A THIS INNER JOIN B 'ELEMENT' ON 'ELEMENT'.B_ID = THIS.A_ID
Extent
Here we use the above arrangement, with the "source" being the element table and the mapping being the ID column mapping.
"JoinTable" Relationship
Here the join table is the candidate table, and the "source" would be the element table, and the mapping in the join table to join to this element table PK column.
"FK" Relationship
Here we use the same arrangement as the Extent case. The "source" is the element table, and the mapping being the ID column mapping.
Map "Key" table
Here we have the key table as the candidate, and we join to the value table. So the "source" is the value table, with the mapping being the mapping of the key column in the value table.
Primitive key/value in SCO table
This also supports retrieval of keys or values of a map that are stored as a column in a different table. TODO Add full documentation for all combinations supported. TODO Commonise the code with DiscriminatorIteratorStatement
@version $Revision: 1.9 $