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 3 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
List of users who liked
00