cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Durchholz, Joachim" <>
Subject RE: Serialization warnings
Date Fri, 15 Jun 2012 08:57:51 GMT
I'm reading that the deserialization mechanism takes the serialVersionUID of all superclasses
into account.
So yes the serialVersionUID needs to be set on each class, and subclasses can retain their
serialVersionUID even if the superclass' serialVersionUID changes.
Also, if a class does not have any serializable fields, it can simply have a fixed serialVersionUID
that never changes, say, 1L (that's the common way to say "this class does not have anything
serializable", or "this class will never change", or "I'm taking responsibility for manually
bumping up the servialVersionUID whenever a serialization-relevant change happens").

That's what I gather from reading various sources in the web.
I'm not seeing any official mention of the issue, unfortunately.
I guess this means reading the source, and/or testing with as many JDKs as humanly possible.

View raw message