gpt4 book ai didi

java - 使用 EJB3 时什么时候必须使实体可序列化?

转载 作者:行者123 更新时间:2023-11-30 05:01:50 25 4
gpt4 key购买 nike

我使用我的所有实体可序列化。不过我认为不用序列化就可以使用。

但是使实体可序列化有什么优点呢?我们什么时候真的必须序列化一个实体/什么时候不需要?

最佳答案

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

关于java - 使用 EJB3 时什么时候必须使实体可序列化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6405630/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com