Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
JDO 2 final (2.0)
-
None
Description
org.apache.jdo.tck.query.jdoql.NullCollectionsAndIsEmpty uses its localSetUp() method to null the projects of an Employee. However, the Employee.projects field uses mapped-by in its mapping, and per section 15.3 of the JDO 2 spec, that means changes to it aren't reflected in the datastore. To fix, add the following lines after retrieving "emp1" but before nulling its projects in localSetUp():
for (Iterator itr = emp1.getProjects().iterator(); itr.hasNext()
((Project) itr.next()).removeMember(emp1);