/** Removes all references to result. */ private void removeAssociations() { super.setCountry(null); removeCreator(); for (; !getAllResultDocumentFiles().isEmpty(); getAllResultDocumentFiles().get(0).delete()) {} for (; !getPrizes().isEmpty(); getPrizes().get(0).delete()) {} for (; !getResultUnitAssociations().isEmpty(); getResultUnitAssociations().get(0).delete()) {} for (; !getResultTeachers().isEmpty(); getResultTeachers().get(0).delete()) {} // These should be the last to remove, because of access control // verifications. for (; !getResultParticipations().isEmpty(); getResultParticipations().get(0).delete()) {} }