开发中的一些Exception

SerializationException: could no

2018-05-07  本文已影响0人  光影路西法

下午增加数据库字段的时候出现了这个问题:

org.springframework.orm.jpa.JpaSystemException: could not deserialize; nested exception is org.hibernate.type.SerializationException: could not deserialize
……
Caused by: org.hibernate.type.SerializationException: could not deserialize
……
Caused by: java.io.EOFException
……

原因:一些外键关联的字段注解写错了。

@Column(name = "mch_id")
private Mch mch;

修改为:

    @JoinColumn(name = "mch_id", referencedColumnName = "id", nullable = false, updatable=false)
    @ManyToOne(optional = false, targetEntity = Mch.class)
    private Mch mch;
上一篇 下一篇

猜你喜欢

热点阅读