Synchronization error when insertable = false in EclipseLink

倖福魔咒の 提交于 2019-12-13 03:36:46

问题


This my entity

@Entity
public class Order {

    ...
    @OneToMany (fetch = FetchType.LAZY)
    @JoinColumn(name="order_uuid", insertable = false, updatable = false)
    private List<Item> items;
}

When I create new Oder and save it in DB I get:

Caused by: java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: com.temp.Item@3cd8c5f.

Could anyone explain the reason of this error (I did add insertable = false) and how to fix it (I don't want to create new items when I create order)?

来源:https://stackoverflow.com/questions/56543710/synchronization-error-when-insertable-false-in-eclipselink

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!