Skip to content

[OPENJPA-2992] Log the classes skipped for want of metadata - #175

Open
rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2992
Open

[OPENJPA-2992] Log the classes skipped for want of metadata#175
rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2992

Conversation

@rzo1

@rzo1 rzo1 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

To answer the review question: no single TCK test demands this, but the TCK's own persistence units list plain classes such as LineItemException alongside 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 @Entity annotation or a missing orm.xml entry 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=unsupported such 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.

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.
@rzo1 rzo1 self-assigned this Sep 2, 2026
@rzo1
rzo1 requested review from cristof and solomax September 2, 2026 18:09
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.

2 participants