I\'m am currently trying to use a Spring Data repository to delete some of my entities. The delete call works without any exceptions/error messages, but the entity is not delete
The problem seems to be that you are using cascade=CascadeType.ALL
, which also includes CascadeType.PERSIST
. CascadeType.PERSIST
means that the child entity is completely managed by the parent and you cannot delete it directly. In order to delete you just need to remove it from the parent.
You could just add the other CascadeTypes
instead of all. e.g CascadeType.REMOVE
, if the only thing you would want is to remove the child if the parent is removed.