발생한 문제. mybatis 추가 한 후 mapper 를 찾을 수 없다는 오류@AutoConfigureMybatis 추가**@AutoConfigureMybatis**는 Spring Boot와 MyBatis를 통합하여 테스트를 수행할 때 MyBatis 관련 자동 구성을 활성화하는 데 사용되는 어노테이션입니다. 이 어노테이션은 일반적으로 @WebMvcTest 또는 다른 Spring Boot 테스트 어노테이션과 함께 사용되며, MyBatis의 SqlSessionFactory, SqlSessionTemplate, 그리고 Mapper 인터페이스를 테스트 컨텍스트에 로드할 수 있도록 설정합니다.@WebMvcTest(MainController.class)@AutoConfigureMybatis@ActiveProfile..
//컨트롤러 List userList = userService.findAllPaging(startIndex, page); ...// 서비스 , 레포지토리 ... //매퍼 @Select("SELECT * FROM user limit #{startIndex}, #{pageSize}") List selectPaging(int startIndex, int pageSize); DB는 MySQL을 사용하여 limit 을 통해 0, 5 로 5개의 row만 가져오고 싶었다. 실행을 해보니 nested exception is org.apache.ibatis.binding.BindingException: Parameter 'startIndex' not found. Available parameters are [arg1, ..
1. xml를 사용하지 않고 mybatis-spring-boot-starter를 사용하여 연동해보겠습니다. https://github.com/mybatis/spring-boot-starter/wiki/Quick-Start mybatis/spring-boot-starter MyBatis integration with Spring Boot. Contribute to mybatis/spring-boot-starter development by creating an account on GitHub. github.com 빠른 시작 방법을 알 수 있습니다. implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.0' runtimeOnly 'm..
내 블로그 - 관리자 홈 전환 |
Q
Q
|
---|---|
새 글 쓰기 |
W
W
|
글 수정 (권한 있는 경우) |
E
E
|
---|---|
댓글 영역으로 이동 |
C
C
|
이 페이지의 URL 복사 |
S
S
|
---|---|
맨 위로 이동 |
T
T
|
티스토리 홈 이동 |
H
H
|
단축키 안내 |
Shift + /
⇧ + /
|
* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.