[OPENJPA-2992] Log the classes skipped for want of metadata - #175
Open
rzo1 wants to merge 1 commit into
Open
Conversation
A class listed in a persistence unit that resolves to no metadata is skipped rather than failing entity manager creation. That part is right and stays: Jakarta Persistence 3.2 chapter 8 says nothing about a listed class that is not a managed type, so the behaviour is provider defined, Hibernate and EclipseLink both skip, and the Jakarta Persistence TCK requires it, since its own persistence units list plain classes such as LineItemException alongside entities. No single TCK test demands it. What was wrong is that the skip was silent, so a forgotten @entity annotation or a missing orm.xml entry went unreported. Building the metamodel skipped without a word, and schema synchronization warned with a hardcoded English string. Both now log a message naming the class and what to check, and the reasoning is recorded next to the code rather than left to the commit log. The migration considerations are corrected as well: they claimed a warning on a log that does not carry one, and did not mention that with the default openjpa.RuntimeUnenhancedClasses=unsupported such a class is still rejected at start-up by the runtime enhancer.
solomax
approved these changes
Sep 3, 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.
To answer the review question: no single TCK test demands this, but the TCK's own persistence units list plain classes such as
LineItemExceptionalongside entities, so a provider that throws cannot create those EMFs. Jakarta Persistence 3.2 chapter 8 says nothing about a listed class that is not a managed type, so the behaviour is provider-defined, and Hibernate and EclipseLink both skip. The skip therefore stays.What was wrong is that it was silent, so a forgotten
@Entityannotation or a missingorm.xmlentry went unreported. Building the metamodel skipped without a word; schema synchronization warned with a hardcoded English string. Both now log a message naming the class and what to check, and the reasoning sits next to the code rather than only in the commit log.The migration considerations are corrected too: they claimed a warning on a log that does not carry one, and did not mention that with the default
openjpa.RuntimeUnenhancedClasses=unsupportedsuch a class is still rejected at start-up by the runtime enhancer.Note that the runtime-enhancer skip site is unreachable under that default, so no warning was added there; making that path report missing metadata rather than "runtime optimization disabled" would be a separate change.