Generated DDL changes
The DDL produced by the mapping tool, openjpa.jdbc.SynchronizeMappings and the new SchemaManager differs from previous releases:
-
jakarta.persistence.ForeignKeyon@JoinColumn,@JoinTableand@SecondaryTableis now parsed. A named constraint (ConstraintMode.CONSTRAINT) is emitted as a physical foreign key even for relations that OpenJPA treats as logical;NO_CONSTRAINTsuppresses the key;PROVIDER_DEFAULTkeeps the 4.1.x behavior. Expect additionalALTER TABLE … ADD CONSTRAINTstatements and a stricter drop order. -
Every declared
@SecondaryTableis 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.indexesare created,@Table(options)and@Column(options)are appended verbatim, and@Column(secondPrecision)takes precedence overscaleand the dictionary’sDateFractionDigitsfor temporal columns.
Compare generated DDL against existing schemas before enabling schema synchronization in production.