[
https://issues.apache.org/jira/browse/OPENJPA-2992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18110808#comment-18110808
]
ASF subversion and git services commented on OPENJPA-2992:
----------------------------------------------------------
Commit 5d0162381aebeee02575ba6cf87fb897e8a2e170 in openjpa's branch
refs/heads/OPENJPA-2992 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=5d0162381 ]
[OPENJPA-2992] Log the classes skipped for want of metadata
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.
> Non-entity classes in persistence.xml silently skipped
> ------------------------------------------------------
>
> Key: OPENJPA-2992
> URL: https://issues.apache.org/jira/browse/OPENJPA-2992
> Project: OpenJPA
> Issue Type: Sub-task
> Components: jpa
> Affects Versions: 4.2.0
> Reporter: Maxim Solodovnik
> Priority: Major
> Fix For: 4.2.0
>
>
> Discussion thread:
> https://github.com/apache/openjpa/pull/144#discussion_r3683006891
> **(medium)** Inverted from "listing a non-persistent class in persistence.xml
> raises ArgumentException" to "non-entity classes are silently skipped".
> Silent skipping also hides real user errors (forgotten annotations, broken
> enhancement) that previously failed fast. Is this required by a specific TCK
> test? If so, could we at least keep a warning log and reference the TCK
> requirement in a comment?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)