spring data jpa?
1. deleteById(id) from CrudRepository
2. delete by @ Query:
@ Modifying
@ Query("delete from table t where t.id= :id)
The first above way gives me this error:
Can not update or delete a parent row: a foreign key constraint fails
While the second way works fine.
This error means that there is some record which references the record you're trying to delete via foreign key. Show your entities
Обсуждают сегодня