I use all of my entities Serializable
. However I think it is okay to use without serializable.
But what are the advantages of making an entity Serializable
?开发者_运维问答 When do we really have to serialize an entity / or when do not?
From the Java EE 6 Tutorial (which is quoting JSR-317 §2.1):
Requirements for Entity Classes
...
If an entity instance is passed by value as a detached object, such as through a session bean’s remote business interface, the class must implement theSerializable
interface.
...
精彩评论