Pat*_*čin 6 java serialization transient throwable runtimeexception
假设我有我的 custom RuntimeException,MyEntityJPA在哪里@Entity:
@Getter
public class MyEntityAlreadyExistingException extends RuntimeException {
private final MyEntity myEntity;
public MyEntityAlreadyExistingException(MyEntity myEntity) {
super(MessageFormat.format("MyEntity with name \"{0}\" already exists", myEntity.getName()));
this.myEntity = myEntity;
}
}
Run Code Online (Sandbox Code Playgroud)
声纳提示我进行myEntity瞬态或可序列化。
我应该如何处理这种情况?
我不使用任何 RMI,也不使用任何远程处理。它是一个相对简单的 Spring Boot Web 应用程序,带有 JPA。
如果我可以myEntity序列化,我以后可以利用哪些优势?
| 归档时间: |
|
| 查看次数: |
792 次 |
| 最近记录: |