-
Notifications
You must be signed in to change notification settings - Fork 132
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
[Spring Core] 최규원 미션 제출합니다. #271
base: kyuwon-choi
Are you sure you want to change the base?
Conversation
public record ReservationRequestDto( | ||
String name, | ||
@JsonFormat(pattern = "yyyy-MM-dd") LocalDate date, | ||
@JsonFormat(pattern = "HH:mm") LocalTime time | ||
Long time | ||
) { | ||
} |
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.
dto가 적절하게 잘 사용된 것 같습니다!
var ps = connection.prepareStatement(sql, new String[]{"id"}); | ||
ps.setString(1, reservation.getName()); | ||
ps.setDate(2, java.sql.Date.valueOf(reservation.getDate())); | ||
ps.setTime(3, java.sql.Time.valueOf(reservation.getTime())); | ||
ps.setLong(3, reservation.getTime().getId()); |
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.
저번 과제 피드백으로 받았던 NamedParameterJdbcTemplate 혹은 SimpleJdbcInsert을 사용하면 좋을 것 같아요!
SimpleJdbcInsert
NamedParameterJdbcTemplate
jdbcTemplate.update(connection -> { | ||
var ps = connection.prepareStatement(sql, new String[]{"id"}); | ||
ps.setTime(1, java.sql.Time.valueOf(time.getTime())); | ||
return ps; | ||
}, keyHolder); | ||
|
||
time.setId(keyHolder.getKey().longValue()); |
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.
위와 마찬가지로 NamedParameterJdbcTemplate 혹은 SimpleJdbcInsert이 적용되면 좋을 것 같습니다!
안녕하세요 리뷰어님!
한 주간 미션 수행하시느라 고생 많으셨습니다.
학술제와 예비군이 겹쳐 과제에 많이 신경쓰지 못 한 것 같습니다..
예외 처리들이 조금 미숙한데 미리 양해 부탁드려요ㅠ
계층화가 잘 되어있는지를 신경써서 봐 주시면 감사하겠습니다!
감사합니다!
커밋 범위