我使用我的所有实体可序列化
。不过我认为不用序列化就可以使用。
但是使实体可序列化
有什么优点呢?我们什么时候真的必须序列化一个实体/什么时候不需要?
最佳答案
来自Java EE 6 Tutorial (引用 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.
...
关于java - 使用 EJB3 时什么时候必须使实体可序列化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6405630/