Получение исключения "org.hibernate.type.SerializationException: не удалось десериализовать" после удаления двунаправленного отображения из сущности в hibernate

Я получаю исключение ниже, в то время как я удаляю сопоставление ManyToOne из модели клиента ниже, объекты, которые я

Приложение Entity выглядит так:

@Entity
@NamedQuery(name = "Application.findAll", query = "SELECT a FROM Application a")
public class Application implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @SequenceGenerator(name = "APPLICATION_ID_GENERATOR", sequenceName = "OLO_ID_SEQUENCE")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "APPLICATION_ID_GENERATOR")
    private long id;

    // bi-directional many-to-one association to User
    @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    @JoinColumn(name = "ID_USER")
    private User user;

    // bi-directional many-to-one association to ClientData
    @OneToMany(mappedBy = "application", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    private Set<ClientData> clientData;
    .
    .
    .

Клиентский объект выглядит так:

@Entity
@Table(name = "CLIENT_DATA")
@NamedQuery(name = "ClientData.findAll", query = "SELECT c FROM ClientData c")
@JsonInclude(Include.NON_NULL)
public class ClientData implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @SequenceGenerator(name = "CLIENT_DATA_ID_GENERATOR", sequenceName = "OLO_ID_SEQUENCE")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CLIENT_DATA_ID_GENERATOR")
    private long id;

    @Temporal(TemporalType.DATE)
    @Column(name = "BIRTH_DATE")
    private Date birthDate;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "CREATION_DATE")
    private Date creationDate;

    @Column(name = "GENDER")
    private String gender;

    @Column(name = "NAME1")
    private String name1;


    // bi-directional many-to-one association to Application
    /*@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ID_APPLICATION")
    @JsonIgnore*/
    @Column(name="ID_APPLICATION")  
    private Application application;

Я прокомментировал сопоставление "многие к одному" из данных клиента и попыток получить приложение. но получаю ошибку ниже.

 Request processing failed; nested exception is org.hibernate.type.SerializationException: could not deserialize] with root cause
    java.io.EOFException
        at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2638)
        at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3113)
        at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:854)
        at java.io.ObjectInputStream.<init>(ObjectInputStream.java:349)
        at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:328)
        at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:318)
        at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:237)
        at org.hibernate.internal.util.SerializationHelper.deserialize(SerializationHelper.java:306)
        at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:155)
        at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:130)
        at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:44)
        at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDes

0 ответов

Другие вопросы по тегам