hibernate-orm
hibernate-orm copied to clipboard
HHH-18470: Duplicate foreign key names generated for inheritance type TABLE_PER_CLASS
HHH-18470: Duplicate foreign key names generated for inheritance type TABLE_PER_CLASS
The problem was in DenormalizedTable#createForeignKeys where the includedTable.foreignKey is also used as subclass Foreignkey, and Foreignkey.name is considered as UserProvidedIdentifier. That’s why calling determineForeignKeyName returns the same FK name for the subclasses in Table_Per_Class strategy.
If I'm right, the DenormalizedTable is just used for subclasses of a Table_Per_Class, then the following PR may fix the issue.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion. For more information on licensing, please check here.
Thanks for your pull request!
This pull request does not follow the contribution rules. Could you have a look?
❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
↳ Offending commits: [0d0612dba92cad67fb2f329bff4b5d3feea59647, 34fe1ff9feeb6b82464b37323948bf95de4cf1fc, 54bb343e525aad90c529f550bcb4b3c21460303f, a6a4070df1fb3323b39ebe5ac6167f463d6acf7b, 5dcdb9a0e1834f0f931fe46a1a21eea148367aaf, 4735fd50f6c91d4e941a4d7774ba8414e7103995, afc753c13bf3ed19ce1ac2a6fe6ec6f039f71a24]
❌ The PR title or body should list the keys of all JIRA issues mentioned in the commits
↳ Issue keys mentioned in commits but missing from the PR title or body: [HHH-18506, HHH-18505, HHH-18358, HHH-18512, HHH-18158, HHH-18517]
› This message was automatically generated.
Hi @gavinking, thanks for the review. I've applied your suggestions as well. :)
Thanks.
Looks like there's a conflict. And also some weird history because I guess you merged main into your branch.
Could you:
- squash the change down to a single commit by doing a rebase or whatever, and
- fix the conflict.
Then I will merge it.
Thanks.
Hi @gavinking,
I tried to reset the branch to the starting point to prevent "Contribution — JIRA issues" job to fail, but unfortunately, GitHub automatically closed the PR and I could not open it again.
I created a new PR:8900 containing the same changes and with a clean commit history.
Sorry for the confusion Best Paria
No problem at all, stuff like this happens all the time.