Check if object is referenced to prevent soft-deleting without modifying database
问题 As you can see I am using soft/logical deletion on my system: My entities: @Where(clause = "deleted='false'") public class Person { //... } My services: @Override public ServiceResponse DeletePerson (Person entity) { ServiceResponse sr = new ServiceResponse<>(); try { sr = ValidateDeletePerson(entity); //Business logic treatment if (sr.hasError()) return sr; Person dbEntity = GetPerson(entity.getPersonID()); dbEntity.setDeleted(true); _repository.save(dbEntity); } catch (Exception ex) { sr