-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-19861 Fix EntityNotFoundException when using targetAuditMode NOT_AUDITED on FK fields #11114
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
base: main
Are you sure you want to change the base?
Conversation
|
I also added tests to check that the |
f0bc636 to
726e004
Compare
726e004 to
195e15d
Compare
|
I migrated my test code to JUnit 5 😄 |
mbellade
left a comment
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 @Aftermoon-dev, left a couple comments but the overall idea looks fine. It's weird that this target audit mode is completely ignored apart from a single place in the code where we perform a check on the mapping's consistency.
...vers/src/main/java/org/hibernate/envers/internal/entities/mapper/relation/ToOneIdMapper.java
Outdated
Show resolved
Hide resolved
...ava/org/hibernate/envers/configuration/internal/metadata/ToOneRelationMetadataGenerator.java
Outdated
Show resolved
Hide resolved
5137727 to
2ebae6a
Compare
mbellade
left a comment
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.
Almost good @Aftermoon-dev, also please squash everything to 1-2 commits.
...vers/src/main/java/org/hibernate/envers/internal/entities/mapper/relation/ToOneIdMapper.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/hibernate/envers/internal/entities/mapper/relation/ToOneEntityLoader.java
Outdated
Show resolved
Hide resolved
...vers/src/main/java/org/hibernate/envers/internal/entities/mapper/relation/ToOneIdMapper.java
Outdated
Show resolved
Hide resolved
24a7525 to
f386db9
Compare
@mbellade Thank you for your review! I updated it and squash to 1 commit 😄 |
f386db9 to
47a9057
Compare
…AUDITED on FK fields
47a9057 to
64302d2
Compare
https://hibernate.atlassian.net/browse/HHH-19861
In
internal/entities/mapper/relation/ToOneEntityLoader.java->loadImmediatemethod checks@NotAuditedthroughenversService.getEntitiesConfigurations().getNotVersionEntityConfiguration( entityName ) == null, but if set@Audited (targetAuditMode = RelationshipTargetAuditMode.NOT_AUDITED)in FK, it seems that the reason is that it is not checked.I updated
loadImmediateMethod to check that part.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.