JDO
  1. JDO
  2. JDO-426

NullCollectionsAndIsEmpty does not unset mapped side of relation

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JDO 2 final (2.0)
    • Fix Version/s: JDO TCK challenge fixes
    • Component/s: tck
    • Labels:
      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);

        Activity

        Abe White created issue -
        Hide
        Abe White added a comment -

        I didn't mean to set the priority of this issue to "Major". Please consider a "Minor" issue.

        Show
        Abe White added a comment - I didn't mean to set the priority of this issue to "Major". Please consider a "Minor" issue.
        Michael Bouschen made changes -
        Field Original Value New Value
        Assignee Michael Bouschen [ mbo ]
        Hide
        Michael Bouschen added a comment -

        This needs to be fixed in the 2.0.1 branch, because the spec is ambiguous with respect to whether changes made on the mapped-by side are reflected in the database or not. The maintenance release will fix the spec and clarify that these changes are written to the database. So both test classes do not need to be changed in the trunk.

        I changed classes NullCollectionsAndIsEmpty and NullCollectionsAndContains in the branch 2.0.1 and added code to update the non mapped-by side of the relationship (see revision 452987).

        Show
        Michael Bouschen added a comment - This needs to be fixed in the 2.0.1 branch, because the spec is ambiguous with respect to whether changes made on the mapped-by side are reflected in the database or not. The maintenance release will fix the spec and clarify that these changes are written to the database. So both test classes do not need to be changed in the trunk. I changed classes NullCollectionsAndIsEmpty and NullCollectionsAndContains in the branch 2.0.1 and added code to update the non mapped-by side of the relationship (see revision 452987).
        Michael Bouschen made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Fix Version/s JDO 2.0 TCK challenge fixes [ 12312093 ]
        Andy Jefferson made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        19d 22h 9m 1 Michael Bouschen 04/Oct/06 20:41
        Resolved Resolved Closed Closed
        1348d 15h 27m 1 Andy Jefferson 14/Jun/10 12:08

          People

          • Assignee:
            Michael Bouschen
            Reporter:
            Abe White
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development