在springmvc与mybatis整合时,需要对每一个mapper定义对应的一个MapperFactoryBean,可以使用MapperScannerConfigurer自动扫描mapper,然后自动为我们注册对应的MapperFactoryBean对象。 例如:

<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
	<property name="annotationClass" value="org.springframework.stereotype.Repository" />
	<property name="basePackage" value="net.smui" />
</bean>

Mybatis3.2.1整合Spring3.1

相关文章:

  • 2021-11-12
  • 2021-04-22
  • 2022-03-04
  • 2022-12-23
猜你喜欢
  • 2021-05-12
  • 2022-12-23
  • 2022-01-22
  • 2021-08-21
  • 2021-04-21
  • 2021-07-12
相关资源
相似解决方案