Skip to content

HHH-19369 : Fix for Entity hierarchy ordering error within metamodel … #10043

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VladoKuruc
Copy link
Contributor

…building with enhancement

https://hibernate.atlassian.net/browse/HHH-19369


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.


@hibernate-github-bot
Copy link

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ The pull request title should not end with an ellipsis (make sure the title is complete)

› This message was automatically generated.

@scottmarlow
Copy link
Member

Thanks for mentioning this pull request in the https://hibernate.zulipchat.com/#narrow/channel/132094-hibernate-orm-dev/topic/Seeing.20EE.20TCK.20ClassCastException.20with.20ORM.206.2E6.2E13.2EFinal Zulip room. I will try this change locally as well to see if it helps me avoid the:
java.lang.ClassCastException: class com.sun.ts.tests.jpa.core.annotations.temporal.A_Property cannot be cast to class com.sun.ts.tests.jpa.core.annotations.temporal.A_Property (com.sun.ts.tests.jpa.core.annotations.temporal.A_Property is in unnamed module of loader 'deployment.jpa_core_annotations_temporal_vehicles.ear.jpa_core_annotations_temporal_puservlet_vehicle_web.war' @550228f3; com.sun.ts.tests.jpa.core.annotations.temporal.A_Property is in unnamed module of loader 'deployment.jpa_core_annotations_temporal_vehicles.ear' @72389008)

@dreab8
Copy link
Member

dreab8 commented Apr 22, 2025

Hi @VladoKuruc ,

Thanks for your PR, can you please add a test case in order to avoid future regressions?

Thanks

@VladoKuruc
Copy link
Contributor Author

Reproducing the error will not be straightforward for me. The model would need to contain at least 16 entities so that the HashMap (with its default capacity) gets rehashed, and even then, achieving the incorrect order isn't guaranteed. The entities must include some with an inheritance hierarchy, where, after the rehashing, at least one child entity incorrectly ends up positioned before its parent entity. In that specific case, the error appears.

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