com.mdbtest.ExportException: com.healthmarketscience.jackcess.ConstraintViolationException: Adding new row [10, null] violates constraint Foreign Key from B[FK] (secondary) to A[ID] (primary) (Db=export_test887929677054003886.mdb)

jackcess | jahlborn | 9 months ago
  1. 0

    Foreign key fields should allow null

    jackcess | 9 months ago | jahlborn
    com.mdbtest.ExportException: com.healthmarketscience.jackcess.ConstraintViolationException: Adding new row [10, null] violates constraint Foreign Key from B[FK] (secondary) to A[ID] (primary) (Db=export_test887929677054003886.mdb)

    Root Cause Analysis

    1. com.healthmarketscience.jackcess.ConstraintViolationException

      Adding new row [10, -1] violates constraint Foreign Key from B[FK] (secondary) to A[ID] (primary) (Db=ngm_export_test887929677054003886.mdb)

      at com.healthmarketscience.jackcess.impl.FKEnforcer.requirePrimaryValues()
    2. com.healthmarketscience.jackcess
      TableImpl.addRow
      1. com.healthmarketscience.jackcess.impl.FKEnforcer.requirePrimaryValues(FKEnforcer.java:224)
      2. com.healthmarketscience.jackcess.impl.FKEnforcer.addRow(FKEnforcer.java:132)
      3. com.healthmarketscience.jackcess.impl.TableImpl.addRows(TableImpl.java:1595)
      4. com.healthmarketscience.jackcess.impl.TableImpl.addRow(TableImpl.java:1462)
      4 frames
    3. com.mdbtest
      TestAccdbFK.main
      1. com.mdbtest.TestAccdbFK.main(TestAccdbFK.java:25)
      1 frame