ibatis나 mybatis에서 XML을 사용해서 쿼리문을 작성해서 쿼리를 실행한 경우, 아래와 같은 에러를 볼 수 있다.
java.lang.IllegalArgumentException: Mapped Statements collection does not contain value xxx.xxx.xxx.xxx
이 에러가 나는 겨우, 알면 쉽지만 모르는 경우 찾는게 쉽지 않았다.
이 에러는 매퍼(Mapper)에 선언한 메서드 이름과 매퍼 파일(XML)에 기술한 쿼리문(Select, Insert 등)의 이름이 같지 않아서 발생하게 된다.
위 에러가 발생시키는 예는 다음과 같다.
ex) 인터페이스 이름
public String print(String x) throws Exception;
ex) mapper.xml
<select id="prints" statementType="CALLABLE" parameterType="String" resultType="String"> ......................... </select>