Exemple #1
1
 public Set<Sport> getSports() {
   Set<Sport> sports = new HashSet<Sport>();
   for (SeasonalTeam st : getSeasonalTeams()) {
     Sport sport = Sport.getInstance(st);
     if (!ObjectUtils.isBlank(sport)) {
       sports.add(sport);
     }
   }
   return sports;
 }
Exemple #2
1
  public Long getEventsPlayedCount(Sport sport) {

    if (ObjectUtils.isBlank(sport)) {
      return null;
    }

    ObjectType seasonalAthleteType = ObjectType.getInstance(sport.getSeasonalAthleteClass());

    Query<SeasonalAthlete> seasonalAthleteQuery =
        Query.from(SeasonalAthlete.class)
            .where("typeId = ? && athlete = ?", seasonalAthleteType, this);
    return Query.from(Event.class).where("seasonalAthletes = ?", seasonalAthleteQuery).count();
  }
Exemple #3
0
  public List<SeasonalAthlete> findSeasonalAthletes(Sport sport) {

    if (ObjectUtils.isBlank(sport)) {
      return null;
    }

    ObjectType seasonalAthleteType = ObjectType.getInstance(sport.getSeasonalAthleteClass());

    return Query.from(SeasonalAthlete.class)
        .where("typeId = ? && athlete = ?", seasonalAthleteType, this)
        .selectAll();
  }