@Atomic public void apply(final OutboundMobilityCandidacyContest contest) { for (final OutboundMobilityCandidacy candidacy : getOutboundMobilityCandidacySet()) { if (candidacy.getOutboundMobilityCandidacyContest() == contest) { return; } } new OutboundMobilityCandidacy(contest, this); }
public int countSelectedCandidates() { int c = 0; for (OutboundMobilityCandidacy candidacy : getOutboundMobilityCandidacySet()) { if (candidacy.getSubmissionFromSelectedCandidacy() != null) { c++; } } return c; }
public boolean hasContestInGroup(final OutboundMobilityCandidacyContestGroup mobilityGroup) { for (final OutboundMobilityCandidacy candidacy : getOutboundMobilityCandidacySet()) { final OutboundMobilityCandidacyContest contest = candidacy.getOutboundMobilityCandidacyContest(); if (contest.getOutboundMobilityCandidacyContestGroup() == mobilityGroup) { return true; } } return false; }
public void select() { if (!hasSelectedCandidacy()) { for (final OutboundMobilityCandidacy candidacy : getSortedOutboundMobilityCandidacySet()) { if (candidacy.getOutboundMobilityCandidacyContest().hasVacancy()) { candidacy.select(); return; } } } }
public SortedSet<OutboundMobilityCandidacyContestGroup> getOutboundMobilityCandidacyContestGroupSet() { final SortedSet<OutboundMobilityCandidacyContestGroup> result = new TreeSet<OutboundMobilityCandidacyContestGroup>(); for (final OutboundMobilityCandidacy candidacy : getOutboundMobilityCandidacySet()) { final OutboundMobilityCandidacyContest contest = candidacy.getOutboundMobilityCandidacyContest(); result.add(contest.getOutboundMobilityCandidacyContestGroup()); } return result; }
public boolean hasCandidacy(final Student student) { for (final Registration registration : student.getRegistrationsSet()) { for (final OutboundMobilityCandidacySubmission submission : registration.getOutboundMobilityCandidacySubmissionSet()) { for (final OutboundMobilityCandidacy candidacy : submission.getOutboundMobilityCandidacySet()) { if (candidacy.getOutboundMobilityCandidacyContest() == this) { return true; } } } } return false; }
@Atomic public void delete() { final OutboundMobilityCandidacyContestGroup mobilityGroup = getOutboundMobilityCandidacyContestGroup(); for (final OutboundMobilityCandidacy candidacy : getOutboundMobilityCandidacySet()) { candidacy.deleteWithNotification(); } getExecutionDegreeSet().clear(); setMobilityAgreement(null); setOutboundMobilityCandidacyContestGroup(null); setOutboundMobilityCandidacyPeriod(null); setRootDomainObject(null); if (mobilityGroup != null && mobilityGroup.getOutboundMobilityCandidacyContestSet().size() == 0) { mobilityGroup.delete(); } deleteDomainObject(); }