JPAのOneToManyのコレクションを削除をする場合、CascadeType.REMOVEやorphanRemoval = trueを使用する。このとき、発行されるSQLはdeleteを期待するがupdateになってしまった。これの原因はエンティティ間の定義(OneToManyとかJoinColumn)がおかしい場合になるらしい。具体例を出せなくてアレだが https://stackoverflow.com/questions/17079649/jpa-orphanremoval-true-tries-to-update-not-delete とかが参考例になる、と思う。
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme