[에러] parameter maps collection does not contain value for ~

602·2021년 10월 21일
1

parameter maps collection does not contain value for ~

원인

  1. mapper id

    mapper 파일 (.xml)의 < select id='...'> DAO나 Service 와 같이 mapper파일에 직접 접근하는 java파일의 id값이 서로 다를 경우

  2. Parameter와 beans의 필드명이 다른 경우
  3. Mapper 파일의 namespace와 mapper파일에 직접 접근하는 java 파일에서 호출하는 namespace가 다른 경우
  4. MyBatis config.xml 파일에 mapper가 정의되어 있지 않거나 스펠링이 틀린 경우
  5. Mapper에 정의된 namespace 명칭이 Application내에 중복될 경우

해결

imageMapper.xml와 memberMapper.xml를 구분해 작성하기로 했었는데 memberMapper에 imageDTO로 resultMap과 쿼리 작성함.

0개의 댓글