コード例 #1
0
  @Override
  public List<Event> getEventsByYear(int year) {
    JdbcTemplate select = new JdbcTemplate(dataSource);
    Date start = DateUtils.getStartOfYear(year);
    Date end = DateUtils.getEndOfYear(year);

    return select.query(
        "select event.id, event.title, event.description, event.island, event.location, event.content_source_id, event.url, event.start_datetime, event.end_datetime from event, content_source where start_datetime between ? and ? and event.content_source_id = content_source.id order by start_datetime desc",
        new Object[] {start, end},
        new EventRowMapper());
  }
コード例 #2
0
  @Override
  public List<Talk> getTalksByYear(int year) {
    JdbcTemplate select = new JdbcTemplate(dataSource);
    Date start = DateUtils.getStartOfYear(year);
    Date end = DateUtils.getEndOfYear(year);

    return select.query(
        "select id, name, description, type, event_name, city, country, content_source_id, url, talk_date, slides_url, video_url from talk where talk_date between ? and ? order by talk_date desc",
        new Object[] {start, end},
        new TalkRowMapper());
  }