persistence@glassfish.java.net

Re: Does "The primary key class must be serializable" mean that "The primary key class must implement java.io.Serializable"?

From: Mitesh Meswani <Mitesh.Meswani_at_Sun.COM>
Date: Fri, 25 Apr 2008 11:28:49 -0700

Hi Markus,

The spec is not very crisp here. But, I would vote to read it as your
later interpretation.

Thanks,
Mitesh

Markus KARG wrote:
> I have a question how to interprete the EJB 3.0 Persistence
> Specification:
>
> Chapter 2.1.4 "Primary Keys and Entity Identity" says: "The primary
> key class must be serializable". Does that mean that it must implement
> the Serializable interface, or is it enough to "just" take care that
> somebody will be able to serialize and deserialize that class? With
> other words, can a user rely on the fact that every primary key will
> implement the Serializable interface, or can he "only" rely on the
> fact that the primary key physically is serializable / deserializable?
>
> Thanks
> Markus
>