주의! MyBatis에서 xml에 insert 사용 시 returnType이 없다.
스프링 DB 2편 - 데이터 접근 활용 기술
인터페이스 ItemRepository와 ItemMapper가 같은 줄 알고 복붙했다가 참사.. ㅠㅠ @Mapper public interface ItemMapper { Item save(Item item); void update(@Param("id") Long itemId, @Param("updateParam") ItemUpdateDto updateParam); Optional<Item> findById(Long id); List<Item> findAll(ItemSearchCond cond); } MyBatis에서 xml에 insert 사용 시 returnType 속성이 없는데 ItemMapper에서 Item을 리턴하여 에러 발생 Mapper method 'hello.itemservice.repository.mybatis.ItemMapper.save' has an unsupported return type: class hello.itemservice.domain.Item org.apache.ibatis.binding.BindingException: Mapper method 'hello.itemservice.repository.mybatis.ItemMapper.save' has an unsupported return type: class hello.itemservice.domain.Item
- mybatis
데스나이트
댓글 1
좋아요 0
조회수 2087





