[ 
https://issues.apache.org/jira/browse/OPENJPA-2984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18111057#comment-18111057
 ] 

ASF subversion and git services commented on OPENJPA-2984:
----------------------------------------------------------

Commit 8015d5f61271014cecc9e2085f9106f30fa4832d in openjpa's branch 
refs/heads/master from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=8015d5f61 ]

[OPENJPA-2984] Record why an id class is no longer checked for Serializable

The check was not lost in the rewrite. Jakarta Persistence 3.2 section
2.4.1 dropped both the public and the Serializable requirement for a
primary key class, and bf3d2b1d9 removed the warning deliberately: the same
commit deleted the message key, relaxed the matching public-ness rules in
the kernel and added a test with a package private, non-serializable id
class. Restoring the warning would fire against metadata the specification
allows, including that test's own entity.

What was missing is the reason, so both parsers now carry it where the
check used to be, along with the consequence that does survive: a
non-serializable id class cannot be used where OpenJPA serializes the
identity object it wraps, which detached entities, remote commit events and
a distributed data cache do.

The manual still listed the pre-3.2 rules; its identity class criteria are
corrected. Note that the constructor requirement is only that one without
arguments exists, of any visibility, since validateAppIdClassMethods uses
getDeclaredConstructor().


> Dropped non-Serializable IdClass warning
> ----------------------------------------
>
>                 Key: OPENJPA-2984
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2984
>             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_r3683005700
> **(low)** The "IdClass does not implement Serializable" warning was silently 
> dropped both here and in AnnotationPersistenceMetaDataParser. Deliberate (3.2 
> relaxes it?) or lost in the rewrite?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to