@Test public void getViewSpaces(){ List<ViewSpace> viewSpaces = viewSpaceDao.getViewSpaces(1,10000); assertNotNull(viewSpaces); for(ViewSpace viewSpace:viewSpaces){ assertNotNull(viewSpace); } }
public List<ViewSpace> getViewSpaces(final int fromId, final int toId) { String sql = "SELECT space_id, SPACE_NAME,description,address FROM t_view_space WHERE space_id between ? and ?"; return jdbcTemplate.query(sql, new Object[] { fromId, toId }, new RowMapper<ViewSpace>() { public ViewSpace mapRow(ResultSet rs, int index) throws SQLException { ViewSpace viewSpace = new ViewSpace(); viewSpace.setSpaceId(rs.getInt("space_id")); viewSpace.setSpaceName(rs.getString("space_name")); viewSpace.setDescription(rs.getString("description")); viewSpace.setAddress(rs.getString("address")); return viewSpace; } }); }
ViewSpaceDao { public List<ViewSpace> getViewSpaces(final int fromId, final int toId) { String sql = "SELECT space_id, SPACE_NAME,description,address FROM t_view_space WHERE space_id between ? and ?"; return jdbcTemplate.query(sql, new Object[] { fromId, toId }, new RowMapper<ViewSpace>() { public ViewSpace mapRow(ResultSet rs, int index) throws SQLException { ViewSpace viewSpace = new ViewSpace(); viewSpace.setSpaceId(rs.getInt("space_id")); viewSpace.setSpaceName(rs.getString("space_name")); viewSpace.setDescription(rs.getString("description")); viewSpace.setAddress(rs.getString("address")); return viewSpace; } }); } }
ViewSpaceDao { public List<ViewSpace> getViewSpaces(final int fromId, final int toId) { String sql = "SELECT space_id, SPACE_NAME,description,address FROM t_view_space WHERE space_id between ? and ?"; return jdbcTemplate.query(sql, new Object[] { fromId, toId }, new RowMapper<ViewSpace>() { public ViewSpace mapRow(ResultSet rs, int index) throws SQLException { ViewSpace viewSpace = new ViewSpace(); viewSpace.setSpaceId(rs.getInt("space_id")); viewSpace.setSpaceName(rs.getString("space_name")); viewSpace.setDescription(rs.getString("description")); viewSpace.setAddress(rs.getString("address")); return viewSpace; } }); }  }
ViewSpaceDao { public List<ViewSpace> getViewSpaces(final int fromId, final int toId) { String sql = "SELECT space_id, SPACE_NAME,description,address FROM t_view_space WHERE space_id between ? and ?"; return jdbcTemplate.query(sql, new Object[] { fromId, toId }, new RowMapper<ViewSpace>() { public ViewSpace mapRow(ResultSet rs, int index) throws SQLException { ViewSpace viewSpace = new ViewSpace(); viewSpace.setSpaceId(rs.getInt("space_id")); viewSpace.setSpaceName(rs.getString("space_name")); viewSpace.setDescription(rs.getString("description")); viewSpace.setAddress(rs.getString("address")); return viewSpace; } }); }  void initDb(); void addViewSpace(final ViewSpace viewSpace); void addViewSpaceByNamedParams(final ViewSpace viewSpace); void addViewSpaces(final List<ViewSpace> viewSpaces); ViewSpace getViewSpace(final int spaceId); List<ViewSpace> getViewSpaces(final int fromId, final int toId); }
ViewSpaceDao { public List<ViewSpace> getViewSpaces(final int fromId, final int toId) { String sql = "SELECT space_id, SPACE_NAME,description,address FROM t_view_space WHERE space_id between ? and ?"; return jdbcTemplate.query(sql, new Object[] { fromId, toId }, new RowMapper<ViewSpace>() { public ViewSpace mapRow(ResultSet rs, int index) throws SQLException { ViewSpace viewSpace = new ViewSpace(); viewSpace.setSpaceId(rs.getInt("space_id")); viewSpace.setSpaceName(rs.getString("space_name")); viewSpace.setDescription(rs.getString("description")); viewSpace.setAddress(rs.getString("address")); return viewSpace; } }); }  void initDb(); void addViewSpace(final ViewSpace viewSpace); void addViewSpaceByNamedParams(final ViewSpace viewSpace); void addViewSpaces(final List<ViewSpace> viewSpaces); ViewSpace getViewSpace(final int spaceId); List<ViewSpace> getViewSpaces(final int fromId, final int toId);  }