-
Notifications
You must be signed in to change notification settings - Fork 5
[spring-jdbc-1] ivy.lee(이다예) 과제 제출합니다. #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: ivy/spring-jdbc-1
Are you sure you want to change the base?
[spring-jdbc-1] ivy.lee(이다예) 과제 제출합니다. #40
Conversation
yohanii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
깔끔하게 잘 푸신 것 같습니다! 👍
KimGyeongLock
left a comment
There was a problem hiding this 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( |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long.valueOf(id)id가 이미 Long type이기 때문에 Long으로 타입을 변환한 이유가 있을까요?- int가 아닌 Integer type으로 받은 이유가 있을까요?
| //todo: id에 해당하는 customer를 지우고, 해당 쿼리에 영향받는 row 수반환하기 | ||
| return 0; | ||
| String sql = "delete from customers where id = ?"; | ||
| Integer affectedRow = jdbcTemplate.update(sql, Long.valueOf(id)); |
There was a problem hiding this comment.
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);' 로 가도 괜찮을 것 같습니다!
lxeso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
잘 해결하신 것 같습니다! 고생하셨어요!
No description provided.