티스토리 뷰
728x90
반응형
SMALL
### 에러 노트: MyBatis 매퍼 오류
#### 문제 설명
- **에러 메시지**:
`ERROR 24-10-29 08:29:14[http-nio-8089-exec-2]
[[dispatcherServlet]:175] - Servlet.service() for servlet
[dispatcherServlet] in context with path [] threw exception
[Request processing failed; nested exception is org.apache.ibatis.binding.BindingException:
Mapper method 'mdt.restapi.cohttp://m.mobile.mapper.PaymentMapper.updateAccumlatedCharges'
has an unsupported return type: class mdt.restapi.cohttp://m.mobile.model.PaymentModel]
with root cause`
- **원인**: MyBatis에서 정의한 `updateAccumlatedCharges` 메소드의 반환 타입이 `PaymentModel`로 설정되어 있지만, 이는 지원되지 않는 타입이라는 오류입니다.
#### 발생 상황
업데이트 쿼리를 수행하는 메소드에서 일반적으로 반환값이 필요 없거나, 업데이트된 행의 수를 반환하는 경우가 많습니다. 현재 메소드의 반환 타입이 `PaymentModel`로 설정되어 있어 MyBatis에서 처리할 수 없습니다.
#### 해결 방안
- 반환 타입을 `int`로 변경하여 업데이트된 행의 수를 반환하도록 수정해야 합니다.
int updateAccumlatedCharges(PaymentModel paymentModel);
<update id="updateAccumlatedCharges" parameterType="mdt.restapi.cohttp://m.mobile.model.PaymentModel">
UPDATE tb_accumulated_charges ch
SET ch.accumulated_amount = #{remainPrice} + ch.accumulated_amount
WHERE token_id = #{tokenId};
</update>
728x90
반응형
LIST
'개발 > Datebase' 카테고리의 다른 글
/* SQL 오류 (3048): Out of range error: Latitude should be [-90,90] in function ST_Distance_Sphere. */ (0) | 2024.11.25 |
---|---|
XML 파서 구문 오류 (0) | 2024.11.05 |
JOIN (INNER JOIN)과 LEFT JOIN (LEFT OUTER JOIN) (0) | 2024.10.29 |
SQL 오류 노트: 오류 코드 1064 (0) | 2024.10.29 |
JPA를 nativeQuery로 변경! (UNION 사용!) (0) | 2024.01.01 |
반응형
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 현재기온넣기
- 웹개발
- 팬방명록만들기
- ajax
- 사전스터디
- 현재기온
- 유형검사
- 보험
- 웹개발종합반
- PyCharm
- HTML
- 스파르타코딩
- 웹개발3주차
- Til
- aihtnyc_h
- 12기 1주차 숙제
- 4주차
- 지니차트만들기
- 항해
- 공부하기
- 스파르타
- 2주차
- 아이들팬명록
- 12기
- 항해99
- python
- visualstudiocode
- 아이들팬명록만들기
- 초보개발자
- (여자)아이들
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
글 보관함