How to I tell a Springdata-repository’s delete method to not throw an exception if an entity does not exists?
Updated Answer (after downvotes) My original answer (below) is actually wrong: my understanding of the question was influenced also by the missing reference to the EmptyResultDataAccessException in the official JavaDoc (as reported by Adrian Baker in his comment). So a better solution to this issue could be the one suggested by Yamashiro Rion if (repository.existsById(entityId)) … Read more