コード例 #1
0
 @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;
 }
コード例 #3
0
 public boolean hasContestInGroup(final OutboundMobilityCandidacyContestGroup mobilityGroup) {
   for (final OutboundMobilityCandidacy candidacy : getOutboundMobilityCandidacySet()) {
     final OutboundMobilityCandidacyContest contest =
         candidacy.getOutboundMobilityCandidacyContest();
     if (contest.getOutboundMobilityCandidacyContestGroup() == mobilityGroup) {
       return true;
     }
   }
   return false;
 }
コード例 #4
0
 public void select() {
   if (!hasSelectedCandidacy()) {
     for (final OutboundMobilityCandidacy candidacy : getSortedOutboundMobilityCandidacySet()) {
       if (candidacy.getOutboundMobilityCandidacyContest().hasVacancy()) {
         candidacy.select();
         return;
       }
     }
   }
 }
コード例 #5
0
 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();
 }