[
https://issues.apache.org/jira/browse/OPENJPA-2994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18119521#comment-18119521
]
Richard Zowalla commented on OPENJPA-2994:
------------------------------------------
Agreed that this needs a compatibility option rather than only a migration
note. The new default is specification correct (section 11.1.35: field name +
_KEY), but it silently changes DDL and SQL against schemas created by earlier
OpenJPA releases: schema validation fails, SynchronizeMappings=buildSchema adds
a new column, and existing key data reads back as null.
Proposal: add a Compatibility option (in the spirit of the options covered by
TestContainerSpecCompatibilityOptions), defaulting to the specification
behaviour so new applications are correct out of the box, and allowing the
legacy KEY/KEY0 default to be restored for upgrades. The migration guide
section jpa_4.2_MapKeyColumn currently states "No compatibility option restores
the old default" and would be updated to document the new option.
> Map-key column default KEY0 to entityCs_KEY breaks upgrades
> -----------------------------------------------------------
>
> Key: OPENJPA-2994
> URL: https://issues.apache.org/jira/browse/OPENJPA-2994
> Project: OpenJPA
> Issue Type: Sub-task
> Components: jpa
> Affects Versions: 4.2.0
> Reporter: Maxim Solodovnik
> Priority: Major
> Fix For: 4.2.0
>
>
> Discussion thread:
> https://github.com/apache/openjpa/pull/144#discussion_r3683007155
> **(medium)** Changing the expected default map-key column from KEY/KEY0 to
> entityCs_KEY (also TestContainerSpecCompatibilityOptions.java:426 and the
> KEY0 -> photos_KEY expected SQL in TestTypesafeCriteria) is spec-correct, but
> silently changes DDL/SQL against existing schemas created by older OpenJPA
> versions - upgrades will not find the KEY0 column. Should this be gated
> behind a compatibility option (this test class exists exactly for that) and
> called out in migration notes?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)