public boolean removeSorName(SorPerson sorPerson, Long nameId) { SorName name = sorPerson.findNameByNameId(nameId); if (name == null) return false; // remove name from the set (annotation in set to delete orphans) sorPerson.getNames().remove(name); // save changes this.personRepository.saveSorPerson(sorPerson); return true; }