Uploaded image for project: 'JDO'
  1. JDO
  2. JDO-426

NullCollectionsAndIsEmpty does not unset mapped side of relation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • JDO 2 final (2.0)
    • JDO TCK challenge fixes
    • tck
    • 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);

      Attachments

        Activity

          People

            mbo Michael Bouschen
            awhite A. Abram White
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: