Error: detached entity passed to persist - try to persist complex data (Play-Framework)

后端 未结 4 1800
无人共我
无人共我 2021-02-04 12:57

I have a problem with persisting data via play-framework. Maybe it\'s not possible to achive that result, but it would be really nice if it would work.

Simple

4条回答
  •  半阙折子戏
    2021-02-04 13:37

    Not sure this is the answer, because I don't know about Play, but the Shop-Address bidirectional association is not correct: The shop side must be marked as the inverse of the other side, using @OneToMany(mappedBy="shop", ...).

    Also, if save and merge corrspond to Session.save and Session.merge respectively, doing a save after a merge makes no sense. Save is used to insert a new, transient entity into the session. If merge has been called, it's already persistent at the time save is called.

提交回复
热议问题