赞
踩
启动时出现错误:
Invalid bound statement (not found)
原本的mybatis里面再次引入mybatis-plus之后,使用公用的BaseMapper无法使用报错:也就是无法找到sql
SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
@Bean public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception { String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage"); String mapperLocations = env.getProperty("mybatis.mapperLocations"); String configLocation = env.getProperty("mybatis.configLocation"); typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage); VFS.addImplClass(SpringBootVFS.class); // final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); MybatisSqlSessionFactoryBean sessionFactory=new MybatisSqlSessionFactoryBean(); sessionFactory.setDataSource(dataSource); sessionFactory.setTypeAliasesPackage(typeAliasesPackage); sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ","))); sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation)); return sessionFactory.getObject(); }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。