I try to use it to insert data, but while enforcing is turned on, I can' t insert null to a FK field.
Table A:
ID - numeric filed
Table B:
ID - numeric field
FK - numeric field, connected to A.ID
Error:
Exception in thread "main" 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)
at com.mdbtest.TestAccdbFK.main(TestAccdbFK.java:35)
Caused by: 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(FKEnforcer.java:224)
at com.healthmarketscience.jackcess.impl.FKEnforcer.addRow(FKEnforcer.java:132)
at com.healthmarketscience.jackcess.impl.TableImpl.addRows(TableImpl.java:1595)
at com.healthmarketscience.jackcess.impl.TableImpl.addRow(TableImpl.java:1462)
at com.mdbtest.TestAccdbFK.main(TestAccdbFK.java:25)
Fixed in trunk, will be in the 2.1.4 release.