leagueQuery.getEntity().setName(leagueCode);
League league = leagueDao.findUnique(leagueQuery);
if (league.getTeamsHistory() == null) {
league.setTeamsHistory(new ArrayList<LeagueTeamHistory>());
}
LeagueTeamHistory ltHistory = new LeagueTeamHistory();
ltHistory.setLeague(league);
ltHistory.setTeam(team);
ltHistory.setYear(year);
if (!league.getTeamsHistory().contains(ltHistory)) {
league.getTeamsHistory().add(ltHistory);
}
if (league.getVersion() == null) {
log.append("persist: " + league);