PersistentObjectException: detached entity passed to persist thrown by JPA and Hibernate

前端 未结 18 2660
醉酒成梦
醉酒成梦 2020-11-22 05:10

I have a JPA-persisted object model that contains a many-to-one relationship: an Account has many Transactions. A Transaction has one

18条回答
  •  不知归路
    2020-11-22 05:47

    Resolved by saving dependent object before the next.

    This was happened to me because I was not setting Id (which was not auto generated). and trying to save with relation @ManytoOne

提交回复
热议问题