Hibernate - clearing a collection with all-delete-orphan and then adding to it causes ConstraintViolationException

后端 未结 4 2036
独厮守ぢ
独厮守ぢ 2021-02-19 14:19

I have these entities

class Foo{
    Set bars;
}

class Bar{
    Foo parent;
    String localIdentifier;
}

With this mapping (sorry,

4条回答
  •  礼貌的吻别
    2021-02-19 14:28

    If you are using oracle, you could also use deferrable constraints to postpone the checking of the constraints until the transaction is committed. Not sure if/how this is supported by other databases.

提交回复
热议问题