Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.ColumnMapRowMapper


    assertNull(eventData.get("description"));
    assertEquals(1L, eventData.get("memberGroup"));
  }
 
  private void assertVenueData(String name, String postalAddress, double latitude, double longitude, String locationHint, long createdBy) {
    Map<String, Object> eventVenueData = jdbcTemplate.queryForObject("select event, venue from EventVenue where event=?", new ColumnMapRowMapper(), 1);
    assertEquals(Long.valueOf(1), eventVenueData.get("event"));
    Long venueId = (Long) eventVenueData.get("venue");
    assertEquals(Long.valueOf(1), venueId);
   
    Map<String, Object> venueData = jdbcTemplate.queryForObject("select id, name, postalAddress, latitude, longitude, locationHint, createdBy from Venue where id=?", new ColumnMapRowMapper(), venueId);
    assertEquals(Long.valueOf(1), venueData.get("id"));
    assertEquals(name, venueData.get("name"));
    assertEquals(postalAddress, venueData.get("postalAddress"));
    assertEquals(latitude, venueData.get("latitude"));
    assertEquals(longitude, venueData.get("longitude"));
View Full Code Here


    assertEquals(locationHint, venueData.get("locationHint"));
    assertEquals(createdBy, venueData.get("createdBy"));
  }
 
  private void assertLeaderData(String name, String bio, String personalUrl, String twitterUsername) {
    Map<String, Object> externalLeaderData = jdbcTemplate.queryForObject("select leader, sourceId, source from ExternalLeader where source='NFJS' and sourceId=?", new ColumnMapRowMapper(), 38);
    Long leaderId = (Long) externalLeaderData.get("leader");
    assertEquals(Long.valueOf(15), leaderId);
    assertEquals(38L, externalLeaderData.get("sourceId"));
    assertEquals("NFJS", externalLeaderData.get("source"));
   
    Map<String, Object> leaderData = jdbcTemplate.queryForObject("select id, name, company, title, location, bio, personalUrl, companyUrl, twitterUsername, member from Leader where id=?", new ColumnMapRowMapper(), leaderId);
    assertEquals(leaderId, leaderData.get("id"));
    assertEquals(name, leaderData.get("name"));
    assertNull(leaderData.get("company"));
    assertNull(leaderData.get("title"));
    assertNull(leaderData.get("location"));
View Full Code Here

    assertEquals(twitterUsername, leaderData.get("twitterUsername"));
    assertNull(leaderData.get("member")); // TODO: Might want to figure out how to associate this with GH member table
  }
 
  private void assertEventTimeSlotData(long id, long eventId, String label, String startTime, String endTime) {
    Map<String, Object> externalEventTimeSlotData = jdbcTemplate.queryForObject("select timeSlot, sourceId, source from ExternalEventTimeSlot where timeSlot=?", new ColumnMapRowMapper(), id);
    assertEquals(id, externalEventTimeSlotData.get("timeSlot"));
    assertEquals(6311L, externalEventTimeSlotData.get("sourceId"));
    assertEquals("NFJS", externalEventTimeSlotData.get("source"));
   
    Map<String, Object> eventTimeSlotData = jdbcTemplate.queryForObject("select id, event, label, startTime, endTime from EventTimeSlot where id=?", new ColumnMapRowMapper(), 16);
    assertEquals(id, eventTimeSlotData.get("id"));
    assertEquals(eventId, eventTimeSlotData.get("event"));
    assertEquals(label, eventTimeSlotData.get("label"));
    assertEquals(startTime, eventTimeSlotData.get("startTime").toString());
    assertEquals(endTime, eventTimeSlotData.get("endTime").toString());
View Full Code Here

                    }
                    exchange.getIn().setHeader(SqlConstants.SQL_UPDATE_COUNT, total);
                } else {
                    boolean isResultSet = ps.execute();
                    if (isResultSet) {
                        RowMapperResultSetExtractor<Map<String, Object>> mapper = new RowMapperResultSetExtractor<Map<String, Object>>(new ColumnMapRowMapper());
                        List<Map<String, Object>> result = mapper.extractData(ps.getResultSet());
                        exchange.getOut().setBody(result);
                        exchange.getIn().setHeader(SqlConstants.SQL_ROW_COUNT, result.size());
                        // preserve headers
                        exchange.getOut().setHeaders(exchange.getIn().getHeaders());
View Full Code Here

                log.debug("Executing query: {}", preparedQuery);
                ResultSet rs = preparedStatement.executeQuery();
                try {
                    log.trace("Got result list from query: {}", rs);

                    RowMapperResultSetExtractor<Map<String, Object>> mapper = new RowMapperResultSetExtractor<Map<String, Object>>(new ColumnMapRowMapper());
                    List<Map<String, Object>> data = mapper.extractData(rs);

                    // create a list of exchange objects with the data
                    if (useIterator) {
                        for (Map<String, Object> item : data) {
View Full Code Here

  }

  @Override
  public SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta) {
    if (meta.getSqlType() == Types.OTHER && "refcursor".equals(meta.getTypeName())) {
      return new SqlOutParameter(parameterName, getRefCursorSqlType(), new ColumnMapRowMapper());
    }
    else {
      return super.createDefaultOutParameter(parameterName, meta);
    }
  }
View Full Code Here

    return queryForObject(sql, paramMap, new SingleColumnRowMapper<T>(requiredType));
  }

  @Override
  public Map<String, Object> queryForMap(String sql, SqlParameterSource paramSource) throws DataAccessException {
    return queryForObject(sql, paramSource, new ColumnMapRowMapper());
  }
View Full Code Here

    return queryForObject(sql, paramSource, new ColumnMapRowMapper());
  }

  @Override
  public Map<String, Object> queryForMap(String sql, Map<String, ?> paramMap) throws DataAccessException {
    return queryForObject(sql, paramMap, new ColumnMapRowMapper());
  }
View Full Code Here

  @Override
  public List<Map<String, Object>> queryForList(String sql, SqlParameterSource paramSource)
      throws DataAccessException {

    return query(sql, paramSource, new ColumnMapRowMapper());
  }
View Full Code Here

    return queryForObject(sql, paramMap, new SingleColumnRowMapper<T>(requiredType));
  }

  public Map<String, Object> queryForMap(String sql, SqlParameterSource paramSource) throws DataAccessException {
    return queryForObject(sql, paramSource, new ColumnMapRowMapper());
  }
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.ColumnMapRowMapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.