开发者

When do I have to make entities serializable when using EJB3?

开发者 https://www.devze.com 2023-03-13 20:52 出处:网络
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

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 the Serializable interface.
...

0

精彩评论

暂无评论...
验证码 换一张
取 消