LoginSignup
0
0

More than 3 years have passed since last update.

JPAのOneToManyのdeleteがupdateになる

Posted at

JPAのOneToManyのコレクションを削除をする場合、CascadeType.REMOVEorphanRemoval = trueを使用する。このとき、発行されるSQLはdeleteを期待するがupdateになってしまった。これの原因はエンティティ間の定義(OneToManyとかJoinColumn)がおかしい場合になるらしい。具体例を出せなくてアレだが https://stackoverflow.com/questions/17079649/jpa-orphanremoval-true-tries-to-update-not-delete とかが参考例になる、と思う。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0