@Override public Match mapRow(ResultSet rs, int rowNum) throws SQLException { Match match = new Match(); match.setMatchId(rs.getInt("MATCH_ID")); match.setLeagueName(rs.getString("LEAGUE_NAME").trim()); match.setLeagueId(rs.getInt("LEAGUE_ID")); match.setHomeTeamName(rs.getString("HOME_TEAM_NAME").trim()); match.setAwayTeamName(rs.getString("AWAY_TEAM_NAME").trim()); match.setHomeScore(rs.getInt("HOME_SCORE")); match.setAwayScore(rs.getInt("AWAY_SCORE")); match.setHomeTeamId(rs.getInt("HOME_TEAM_ID")); match.setAwayTeamId(rs.getInt("AWAY_TEAM_ID")); match.setFeedTypeId(rs.getInt("FEED_TYPE_ID")); match.setMatchTime(rs.getString("MATCH_TIME").trim()); match.setRunningIndicator(rs.getInt("RUNNING_INDICATOR")); match.setTimeGameLive(rs.getString("TIME_GAME_LIVE").trim()); match.setKoAwayPrice(rs.getDouble("KICK_OFF_AWAY_PRICE")); match.setKoDrawPrice(rs.getDouble("KICK_OFF_DRAW_PRICE")); match.setKoHomePrice(rs.getDouble("KICK_OFF_HOME_PRICE")); match.setKoOuHfPrice(rs.getDouble("KICK_OFF_OU_HF_PRICE")); match.setTimeFirstGoal(rs.getInt("TIME_FIRST_GOAL")); match.setMatchDate(new DateTime(rs.getDate("MATCH_DATE"))); match.setBookieId(rs.getInt("BOOKIE_ID")); return match; }
@Override public Object extractData(ResultSet rs) throws SQLException, DataAccessException { Map<String, Match> matches = new HashMap<String, Match>(); Match match = null; String key = null; while (rs.next()) { match = new Match(); match.setMatchId(rs.getInt("MATCH_ID")); match.setLeagueName(rs.getString("LEAGUE_NAME").trim()); match.setLeagueId(rs.getInt("LEAGUE_ID")); match.setHomeTeamName(rs.getString("HOME_TEAM_NAME").trim()); match.setAwayTeamName(rs.getString("AWAY_TEAM_NAME").trim()); match.setHomeScore(rs.getInt("HOME_SCORE")); match.setAwayScore(rs.getInt("AWAY_SCORE")); match.setHomeTeamId(rs.getInt("HOME_TEAM_ID")); match.setAwayTeamId(rs.getInt("AWAY_TEAM_ID")); match.setFeedTypeId(rs.getInt("FEED_TYPE_ID")); match.setMatchTime(rs.getString("MATCH_TIME").trim()); match.setRunningIndicator(rs.getInt("RUNNING_INDICATOR")); match.setTimeGameLive(rs.getString("TIME_GAME_LIVE").trim()); match.setKoAwayPrice(rs.getDouble("KICK_OFF_AWAY_PRICE")); match.setKoDrawPrice(rs.getDouble("KICK_OFF_DRAW_PRICE")); match.setKoHomePrice(rs.getDouble("KICK_OFF_HOME_PRICE")); match.setKoOuHfPrice(rs.getDouble("KICK_OFF_OU_HF_PRICE")); match.setTimeFirstGoal(rs.getInt("TIME_FIRST_GOAL")); match.setMatchDate(new DateTime(rs.getDate("MATCH_DATE"))); match.setBookieId(rs.getInt("BOOKIE_ID")); key = String.valueOf(match.getMatchId()) + "|" + rs.getString("NAME").trim(); matches.put(key, match); } return matches; }