@Test public void findOne() { System.out.println(usersRepository.findOne(1L)); }
@Override public Optional<User> findOne(Long id) { return Optional.of(jdbcTemplate.queryForObject(SQL_SELECT_BY_ID, userRowMapper, id)); }
UsersRepositoryJdbcTemplateImpl implements UsersRepository { @Override public Optional<User> findOne(Long id) { return Optional.of(jdbcTemplate.queryForObject(SQL_SELECT_BY_ID, userRowMapper, id)); } }
UsersRepositoryJdbcTemplateImpl implements UsersRepository { @Override public Optional<User> findOne(Long id) { return Optional.of(jdbcTemplate.queryForObject(SQL_SELECT_BY_ID, userRowMapper, id)); } UsersRepositoryJdbcTemplateImpl(DataSource dataSource); }
UsersRepositoryJdbcTemplateImpl implements UsersRepository { @Override public Optional<User> findOne(Long id) { return Optional.of(jdbcTemplate.queryForObject(SQL_SELECT_BY_ID, userRowMapper, id)); } UsersRepositoryJdbcTemplateImpl(DataSource dataSource); @Override Optional<User> findOne(Long id); @Override void save(User model); @Override void delete(Long id); @Override List<User> findAll(); }
UsersRepositoryJdbcTemplateImpl implements UsersRepository { @Override public Optional<User> findOne(Long id) { return Optional.of(jdbcTemplate.queryForObject(SQL_SELECT_BY_ID, userRowMapper, id)); } UsersRepositoryJdbcTemplateImpl(DataSource dataSource); @Override Optional<User> findOne(Long id); @Override void save(User model); @Override void delete(Long id); @Override List<User> findAll();  }