SerializationException: could not deserialize.java.io.EOFException

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

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;

你可能感兴趣的:(SerializationException: could not deserialize.java.io.EOFException)