mybatis:
type-aliases-package: 指向實體類
mapper-locations: 指向 .xml
configuration:
map-underscore-to-camel-case: true
//多數據源 @Bean(name = "xxxxxxxxx") @Primary public SqlSessionFactory sqlSessionFactory(@Qualifier("xxxxxxxxx") DataSource dataSource) throws Exception { SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); bean.setDataSource(dataSource); org.apache.ibatis.session.Configuration configuration=new org.apache.ibatis.session.Configuration(); configuration.setMapUnderscoreToCamelCase(true); bean.setConfiguration(configuration); bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("xxxxxxxxx")); return bean.getObject(); }