Skip to content

Conversation

@dayaelee
Copy link
Member

No description provided.

Copy link
Member

@yohanii yohanii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

깔끔하게 잘 푸신 것 같습니다! 👍

Copy link

@KimGyeongLock KimGyeongLock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

//TODO : 주어진 Id에 해당하는 customer를 객체로 반환
return null;

Customer customers = jdbcTemplate.queryForObject(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

queryForObject 함수가 단일 객체를 반환한다는 점에서 customers라는 복수의 이름 대신 customer로 바꿔도 되지 않을까 생각합니다!

//todo: id에 해당하는 customer를 지우고, 해당 쿼리에 영향받는 row 수반환하기
return 0;
String sql = "delete from customers where id = ?";
Integer affectedRow = jdbcTemplate.update(sql, Long.valueOf(id));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Long.valueOf(id) id가 이미 Long type이기 때문에 Long으로 타입을 변환한 이유가 있을까요?
  2. int가 아닌 Integer type으로 받은 이유가 있을까요?

//todo: id에 해당하는 customer를 지우고, 해당 쿼리에 영향받는 row 수반환하기
return 0;
String sql = "delete from customers where id = ?";
Integer affectedRow = jdbcTemplate.update(sql, Long.valueOf(id));
Copy link

@lxeso lxeso Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

간결하게 ' return jdbcTemplate.update(sql, id);' 로 가도 괜찮을 것 같습니다!

Copy link

@lxeso lxeso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

잘 해결하신 것 같습니다! 고생하셨어요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants