em.flush();
}
private void createAndPersisMeetings(List<Team> teams, List<Rider> riders) {
int homeIdx = RandomUtils.nextInt(teams.size());
Team homeTeam = teams.get(homeIdx);
int awayIdx;
while ((awayIdx = RandomUtils.nextInt(teams.size())) == homeIdx)
;
Team awayTeam = teams.get(awayIdx);
System.out.println("home team: " + homeTeam);
System.out.println("away team: " + awayTeam);
Event meeting = new Event();
meeting.setHomeTeam(homeTeam);