Commit d3b7002
Fix Hibernate 7.4 dropping primary key on order_type_class_map join table
Hibernate 7.4 emits a unique constraint instead of a composite primary
key when a @jointable's explicit @UniqueConstraint covers exactly the
columns that would form the join table's primary key. OrderType was the
only @manytomany Set declaring such a redundant @UniqueConstraint, so its
order_type_class_map join table lost its primary key under hbm2ddl. This
broke the integration tests, whose dbUnit REFRESH operation needs a
primary key to update existing rows (NoPrimaryKeyException).
Remove the redundant @UniqueConstraint: the two FK columns are the natural
key of a Set join table, so hbm2ddl generates the composite primary key
again, matching the production schema that already defines it via
Liquibase. The annotation only affected hbm2ddl-generated DDL, so
production is unaffected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9282315 commit d3b7002
1 file changed
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
65 | | - | |
66 | | - | |
| 64 | + | |
67 | 65 | | |
68 | 66 | | |
69 | 67 | | |
| |||
0 commit comments