fix: CalendarMapperTypeHandler의 CallableStatement getResult가 항상 null을 반환하는 문제 수정 - #328
Open
wantaekchoi wants to merge 1 commit into
Open
Conversation
… 반환하는 문제 수정 TypeHandler<Calendar>의 getResult 오버로드 넷 중 셋은 getTimestamp로 값을 읽어 Calendar로 변환하는데, getResult(CallableStatement, int)만 본문이 return null이다. getResult(ResultSet, String) rs.getTimestamp(columnName) -> Calendar getResult(ResultSet, int) rs.getTimestamp(columnIndex) -> Calendar getResult(CallableStatement, int) return null CallableStatement에도 getTimestamp(int)가 있으므로 못 읽는 것이 아니다. 저장 프로시저의 OUT 파라미터를 Calendar로 매핑하면 예외도 로그도 없이 항상 null이 돌아온다. 이 오버로드가 미지원이라는 javadoc이나 주석은 없다. 형제 오버로드 getResult(ResultSet, int)의 본문을 그대로 옮겼다. 같은 파일에서 인덱스 기반 getResult가 컬럼명 기반 형제와 달라 NULL 가드가 없던 문제를 대칭으로 고친 선례(163b704)와 같은 결이다.
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.
수정 사유 Reason for modification
수정된 소스 내용 Modified source
CalendarMapperTypeHandler의getResult오버로드 넷 중 셋은getTimestamp로 값을 읽어Calendar로 변환하는데,getResult(CallableStatement, int)만 본문이return null입니다.CallableStatement에도getTimestamp(int)가 있으므로 못 읽는 것이 아닙니다. 저장 프로시저의 OUT 파라미터를Calendar로 매핑하면 예외도 로그도 없이 항상null이 돌아옵니다.AS-IS
TO-BE
형제 오버로드
getResult(ResultSet, int)의 본문을 그대로 옮겼습니다.영향 범위
종전에 항상
null이던 경로만 값을 돌려주게 됩니다. 다른 세 오버로드는 건드리지 않았습니다.JUnit 테스트 JUnit tests
기존
CalendarMapperTypeHandlerTest에CallableStatement케이스 2건을 추가했습니다. 같은 파일이 이미 쓰고 있는Proxy방식을 그대로 따랐습니다.수정 지점만 되돌린 상태(RED)
수정 후(GREEN, 모듈 전체)