JDO
  1. JDO
  2. JDO-411

Attempt to bulk-delete Employee records without nulling foreign key references from InsurancePlan

    Details

      Description

      Multiple test cases attempt to bulk delete instances of Person. However, the Employee subclass of Person might wind up having a non-nullable foreign key reference to Insurance or another Employee (via the "mentor" field). While the defaut Derby TCK schema does not have this constraint, in order to be flexible for other databases that will enforce the foreign key by default, some effort should be made to ensure that there are no relation constraints before the bulk deletes are attempted. This can be done by adding a nullForeignKeyReferences() method that will manually make sure that the relations are nulled. See the attached patch.

      This affects the following tests:

      org.apache.jdo.tck.query.delete.DeletePersistentAll.testNoParametersAPI
      org.apache.jdo.tck.query.delete.DeletePersistentAll.testNoParametersSingleString
      org.apache.jdo.tck.query.delete.DeletePersistentAll.testObjectArrayParametersAPI
      org.apache.jdo.tck.query.delete.DeletePersistentAll.testObjectArrayParametersSingleString
      org.apache.jdo.tck.query.delete.DeletePersistentAll.testMapParametersAPI
      org.apache.jdo.tck.query.delete.DeletePersistentAll.testMapParametersSingleString
      org.apache.jdo.tck.query.delete.DeleteQueryElements.testAPI
      org.apache.jdo.tck.query.delete.DeleteQueryElements.testSingleString

      1. DeletePersistentAll.patch
        2 kB
        Marc Prud'hommeaux
      2. JDO-411.patch
        8 kB
        Michael Bouschen

        Activity

          People

          • Assignee:
            Michael Bouschen
            Reporter:
            Marc Prud'hommeaux
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development