-
Notifications
You must be signed in to change notification settings - Fork 5
[spring-jdbc-1] haon.lee(이민성) 과제 제출합니다. #37
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: haon/spring-jdbc-1
Are you sure you want to change the base?
[spring-jdbc-1] haon.lee(이민성) 과제 제출합니다. #37
Conversation
swandevson
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.
LGTM
고생하셨습니다!
| public int count() { | ||
| //TODO : customers 디비에 포함되어있는 row가 몇개인지 확인하는 기능 구현 | ||
| return 0; | ||
| return jdbcTemplate.queryForObject("select count(*) from customers", Integer.class); |
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.
가독성을 위해 SQL 예약어(SELECT, FROM 등)은 대문자로 작성하시는 것이 좋을 것 같습니다!
alreadysons
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 : keyHolder에 대해 학습하고, Customer를 저장후 저장된 Customer의 id를 반환하기 | ||
| jdbcTemplate.update(connection -> { | ||
| PreparedStatement ps = connection.prepareStatement( | ||
| "insert into customers (first_name, last_name) values (?, ?)", |
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.
예약어는 대문자 사용이 좋아보입니다!!
dayaelee
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.
목적에 맞게 코드를 잘 작성하신 것 같습니다. 고생하셨습니다!
| public int delete(Long id) { | ||
| //todo: id에 해당하는 customer를 지우고, 해당 쿼리에 영향받는 row 수반환하기 | ||
| return 0; | ||
| return jdbcTemplate.update("delete from customers where id = ?", 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.
제가 아직 자바에 익숙치 않은데, 이렇게도 코드를 간략하게 작성할 수 있음에 감탄하고 덕분에 한 수 배워갑니다~!
haon(하온) JDBC 미션 제출합니다 🙂