Skip to content
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

Closed
wants to merge 0 commits into from

Conversation

pariaSadatHosseiny
Copy link
Contributor

@pariaSadatHosseiny pariaSadatHosseiny commented Aug 20, 2024

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

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Aug 26, 2024

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: [0d0612d, 34fe1ff, 54bb343, a6a4070, 5dcdb9a, 4735fd5, afc753c]
❌ 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.

Copy link
Member

@gavinking gavinking left a 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?

@pariaSadatHosseiny pariaSadatHosseiny marked this pull request as ready for review September 6, 2024 16:17
Copy link
Member

@gavinking gavinking left a 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.

@pariaSadatHosseiny
Copy link
Contributor Author

Hi @gavinking,
thanks for the review. I've applied your suggestions as well. :)

@gavinking
Copy link
Member

Thanks.

Looks like there's a conflict. And also some weird history because I guess you merged main into your branch.

Could you:

  1. squash the change down to a single commit by doing a rebase or whatever, and
  2. fix the conflict.

Then I will merge it.

Thanks.

@pariaSadatHosseiny
Copy link
Contributor Author

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

@gavinking
Copy link
Member

No problem at all, stuff like this happens all the time.

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.

3 participants