작성
·
174
0
아래 코드 추가
@MapperScan("hello.itemservice.repository.mybatis")
@Configuration
@RequiredArgsConstructor
@MapperScan("hello.itemservice.repository.mybatis")
public class MyBatisConfig {
private final ItemMapper itemMapper;
@Bean
public ItemService itemService() {
return new ItemServiceV1(itemRepository());
}
@Bean
public ItemRepository itemRepository() {
return new MyBatisItemRepository(itemMapper);
}
}