티스토리 뷰
데이터베이스
[Mybatis] A query was run and no Result Maps were found for the Mapped Statement
터프남 2021. 9. 24. 10:13728x90
Mybatis Enum Typehandler 관련해서 예제를 작성해보다가 오류 발견
아래는 메시지 내용
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.sample.mybatis.mapper.MyBatisSampleMapper.getBoardAll'. It's likely that neither a Result Type nor a Result Map was specified.
...
Caused by: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.sample.mybatis.mapper.MyBatisSampleMapper.getBoardAll'. It's likely that neither a Result Type nor a Result Map was specified.
....
... 72 more
중요한 메시지는
A query was run and no Result Maps were found for the Mapped Statement 'com.sample.mybatis.mapper.MyBatisSampleMapper.getBoardAll'. It's likely that neither a Result Type nor a Result Map was specified.
...
A query was run and no Result Maps were found for the Mapped Statement 'com.sample.mybatis.mapper.MyBatisSampleMapper.getBoardAll'. It's likely that neither a Result Type nor a Result Map was specified.
....
... 72 more
스프링 프레임워크를 포함한 잘 만들어진 프레임워크들은 오류 메시지 내용 자체가 너무 친절하다.
발번역 해보자면 쿼리가 실행되었지만 Result Type이나 Result Map이 지정되지 않았을 거라고 한다.
따라가서 봤더니 실제로 그렇게 되어있음.
<select id="getBoardAll">
SELECT BNO
, TITLE
, CONTENT
, REGDATE
, BTYPE
FROM BOARD_TBL
</select>
해결
<select id="getBoardAll" resultType 또는 resultMap 작성>
SELECT BNO
, TITLE
, CONTENT
, REGDATE
, BTYPE
FROM BOARD_TBL
</select>
728x90
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- springboot
- config-location
- jQuery
- Mac
- JavaScript
- window
- elasticsearch
- Java
- Spring
- Kotlin
- intellij
- maven
- mybatis
- LocalDateTime
- input
- svn
- Linux
- 오라클
- k8s
- Github Status
- rocky
- localtime
- 베리 심플
- oracle
- LocalDate
- docker
- Spring Security
- 북리뷰
- Bash tab
- mybatis config
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
글 보관함