public void addTeamToLeague(Long teamId, Long leagueId) { final LeagueDao leagueDao = (LeagueDao) UnitOfWork.get().getDao(League.class); League league = leagueDao.find(leagueId); final TeamDao teamDao = (TeamDao) UnitOfWork.get().getDao(Team.class); Team team = teamDao.find(teamId); leagueDao.addToLeague(league, team); }
public static List<Team> getTeams(Club c, Season season) { TeamDao teamDao = (TeamDao) UnitOfWork.get().getDao(Team.class); return teamDao.findByClub(c, season); }
public static Integer getNumTeams(Club c, Season season) { TeamDao teamDao = (TeamDao) UnitOfWork.get().getDao(Team.class); return teamDao.countByClub(c, season); }