Generated DDL changes

The DDL produced by the mapping tool, openjpa.jdbc.SynchronizeMappings and the new SchemaManager differs from previous releases:

  • jakarta.persistence.ForeignKey on @JoinColumn, @JoinTable and @SecondaryTable is now parsed. A named constraint (ConstraintMode.CONSTRAINT) is emitted as a physical foreign key even for relations that OpenJPA treats as logical; NO_CONSTRAINT suppresses the key; PROVIDER_DEFAULT keeps the 4.1.x behavior. Expect additional ALTER TABLE …​ ADD CONSTRAINT statements and a stricter drop order.

  • Every declared @SecondaryTable is created, even if no field is mapped to it.

  • The table-level comment is no longer emitted in CREATE TABLE (column comments remain).

  • @Index(columnList="col DESC") is honored, @JoinTable.indexes are created, @Table(options) and @Column(options) are appended verbatim, and @Column(secondPrecision) takes precedence over scale and the dictionary’s DateFractionDigits for temporal columns.

Compare generated DDL against existing schemas before enabling schema synchronization in production.