[spring-jdbc-1] ivy.lee(이다예) 과제 제출합니다.#40
Open
dayaelee wants to merge 12 commits intoJapring-Study:ivy/spring-jdbc-1from
Open
[spring-jdbc-1] ivy.lee(이다예) 과제 제출합니다.#40dayaelee wants to merge 12 commits intoJapring-Study:ivy/spring-jdbc-1from
dayaelee wants to merge 12 commits intoJapring-Study:ivy/spring-jdbc-1from
Conversation
| //TODO : 주어진 Id에 해당하는 customer를 객체로 반환 | ||
| return null; | ||
|
|
||
| Customer customers = jdbcTemplate.queryForObject( |
There was a problem hiding this comment.
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.
Long.valueOf(id)id가 이미 Long type이기 때문에 Long으로 타입을 변환한 이유가 있을까요?- int가 아닌 Integer type으로 받은 이유가 있을까요?
lxeso
reviewed
Aug 16, 2024
| //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.
간결하게 ' return jdbcTemplate.update(sql, id);' 로 가도 괜찮을 것 같습니다!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.