-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HHH-18470: Duplicate foreign key names generated for inheritance type TABLE_PER_CLASS #8808
Conversation
hibernate-core/src/main/java/org/hibernate/mapping/DenormalizedTable.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/mapping/DenormalizedTable.java
Outdated
Show resolved
Hide resolved
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 › This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for the proposed fix, but there's no test. Would you please include a test for the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @pariaSadatHosseiny, this looks good to me.
I've left some very nitpicky suggestions, just for adherence to our coding conventions.
hibernate-core/src/main/java/org/hibernate/mapping/DenormalizedTable.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/mapping/DenormalizedTable.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/mapping/DenormalizedTable.java
Outdated
Show resolved
Hide resolved
Hi @gavinking, |
Thanks. Looks like there's a conflict. And also some weird history because I guess you merged Could you:
Then I will merge it. Thanks. |
33cda21
to
afca931
Compare
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 |
No problem at all, stuff like this happens all the time. |
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.
https://hibernate.atlassian.net/browse/HHH-18470