[OPENJPA-2957] Resolve embeddables through the metadata repository instead of annotation names - #159
Open
rzo1 wants to merge 1 commit into
Open
[OPENJPA-2957] Resolve embeddables through the metadata repository instead of annotation names#159rzo1 wants to merge 1 commit into
rzo1 wants to merge 1 commit into
Conversation
…stead of annotation names
cristof
approved these changes
Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the simple-name annotation scan in
AbstractExpressionBuilder.hasEmbeddableAnnotationwith a repository lookup, as suggested in https://issues.apache.org/jira/browse/OPENJPA-2957.ClassMetaData.isEmbeddable()is set by both the annotation and the XML parser, so it also covers embeddables declared only inorm.xmland no longer matches any annotation that happens to be calledEmbeddable.Note that
fmd.getEmbeddedMetaData()cannot be used directly here: the guard is only reached when that call already returnednull, so the check has to ask about the declared type instead. This is a robustness fix rather than a behavioural one — I could not construct a case where the old check produced a wrong answer, since the branch is only reachable for an@EmbeddedIdfield whose embedded metadata is absent.openjpa.persistence.embed.**(89 tests, including the XML-mapped ones) and theTestDerivedIdEx2b/TestUnenhancedDerivedIdEx2bregression tests for the original 2.4.1.3 ex2b fix are green.