Skip to content

[OPENJPA-2994] Add compatibility option for the default map key column name - #197

Open
rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2994
Open

rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2994

Conversation

@rzo1

@rzo1 rzo1 commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

The spec default for a map key column (<field>_KEY, section 11.1.35) silently changes DDL against schemas created by earlier releases, where the column was KEY/KEY0. The derivation now goes through one helper gated by the new UseSpecDefaultMapKeyColumnName option, which defaults to the spec name and can be turned off so upgrades keep working; an explicit @MapKeyColumn is unaffected either way. TestContainerSpecCompatibilityOptions covers both defaults, and the migration guide and mapping overview document the option.

…n name

Section 11.1.35 requires the default map key column to be named
<field>_KEY, which does not match schemas created by earlier releases
(where the default was "key", usually materialized as "KEY0").

Gate the default name derivation behind the new compatibility option
UseSpecDefaultMapKeyColumnName. It defaults to true, so the spec name
is used out of the box; setting it to false restores the old default.
An explicit @MapKeyColumn is unaffected either way.
@rzo1 rzo1 self-assigned this Sep 26, 2026
@rzo1
rzo1 requested review from cristof and solomax September 26, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant