idea使用mybatis时报错error building sqlsession该如何更改,求各位帮帮忙
配置文件有问题,配置文件发出来瞅瞅
读取不到你的UserMapper.xml,看下你的配置文件是怎么配置的
Mybatis-Plus其实也可以不写mapper.xml的配置文件,所有自定义时不一定需要去扫描*.mapper.xml配置文件
@Bean
public SqlSessionFactory sqlSessionFactory(DataSourceProxy dataSourceProxy) throws Exception {
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(dataSourceProxy);
sqlSessionFactoryBean.setTypeAliasesPackage("com.bitter.storage.domain");
MybatisConfiguration configuration = new MybatisConfiguration();
configuration.setDefaultScriptingLanguage(MybatisXMLLanguageDriver.class);
configuration.setJdbcTypeForNull(JdbcType.NULL);
sqlSessionFactoryBean.setConfiguration(configuration);
sqlSessionFactoryBean.setTransactionFactory(new SpringManagedTransactionFactory());
return sqlSessionFactoryBean.getObject();
}