A collection with cascade=“all-delete-orphan” was no longer referenced by the owning entity instance

后端 未结 5 1217
终归单人心
终归单人心 2021-02-01 07:26

In my application, a hibernate operation goes like this. The application updates a parent entity with new values from the request and deletes all the existing (previously insert

5条回答
  •  说谎
    说谎 (楼主)
    2021-02-01 08:26

    it change works !

    @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
    @JoinColumn(name = "user_id")
    private List roles;
    

提交回复
热议问题