We encountered a bug in Derby with
JDO-310 where the variable field was mapped to many-to-many relationships. We should add new tests for the next release cycle to test:
SELECT e FROM Department WHERE deptid==2 & employees.contains(e) VARIABLES Employee e
SELECT distinct e FROM Department WHERE deptid==2 & employees.contains(e) VARIABLES Employee e
SELECT p FROM Employee WHERE projects.contains(p) & p.name == 'orange' VARIABLES Project p
SELECT distinct p FROM Employee WHERE projects.contains(p) & p.name == 'orange' VARIABLES Project p