
|
If you were logged in you would be able to see more operations.
|
|
|
JPOX RDBMS
Created: 02/Jan/08 11:45 AM
Updated: 02/Jan/08 05:09 PM
|
|
| Component/s: |
Queries
|
| Affects Version/s: |
None
|
| Fix Version/s: |
1.2.0-rc-1
|
|
|
The JDOQL
SELECT this.id FROM org.jpox.test.A
WHERE this.setB.contains(b1) && b1.propertyName == :propName1 && b1.value == :propValue1
VARIABLES org.jpox.test.B b1
results in SQL of
SELECT `THIS`.`ID`
FROM `A` `THIS` CROSS JOIN `B` `UNBOUND_B1`
WHERE EXISTS (
SELECT 1 FROM `B` `THIS_SETB_B1`
WHERE `THIS_SETB_B1`.`A_ID` = `THIS`.`ID`
AND `THIS_SETB_B1`.`A_ID` = `THIS`.`ID`
AND `UNBOUND_B1`.`ID` = `THIS_SETB_B1`.`ID`
AND `THIS_SETB_B1`.`PROPERTY_NAME` = 'EditorialItemTitle'
AND `THIS_SETB_B1`.`VALUE` = 'Plan the Perfect Alaskan Vacation')
so the EXISTS subselect has THIS_SETB_B1.A_ID = THIS.ID duplicated. This comes out of CollectionExpression.contains
QueryExpression qexpr = collStore.getExistsSubquery(qs, mapping, te, ctRangeVar);
...
ScalarExpression bindTo = collStore.joinElementsTo(qexpr, qs, mapping, te, ctRangeVar, var.getVariableType(), expr, expr.te == null ? etRangeVar : expr.te.getRangeVariable());
and each of these parts is adding the constraint. Why ?
|
|
Description
|
The JDOQL
SELECT this.id FROM org.jpox.test.A
WHERE this.setB.contains(b1) && b1.propertyName == :propName1 && b1.value == :propValue1
VARIABLES org.jpox.test.B b1
results in SQL of
SELECT `THIS`.`ID`
FROM `A` `THIS` CROSS JOIN `B` `UNBOUND_B1`
WHERE EXISTS (
SELECT 1 FROM `B` `THIS_SETB_B1`
WHERE `THIS_SETB_B1`.`A_ID` = `THIS`.`ID`
AND `THIS_SETB_B1`.`A_ID` = `THIS`.`ID`
AND `UNBOUND_B1`.`ID` = `THIS_SETB_B1`.`ID`
AND `THIS_SETB_B1`.`PROPERTY_NAME` = 'EditorialItemTitle'
AND `THIS_SETB_B1`.`VALUE` = 'Plan the Perfect Alaskan Vacation')
so the EXISTS subselect has THIS_SETB_B1.A_ID = THIS.ID duplicated. This comes out of CollectionExpression.contains
QueryExpression qexpr = collStore.getExistsSubquery(qs, mapping, te, ctRangeVar);
...
ScalarExpression bindTo = collStore.joinElementsTo(qexpr, qs, mapping, te, ctRangeVar, var.getVariableType(), expr, expr.te == null ? etRangeVar : expr.te.getRangeVariable());
and each of these parts is adding the constraint. Why ? |
Show » |
|