mybatis获取配置文件中的sql语句+修改+执行

 
  
protected final XMLLanguageDriver XML_LANGUAGE_DRIVER = new XMLLanguageDriver();

SqlSource sqlSource = XML_LANGUAGE_DRIVER.createSqlSource(ms.getConfiguration(),newSQL,clazz);
MetaObject msObject = SystemMetaObject.forObject(ms);
msObject.setValue("sqlSource", sqlSource);
List<User> list = sqlSession.selectList(com.xxx.xxx.UserDao.select);

你可能感兴趣的:(mybatis)